improve resource handling by using environment and GResource (fixes #19)

This commit is contained in:
coderkun 2016-08-02 11:50:32 +02:00
parent ff15af3dbe
commit 441b854a98
4 changed files with 52 additions and 10 deletions

View file

@ -14,3 +14,17 @@ datadir = os.path.join(srcdir, '..', 'data')
# Set GSettings schema dir (if not set already)
if not os.environ.get('GSETTINGS_SCHEMA_DIR'):
os.environ['GSETTINGS_SCHEMA_DIR'] = datadir
class Environment:
"""Wrapper class to access environment settings."""
def get_srcdir():
return srcdir
def get_data(subdir):
return os.path.join(datadir, subdir)