MCPcopy Index your code
hub / github.com/RetiredWizard/PyDOS / PyDOS

Function PyDOS

PyDOS.py:71–1269  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69 return (wldCLen,recursiveFail)
70
71def PyDOS():
72
73 global envVars
74 if "envVars" not in globals().keys():
75 envVars = {}
76 _VER = "1.51"
77 prmpVals = ['>','(',')','&','|','\x1b','\b','<','=',' ',_VER,'\n','$','']
78
79 print("Starting Py-DOS...")
80 envVars["PATH"] = sep+";/PyBasic"
81 envVars["PROMPT"] = "$C$R$F$P$G"
82 envVars["LIB"] = ";".join(path[1:])
83 envVars["DIRSEP"] = sep
84 if Pydos_ui:
85 (envVars["_scrHeight"],envVars["_scrWidth"]) = Pydos_ui.get_screensize()
86 else:
87 envVars["_scrHeight"] = 24
88 envVars["_scrWidth"] = 80
89 scrWdth = int(envVars["_scrWidth"])
90
91 wldCLen = 0
92 recursiveFail = False
93
94 (wldCLen,recursiveFail) = calcWildCardLen(wldCLen,recursiveFail)
95 wldCAdj = int(1+.2*wldCLen)
96 if imp == "C":
97 wldCAdj += 5
98 wldCLen = max(1,wldCLen-wldCAdj)
99
100 if wldCLen < 60:
101 print("Wild card length set to: ",wldCLen)
102 gc.collect()
103
104 aFile = lambda dPth: bool(os.stat(dPth)[0]&(32768))
105
106 def anyKey():
107 print("Press any key to continue . . . ."[:scrWdth],end="")
108 if Pydos_ui:
109 while not Pydos_ui.serial_bytes_available():
110 pass
111 keyIn = Pydos_ui.read_keyboard(1)
112 else:
113 if imp == "C":
114 while not runtime.serial_bytes_available:
115 pass
116 keyIn = stdin.read(1)
117 print("")
118 return(keyIn)
119
120 def scrnPause(swPause,nLines,scrnLine,scrnEnd=None):
121 quit = False
122 i = 0
123 for sLine in scrnLine:
124 i += 1
125 if swPause and nLines >= int(envVars["_scrHeight"])-1:
126 key = anyKey()
127 nLines = 0
128 if key in "QqCc":

Callers 1

PyDOS.pyFile · 0.85

Calls 15

inputFunction · 0.90
readBATFileFunction · 0.85
prDirFunction · 0.85
setCondCmdFunction · 0.85
delFilesFunction · 0.85
scrnPauseFunction · 0.85
exCmdFunction · 0.85
keysMethod · 0.80
getMethod · 0.80
clearMethod · 0.80
calcWildCardLenFunction · 0.70
absolutePathFunction · 0.70

Tested by

no test coverage detected