Implemented simple console tool
This commit is contained in:
parent
91423d54fa
commit
afa043df74
@ -292,8 +292,30 @@ def requestAppPath():
|
|||||||
clear()
|
clear()
|
||||||
dir = input("Please insert a folder via Drag&Drop:\n")
|
dir = input("Please insert a folder via Drag&Drop:\n")
|
||||||
dir = dir.replace('"',"")
|
dir = dir.replace('"',"")
|
||||||
if os.path.isdir(dir) == True:
|
|
||||||
return dir
|
if dir == "console":
|
||||||
|
console()
|
||||||
|
else:
|
||||||
|
if os.path.isdir(dir) == True:
|
||||||
|
return dir
|
||||||
|
|
||||||
|
def console():
|
||||||
|
clear()
|
||||||
|
print("UniversalModloader Console")
|
||||||
|
print("Version: " +umlVerStr)
|
||||||
|
print("")
|
||||||
|
|
||||||
|
while True:
|
||||||
|
cmd = input(os.getcwd()+ ">")
|
||||||
|
if cmd.startswith("pyc "):
|
||||||
|
try:
|
||||||
|
exec(cmd[4:])
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
else:
|
||||||
|
os.system(cmd)
|
||||||
|
|
||||||
|
print("")
|
||||||
|
|
||||||
def setupVariables():
|
def setupVariables():
|
||||||
global appPath
|
global appPath
|
||||||
@ -308,6 +330,9 @@ def setupVariables():
|
|||||||
else:
|
else:
|
||||||
appPath = sys.argv[1]
|
appPath = sys.argv[1]
|
||||||
|
|
||||||
|
if appPath == "console":
|
||||||
|
console()
|
||||||
|
|
||||||
if os.path.isdir(appPath) == False:
|
if os.path.isdir(appPath) == False:
|
||||||
raise NameError("Folder not found: " +appPath)
|
raise NameError("Folder not found: " +appPath)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user