Mercurial > sumwars
view errorchecker.py @ 2963:25cdb83b3063
Translated using Weblate (French)
Currently translated at 96.5% (28 of 29 strings)
author | Jacky Blois <jacky.blois@laposte.net> |
---|---|
date | Fri, 25 May 2018 12:56:27 +0000 |
parents | d2337da133e1 |
children |
line wrap: on
line source
# this script checks for common errors when running and building sumwars for linux # run this script in your sumwars folder where the executable is import os.path #check if executable exists f = "./sumwars" if os.path.isfile(f): print("Checking for " + f + ": Ok") else: print("Checking for " + f + ": Failure! Please check the location") #check if plugins.cfg exists f = "./plugins.cfg" if os.path.isfile(f): print("Checking for " + f + ": Ok") pluginsfolder = "" of = open(f) try: for line in of: if line.startswith("PluginFolder="): pluginsfolder = line.replace("PluginFolder=", "").rstrip() #plugin folder name found, check if it exists if os.path.exists(pluginsfolder): print("Checking for " + pluginsfolder + ": Ok") else: print("Checking for " + pluginsfolder + ": Failure! Please check the file location") finally: of.close() else: print("Checking for " + f + ": Failure! Please check the file location") #check if resources.cfg exists f = "./resources.cfg" if os.path.isfile(f): print("Checking for " + f + ": Ok") else: print("Checking for " + f + ": Failure! Please check the file location") #check if resources folder exists f = "./resources" if os.path.exists(f): print("Checking for " + f + ": Ok") else: print("Checking for " + f + ": Failure! Please check the path location") #check if data folder exists f = "./data" if os.path.exists(f): print("Checking for " + f + ": Ok") else: print("Checking for " + f + ": Failure! Please check the path location") #check if save folder exists f = "./save" if os.path.exists(f): print("Checking for " + f + ": Ok") else: print("Checking for " + f + ": Failure! Please check the path location")