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:
parent
f0205fc9b2
commit
26752b9200
@ -191,6 +191,14 @@ def mainMenu():
|
|||||||
if choice == "2": unloadMods(True); input("Press ENTER to continue.")
|
if choice == "2": unloadMods(True); input("Press ENTER to continue.")
|
||||||
if choice == "3": openModsFolder()
|
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():
|
def setupVariables():
|
||||||
global appPath
|
global appPath
|
||||||
global appName
|
global appName
|
||||||
@ -199,7 +207,14 @@ def setupVariables():
|
|||||||
global modPath
|
global modPath
|
||||||
global originalModPath
|
global originalModPath
|
||||||
|
|
||||||
|
if len(sys.argv) < 2:
|
||||||
|
appPath = requestAppPath()
|
||||||
|
else:
|
||||||
appPath = sys.argv[1]
|
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","")
|
if os.path.isdir(appPath.replace(" - umlOriginal","")): appPath = appPath.replace(" - umlOriginal","")
|
||||||
appName = appPath.replace(os.path.dirname(appPath)+ "\\","")
|
appName = appPath.replace(os.path.dirname(appPath)+ "\\","")
|
||||||
originalAppPath = appPath + " - umlOriginal"
|
originalAppPath = appPath + " - umlOriginal"
|
||||||
|
Loading…
Reference in New Issue
Block a user