Remove drag+drop requirement

- program can be used without initializing by drag+drop
- added temporary error handling for non-existant folders
This commit is contained in:
Fierelier 2017-07-21 10:19:16 +02:00
parent f0205fc9b2
commit 26752b9200

View File

@ -191,6 +191,14 @@ def mainMenu():
if choice == "2": unloadMods(True); input("Press ENTER to continue.")
if choice == "3": openModsFolder()
def requestAppPath():
while True:
clear()
dir = input("Please insert a folder via Drag&Drop:\n")
dir = dir.replace('"',"")
if os.path.isdir(dir) == True:
return dir
def setupVariables():
global appPath
global appName
@ -199,7 +207,14 @@ def setupVariables():
global modPath
global originalModPath
appPath = sys.argv[1]
if len(sys.argv) < 2:
appPath = requestAppPath()
else:
appPath = sys.argv[1]
if os.path.isdir(appPath) == False:
raise NameError("Folder not found: " +appPath)
if os.path.isdir(appPath.replace(" - umlOriginal","")): appPath = appPath.replace(" - umlOriginal","")
appName = appPath.replace(os.path.dirname(appPath)+ "\\","")
originalAppPath = appPath + " - umlOriginal"