From 9e3b6195d6885941a5573ee48ad3d7d12741cd65 Mon Sep 17 00:00:00 2001 From: punkrockguy318 Date: Wed, 29 Apr 2009 04:39:47 +0000 Subject: [PATCH] gfceux now runs from its source directory without being installed --- ChangeLog | 4 +++- gfceux | 6 ++++-- src/main.py | 6 +++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5e03f1af..8e18e970 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ -================= version 2.1 ( yet to be released) ============ +* Gfceux now runs properly from the source directory without +being installed +================= version 2.1 ====================== ============ * Increased the width of the sdl inputcfg window to be more visible with larger font sizes * Uninstall script works better diff --git a/gfceux b/gfceux index ebb19d37..54e8705a 100755 --- a/gfceux +++ b/gfceux @@ -5,8 +5,10 @@ # Lukas Sabota # # - -from gfceux import main +try: + from gfceux import main +except: + from src import main app = main.GfceuxApp() diff --git a/src/main.py b/src/main.py index 066ac7b8..0710e7e1 100755 --- a/src/main.py +++ b/src/main.py @@ -280,14 +280,14 @@ class GfceuxApp: global widgets """ Search for the glade XML file and load it """ # Check first in the directory of this script. - if os.path.isfile('gfceux.xml'): - glade_file = 'gfceux.xml' + if os.path.isfile('data/gfceux.xml'): + glade_file = 'data/gfceux.xml' # Then check to see if its installed on a *nix system elif os.path.isfile(os.path.join(os.path.dirname(sys.argv[0]), '../share/gfceux/gfceux.xml')): glade_file = os.path.join(os.path.dirname(sys.argv[0]), '../share/gfceux/gfceux.xml') else: print 'ERROR.' - print 'Could not find the ' + glade_file + ' file.' + print 'Could not find the glade UI file.' print 'Try reinstalling the application.' sys.exit(1)