File tree 3 files changed +26
-13
lines changed
3 files changed +26
-13
lines changed Original file line number Diff line number Diff line change 8
8
import bitmaptools
9
9
import displayio
10
10
from os import getenv
11
+ from supervisor import runtime
11
12
try :
12
13
from pydos_ui import Pydos_ui
13
14
from pydos_ui import input
19
20
type (envVars )
20
21
except :
21
22
envVars = {}
22
-
23
+
24
+ display = None
23
25
if '_display' in envVars .keys ():
24
26
display = envVars ['_display' ]
25
27
elif Pydos_display :
26
28
display = Pydos_ui .display
27
- elif 'DISPLAY' in dir ( board ):
29
+ elif bool ( getattr ( board , 'DISPLAY' , False ) ):
28
30
display = board .DISPLAY
31
+ elif bool (getattr (runtime ,'display' ,False )):
32
+ display = runtime .display
29
33
else :
30
34
try :
31
- import matrix
32
- display = matrix . envVars [ '_display' ]
35
+ import framebufferio
36
+ import dotclockframebuffer
33
37
except :
34
38
try :
35
- import framebufferio
36
- import dotclockframebuffer
39
+ import adafruit_ili9341
37
40
except :
38
41
try :
39
- import adafruit_ili9341
40
- except :
41
- import framebufferio
42
+ # import framebufferio
42
43
import picodvi
44
+ except :
45
+ import matrix
46
+ display = matrix .envVars ['_display' ]
43
47
48
+ if display == None :
44
49
displayio .release_displays ()
45
50
46
51
if 'TFT_PINS' in dir (board ):
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ def absolutePath(argPath,currDir):
67
67
scrWidth = 80
68
68
69
69
if "_scrollable" in envVars .keys ():
70
- scrollable = (envVars ["_scrollable" ] == True )
70
+ scrollable = (envVars ["_scrollable" ] == True ) or ( envVars [ "_scrollable" ] == "True" )
71
71
else :
72
72
try :
73
73
scrollable = Pydos_ui .scrollable
Original file line number Diff line number Diff line change 6
6
import select
7
7
if implementation .name .upper () == "CIRCUITPYTHON" :
8
8
import board
9
+ from supervisor import runtime
9
10
try :
10
11
from displayio import CIRCUITPYTHON_TERMINAL as TERM
11
12
from terminalio import FONT
15
16
class PyDOS_UI :
16
17
17
18
def __init__ (self ):
18
- if implementation .name .upper () == "CIRCUITPYTHON" and 'DISPLAY' in dir (board ):
19
+ if implementation .name .upper () == "CIRCUITPYTHON" :
20
+
19
21
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
20
28
else :
21
29
self .scrollable = True
22
30
@@ -45,8 +53,8 @@ def get_screensize(self,disp=None):
45
53
dhigh = disp .height
46
54
dwide = disp .width
47
55
else :
48
- dhigh = board . DISPLAY .height
49
- dwide = board . DISPLAY .width
56
+ dhigh = self . display .height
57
+ dwide = self . display .width
50
58
51
59
height = round (dhigh / (FONT .bitmap .height * TERM .scale ))- 1
52
60
width = round (dwide / ((FONT .bitmap .width / 95 )* TERM .scale ))- 2
You can’t perform that action at this time.
0 commit comments