Skip to content

Commit

Permalink
Move GRAMPS_RESOURCE default into grampsapp.main()
Browse files Browse the repository at this point in the history
  • Loading branch information
Doug Blank committed Apr 15, 2016
1 parent dd55b36 commit d71f949
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions Gramps.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,5 @@
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()
4 changes: 4 additions & 0 deletions gramps/grampsapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d71f949

Please # to comment.