Skip to content

Commit 6714862

Browse files
authored
Merge pull request #33 from RetiredWizard/fruitjamfix
Screen dimension calc plus additional help info
2 parents 2b852f7 + ec382f3 commit 6714862

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

builtin_apps/PyDOS/code.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
format_exception = lambda err,value=None,tb=None: [err]
1414
if not sep+'lib' in path:
1515
path.insert(1,sep+'lib')
16-
path.append(sep+'PyBasic')
16+
path.append(f'{sep}apps{sep}PyBasic')
1717
try:
1818
from pydos_ui import Pydos_ui
1919
except ImportError:
@@ -78,19 +78,23 @@ def PyDOS():
7878
global envVars
7979
if "envVars" not in globals().keys():
8080
envVars = {}
81-
_VER = "1.51-fruitjam"
81+
_VER = "1.52-fruitjam"
8282
prmpVals = ['>','(',')','&','|','\x1b','\b','<','=',' ',_VER,'\n','$','']
8383

84-
print("Starting Py-DOS...")
85-
envVars["PATH"] = sep+";/PyBasic"
84+
print("Starting Py-DOS... Type 'help' for help.")
85+
envVars["PATH"] = f'{sep};{sep}apps{sep}PyDOS;{sep}apps{sep}PyBasic'
8686
envVars["PROMPT"] = "$P$G"
8787
envVars["LIB"] = ";".join(path[1:])
8888
envVars["DIRSEP"] = sep
8989
if Pydos_ui:
9090
(envVars["_scrHeight"],envVars["_scrWidth"]) = Pydos_ui.get_screensize()
9191
else:
92-
envVars["_scrHeight"] = 23
93-
envVars["_scrWidth"] = 89
92+
try:
93+
envVars["_scrHeight"] = runtime.display.root_group[0].height
94+
envVars["_scrWidth"] = runtime.display.root_group[0].width - 1
95+
except:
96+
envVars["_scrHeight"] = 24
97+
envVars["_scrWidth"] = 89
9498
scrWdth = int(envVars["_scrWidth"])
9599

96100
wldCLen = 0
@@ -674,11 +678,13 @@ def readBATFile(BATfile):
674678
if cmd == "" or cmd == "REM":
675679
continue
676680
elif cmd == "HELP":
677-
print("File system Commands: DIR, RENAME, DEL, TYPE, CD, MKDIR, RMDIR, COPY")
678-
print("Environment Commands: HELP, SET, PROMPT, PATH")
679-
print("Operating System Commands: EXIT, VER, MEM, DATE, TIME")
681+
print("File Commands: DIR[/p][/w][/s], RENAME, DEL[/s], TYPE[/p], CD, MKDIR, RMDIR[/s], COPY[/y]")
682+
print("Environment Commands: HELP, SET[/p][/a], PROMPT, PATH")
683+
print("Operating System Commands: EXIT, VER, MEM, DATE [mm-dd-yy], TIME [hh:mm:ss]")
680684
print("Batch Commands: GOTO, IF, ECHO, PAUSE")
681-
print("Command to execute a single Python command: PEXEC")
685+
print("Command to execute a single Python command: PEXEC [command]")
686+
print("Run a Python program: [path]program[.py]")
687+
print("Run a DOS batch file: [path]program[.bat]")
682688
elif cmd == "DIR":
683689
if len(args) == 1:
684690
prDir(os.getcwd()[(2 if os.getcwd()[1:2]==":" else 0):],swBits)

0 commit comments

Comments
 (0)