File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88import bitmaptools
99import displayio
1010from os import getenv
11+ from supervisor import runtime
1112try :
1213 from pydos_ui import Pydos_ui
1314 from pydos_ui import input
1920 type (envVars )
2021except :
2122 envVars = {}
22-
23+
24+ display = None
2325if '_display' in envVars .keys ():
2426 display = envVars ['_display' ]
2527elif Pydos_display :
2628 display = Pydos_ui .display
27- elif 'DISPLAY' in dir ( board ):
29+ elif bool ( getattr ( board , 'DISPLAY' , False ) ):
2830 display = board .DISPLAY
31+ elif bool (getattr (runtime ,'display' ,False )):
32+ display = runtime .display
2933else :
3034 try :
31- import matrix
32- display = matrix . envVars [ '_display' ]
35+ import framebufferio
36+ import dotclockframebuffer
3337 except :
3438 try :
35- import framebufferio
36- import dotclockframebuffer
39+ import adafruit_ili9341
3740 except :
3841 try :
39- import adafruit_ili9341
40- except :
41- import framebufferio
42+ # import framebufferio
4243 import picodvi
44+ except :
45+ import matrix
46+ display = matrix .envVars ['_display' ]
4347
48+ if display == None :
4449 displayio .release_displays ()
4550
4651 if 'TFT_PINS' in dir (board ):
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ def absolutePath(argPath,currDir):
6767 scrWidth = 80
6868
6969 if "_scrollable" in envVars .keys ():
70- scrollable = (envVars ["_scrollable" ] == True )
70+ scrollable = (envVars ["_scrollable" ] == True ) or ( envVars [ "_scrollable" ] == "True" )
7171 else :
7272 try :
7373 scrollable = Pydos_ui .scrollable
Original file line number Diff line number Diff line change 66import select
77if implementation .name .upper () == "CIRCUITPYTHON" :
88 import board
9+ from supervisor import runtime
910 try :
1011 from displayio import CIRCUITPYTHON_TERMINAL as TERM
1112 from terminalio import FONT
1516class PyDOS_UI :
1617
1718 def __init__ (self ):
18- if implementation .name .upper () == "CIRCUITPYTHON" and 'DISPLAY' in dir (board ):
19+ if implementation .name .upper () == "CIRCUITPYTHON" :
20+
1921 self .scrollable = False
22+ if bool (getattr (board ,'DISPLAY' ,False )):
23+ self .display = board .DISPLAY
24+ elif bool (getattr (runtime ,'display' ,False )):
25+ self .display = runtime .display
26+ else :
27+ self .scrollable = True
2028 else :
2129 self .scrollable = True
2230
@@ -45,8 +53,8 @@ def get_screensize(self,disp=None):
4553 dhigh = disp .height
4654 dwide = disp .width
4755 else :
48- dhigh = board . DISPLAY .height
49- dwide = board . DISPLAY .width
56+ dhigh = self . display .height
57+ dwide = self . display .width
5058
5159 height = round (dhigh / (FONT .bitmap .height * TERM .scale ))- 1
5260 width = round (dwide / ((FONT .bitmap .width / 95 )* TERM .scale ))- 2
You can’t perform that action at this time.
0 commit comments