45 lines
676 B
Python
45 lines
676 B
Python
|
|
import configparser
|
||
|
|
from pathlib import Path
|
||
|
|
|
||
|
|
#declare default vars
|
||
|
|
version = 01.02
|
||
|
|
|
||
|
|
|
||
|
|
#declare files
|
||
|
|
config = configparser.ConfigParser()
|
||
|
|
configPath = Path("Config.ini")
|
||
|
|
|
||
|
|
|
||
|
|
def makeConfig():
|
||
|
|
config['DEFAULT'] = {'Version': version}
|
||
|
|
|
||
|
|
with open('Config.ini', 'w') as configfile:
|
||
|
|
config.write(configfile)
|
||
|
|
|
||
|
|
|
||
|
|
def loadConfig():
|
||
|
|
config.read(configPath)
|
||
|
|
version = config["DEFAULT"]["Version"]
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
if configPath.exists():
|
||
|
|
print("The Config file exists.")
|
||
|
|
loadConfig()
|
||
|
|
|
||
|
|
else:
|
||
|
|
print("The file Config does not exist. - Creating")
|
||
|
|
makeConfig()
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
print("Tiropit Launcher CLI - Release Branch")
|
||
|
|
print(f"===========================[{version}]")
|
||
|
|
|
||
|
|
|
||
|
|
|