diff --git a/libstormgames.py b/libstormgames.py index fbe33d5..a8b54f2 100755 --- a/libstormgames.py +++ b/libstormgames.py @@ -47,17 +47,18 @@ class scoreboard(): def write_config(writeGlobal = False): if writeGlobal == False: - with open(gamePath, 'w') as configfile: + with open(gamePath + "config.ini", 'w') as configfile: localConfig.write(configfile) else: - with open(globalPath, 'w') as configfile: + with open(globalPath + "config.ini", 'w') as configfile: globalConfig.write(configfile) def read_config(section, value, readGlobal = False): if readGlobal == False: - with open(gamePath, 'r') as configfile: + with open(gamePath + "config.ini", 'r') as configfile: return localConfig.read(section, value) else: + with open(globalPath + "config.ini", 'r') as configfile: return globalConfig.read(section, value) def speak(text, interupt = True): @@ -80,8 +81,7 @@ def initialize_gui(gameTitle): global globalPath global gamePath globalPath = BaseDirectory.xdg_config_home + "/storm-games" - gamePath = globalPath + "/" + str.lower(str.replace(gameTitle, " ", "-") + "/config") - globalPath = globalPath + "/config" + gamePath = globalPath + "/" + str.lower(str.replace(gameTitle, " ", "-")) if not os.path.exists(gamePath): os.makedirs(gamePath) # Seed the random generator to the clock random.seed()