Improve resource loading: do not rely on correct working directory

Resources will now be loaded from an absolute path,
which was derived from the location of the current
module.
This commit is contained in:
f4lco
2019-01-27 18:43:56 +01:00
parent 30e239c5fe
commit e4814cf8dc
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ from canteen import Canteen
def _get_config(filename):
config = ConfigParser.SafeConfigParser()
path = os.path.join('stw_potsdam', filename)
path = os.path.join(os.path.dirname(__file__), filename)
with io.open(path, encoding='utf-8') as f:
config.readfp(f)
return config