fix setting environment for GSettings schema dir
This commit is contained in:
parent
f38737e6ba
commit
ff15af3dbe
2 changed files with 12 additions and 6 deletions
5
mcg.py
5
mcg.py
|
@ -12,11 +12,6 @@ from mcg.application import Application
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Set environment
|
||||
srcdir = os.path.abspath(os.path.dirname(__file__))
|
||||
if not os.environ.get('GSETTINGS_SCHEMA_DIR'):
|
||||
os.environ['GSETTINGS_SCHEMA_DIR'] = os.path.join(srcdir, 'data')
|
||||
|
||||
# Start application
|
||||
app = Application()
|
||||
exit_status = app.run(sys.argv)
|
||||
|
|
|
@ -1,5 +1,16 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
import os
|
||||
|
||||
|
||||
|
||||
|
||||
# Set environment
|
||||
srcdir = os.path.abspath(os.path.dirname(__file__))
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue