Reworked config structure

This commit is contained in:
Sunpy
2018-10-09 10:54:35 +02:00
parent 5111b6b05f
commit 848dacf621
8 changed files with 54 additions and 30 deletions

View File

@@ -73,6 +73,8 @@ class config:
self.config.get("localize","enable")
self.config.get("localize","ipapiurl")
self.config.get("custom", "config")
return True
except configparser.Error:
return False
@@ -140,6 +142,9 @@ class config:
self.config.set("localize", "enable", "1")
self.config.set("localize", "ipapiurl", "http://ip.zxq.co")
self.config.add_section("custom")
self.config.set("custom", "config", "common/config.json")
# Write ini to file and close
self.config.write(f)
f.close()

View File

@@ -27,8 +27,11 @@ def printServerStartHeader(asciiArt=True):
print("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^{}".format(bcolors.ENDC))
printColored("> Welcome to pep.py osu!bancho server v{}".format(glob.VERSION), bcolors.GREEN)
printColored("> Common submodule v{}".format(glob.COMMON_VERSION), bcolors.GREEN)
printColored("> Made by the Ripple team", bcolors.GREEN)
printColored("> {}https://zxq.co/ripple/pep.py".format(bcolors.UNDERLINE), bcolors.GREEN)
printColored("> Custom branch by the osufx team (just Sunpy)", bcolors.GREEN)
printColored("> {}https://github.com/osufx/pep.py".format(bcolors.UNDERLINE), bcolors.GREEN)
printColored("> Press CTRL+C to exit\n", bcolors.GREEN)
def printNoNl(string):