Add a SUGAR_PATH env to override $prefix/share/sugar

This commit is contained in:
Marco Pesenti Gritti 2007-04-15 13:54:53 +02:00
parent 5a4bf4be6b
commit ba23a6ed3a
3 changed files with 19 additions and 8 deletions

View File

@ -1,2 +1,2 @@
export GTK2_RC_FILES=@prefix@/share/sugar/gtkrc
export GTK2_RC_FILES=@prefix@/share/sugar/data/gtkrc
dbus-launch --exit-with-session sugar-shell

View File

@ -1,4 +1,4 @@
sugardir = $(pkgdatadir)
sugardir = $(pkgdatadir)/data
sugar_DATA = \
gtkrc \
gecko-prefs.js \

View File

@ -29,6 +29,17 @@ def _get_prefix_path(base, path=None):
else:
return os.path.join(prefix, base)
def _get_sugar_path(base, path=None):
if os.environ.has_key('SUGAR_PATH'):
sugar_path = os.environ['SUGAR_PATH']
else:
sugar_path = _get_prefix_path('share/sugar')
if path:
return os.path.join(sugar_path, base, path)
else:
return os.path.join(sugar_path, base)
def is_emulator():
if os.environ.has_key('SUGAR_EMULATOR'):
if os.environ['SUGAR_EMULATOR'] == 'yes':
@ -56,17 +67,17 @@ def get_profile_path(path=None):
def get_user_activities_path():
return os.path.expanduser('~/Activities')
def get_bin_path(path=None):
return _get_prefix_path('share/sugar/bin', path)
def get_locale_path(path=None):
return _get_prefix_path('share/locale', path)
def get_bin_path(path=None):
return _get_sugar_path('bin', path)
def get_service_path(name):
return _get_prefix_path('share/sugar/services', name)
return _get_sugar_path('services', name)
def get_shell_path(path=None):
return _get_prefix_path('share/sugar/shell', path)
return _get_sugar_path('shell', path)
def get_data_path(path=None):
return _get_prefix_path('share/sugar', path)
return _get_sugar_path('data', path)