[hamster-applet] avoid circular client-server dependency. fixes bug 619700



commit 2140ded7fa56177297d579ce4c4c819c944e6f15
Author: Toms Bauģis <toms baugis gmail com>
Date:   Wed May 26 13:11:27 2010 +0100

    avoid circular client-server dependency. fixes bug 619700

 src/hamster/stuff.py |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/hamster/stuff.py b/src/hamster/stuff.py
index 80b48ef..ce4fb45 100644
--- a/src/hamster/stuff.py
+++ b/src/hamster/stuff.py
@@ -34,9 +34,14 @@ import gettext, locale
 import os
 
 def setup_i18n():
-    # Setup i18n
-    from configuration import runtime
-    locale_dir = os.path.abspath(os.path.join(runtime.data_dir, "..", "locale"))
+    #determine location of po files
+    try:
+        import defs
+        data_dir = defs.DATA_DIR
+    except:
+        data_dir = os.path.join(realpath(__file__), '..', 'data')
+
+    locale_dir = os.path.abspath(os.path.join(data_dir, "..", "locale"))
     for module in (gettext, locale):
         module.bindtextdomain('hamster-applet', locale_dir)
         module.textdomain('hamster-applet')



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]