HiddenEye-Legacy/Defs/Configurations.py
Artur Tretiak a892d1b73f Created Simple Theme Manager
New option in Settings.ini
New console argument
Ability to set theme as default
New theme "ocean"
2019-05-05 16:20:45 +03:00

28 lines
736 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")
config.set("Defaults", "theme", "anaglyph")
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()