From d71f9494b8448e208f017aae69359bfc17d8b200 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Thu, 14 Apr 2016 20:58:27 -0400 Subject: [PATCH] Move GRAMPS_RESOURCE default into grampsapp.main() --- Gramps.py | 2 -- gramps/grampsapp.py | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Gramps.py b/Gramps.py index 1ff357298..1fdaa8a07 100755 --- a/Gramps.py +++ b/Gramps.py @@ -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() diff --git a/gramps/grampsapp.py b/gramps/grampsapp.py index 791e0266c..d8c89b0ae 100644 --- a/gramps/grampsapp.py +++ b/gramps/grampsapp.py @@ -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: