HiddenEye-Legacy/Defs/Configurations.py
Artur Tretiak ed5b8fe41c Little fix
Fix - word from comment was remover
2018-10-29 23:26:02 +02:00

24 lines
688 B
Python

#Primitive config
import configparser
import os
def createConfig(path = "Settings.ini"):
config = configparser.ConfigParser()
config.add_section("Settings")
config.add_section("Defaults")
config.set("Settings", "Language", "en")
config.set("Settings", "DidBackground", "True")
config.set("Defaults", "webPage", "Facebook")
config.set("Defaults", "additionalOption", "1")
with open(path, 'w') as configFile:
config.write(configFile)
def readConfig(path = "Settings.ini"):
config = configparser.ConfigParser()
config.read(path)
return config
def ifSettingsNotExists():
if not os.path.exists("Settings.ini"):
createConfig()