Move GRAMPS_RESOURCE default into grampsapp.main()

This commit is contained in:
Doug Blank 2016-04-14 20:58:27 -04:00
parent dd55b367ce
commit d71f9494b8
2 changed files with 4 additions and 2 deletions

View File

@ -25,7 +25,5 @@ able to run gramps from the source directory without setting PYTHONPATH
From this position, import gramps works great
"""
import os
os.environ['GRAMPS_RESOURCES'] = os.path.dirname(os.path.abspath(__file__))
import gramps.grampsapp as app
app.main()

View File

@ -442,6 +442,10 @@ def run():
startcli(error, argpars)
def main():
if 'GRAMPS_RESOURCES' not in os.environ:
resource_path, filename = os.path.split(os.path.abspath(__file__))
resource_path, dirname = os.path.split(resource_path)
os.environ['GRAMPS_RESOURCES'] = resource_path
errors = run()
if errors and isinstance(errors, list):
for error in errors: