view errorchecker.py @ 3023:03a38e7ec5f3 default tip

Translated using Weblate (Russian) Currently translated at 66.3% (126 of 190 strings)
author Artem <KovalevArtem.ru@gmail.com>
date Fri, 03 Jul 2020 22:16:25 +0200
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")