Quick and dirty API support, sort of
UML will be rewritten soon, however, I still wanted to add simplistic API support. - Initialization moved into its own function - Title does not get set if api == True - Program only gets initialized if __name__ equals "__main__", so it can be used as an API
This commit is contained in:
parent
2369d5acec
commit
01c926bf67
@ -30,6 +30,7 @@ originalAppPath = False
|
|||||||
tmpAppPath = False
|
tmpAppPath = False
|
||||||
modPath = False
|
modPath = False
|
||||||
originalModPath = False
|
originalModPath = False
|
||||||
|
api = True
|
||||||
|
|
||||||
#Exception Handler
|
#Exception Handler
|
||||||
def openFileWithStandardApp(path):
|
def openFileWithStandardApp(path):
|
||||||
@ -276,6 +277,7 @@ def walklevel(some_dir, level=1):
|
|||||||
del dirs[:]
|
del dirs[:]
|
||||||
|
|
||||||
def title(string):
|
def title(string):
|
||||||
|
if api == True: return
|
||||||
if os.name == "nt":
|
if os.name == "nt":
|
||||||
os.system("title " +string)
|
os.system("title " +string)
|
||||||
else:
|
else:
|
||||||
@ -409,13 +411,17 @@ def setupVariables():
|
|||||||
modPath = os.path.join(appPath + " - umlMods")
|
modPath = os.path.join(appPath + " - umlMods")
|
||||||
originalModPath = modPath
|
originalModPath = modPath
|
||||||
|
|
||||||
#Init
|
def init():
|
||||||
title("Fier's Universal Modloader - " +uml.versionString)
|
api = False
|
||||||
setupVariables()
|
title("Fier's Universal Modloader - " +uml.versionString)
|
||||||
title("Fier's Universal Modloader - " +uml.versionString+ " : " +appName)
|
setupVariables()
|
||||||
|
title("Fier's Universal Modloader - " +uml.versionString+ " : " +appName)
|
||||||
|
|
||||||
cleanUp()
|
cleanUp()
|
||||||
checkUp()
|
checkUp()
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
mainMenu()
|
mainMenu()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
init()
|
Loading…
Reference in New Issue
Block a user