From 1c361ea5dd1349ddcb95e21de91a0aa036415ff7 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Mon, 4 Feb 2008 19:16:46 +0100 Subject: [PATCH] Add a config module into the shell holding path informations. Get rid of env.get_locale_path() --- bin/sugar-shell | 5 ++++- configure.ac | 5 ++++- lib/sugar/env.py | 3 --- shell/Makefile.am | 1 + 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/bin/sugar-shell b/bin/sugar-shell index ef69fc1a..b8f44a35 100755 --- a/bin/sugar-shell +++ b/bin/sugar-shell @@ -41,6 +41,7 @@ from shellservice import ShellService from hardware import hardwaremanager from intro import intro import logsmanager +import config def _start_matchbox(): cmd = ['matchbox-window-manager'] @@ -68,8 +69,10 @@ def _save_session_info(): f.close() def _setup_translations(): + locale_path = os.path.join(config.prefix, 'share', 'locale') domain = 'sugar' - gettext.bindtextdomain(domain, env.get_locale_path()) + + gettext.bindtextdomain(domain, locale_path) gettext.textdomain(domain) def check_cm(bus_name): diff --git a/configure.ac b/configure.ac index 930f6b62..b8d98288 100644 --- a/configure.ac +++ b/configure.ac @@ -39,7 +39,10 @@ AC_ARG_ENABLE(update-mimedb, enable_update_mimedb=yes) AM_CONDITIONAL(ENABLE_UPDATE_MIMEDB, test x$enable_update_mimedb = xyes) -AC_CONFIG_FILES([bin/sugar], [chmod +x sugar]) +AC_CONFIG_FILES([ +bin/sugar +shell/config.py +], [chmod +x sugar]) AC_OUTPUT([ Makefile diff --git a/lib/sugar/env.py b/lib/sugar/env.py index a067cb88..3845a0f8 100644 --- a/lib/sugar/env.py +++ b/lib/sugar/env.py @@ -77,9 +77,6 @@ def get_user_activities_path(): def get_user_library_path(): return os.path.expanduser('~/Library') -def get_locale_path(path=None): - return get_prefix_path('share/locale', path) - def get_service_path(name): return _get_sugar_path('services', name) diff --git a/shell/Makefile.am b/shell/Makefile.am index 4c9eac9f..e3e97109 100644 --- a/shell/Makefile.am +++ b/shell/Makefile.am @@ -2,6 +2,7 @@ SUBDIRS = controlpanel hardware model view intro sugardir = $(pkgdatadir)/shell sugar_PYTHON = \ + config.py \ logsmanager.py \ shellservice.py