hamster-applet r856 - trunk/hamster



Author: tbaugis
Date: Thu Mar 12 18:32:43 2009
New Revision: 856
URL: http://svn.gnome.org/viewvc/hamster-applet?rev=856&view=rev

Log:
actually actually fixing the problem this time.

Modified:
   trunk/hamster/__init__.py
   trunk/hamster/db.py

Modified: trunk/hamster/__init__.py
==============================================================================
--- trunk/hamster/__init__.py	(original)
+++ trunk/hamster/__init__.py	Thu Mar 12 18:32:43 2009
@@ -34,8 +34,7 @@
 from dispatcher import Dispatcher
 
 # Init i18n
-import __builtin__
-__builtin__._ = gettext.gettext
+gettext.install("hamster-applet", unicode = True)
 
 # Allow to use not installed hamster
 UNINSTALLED_HAMSTER = False

Modified: trunk/hamster/db.py
==============================================================================
--- trunk/hamster/db.py	(original)
+++ trunk/hamster/db.py	Thu Mar 12 18:32:43 2009
@@ -185,7 +185,7 @@
                 LEFT JOIN categories c on b.category_id = c.id
                     WHERE a.id = ? 
         """
-        return self.fetchone(query, (_(u"Unsorted"), id))
+        return self.fetchone(query, (_("Unsorted"), id))
 
     def __get_last_activity(self):
         query = """
@@ -202,10 +202,10 @@
                  ORDER BY a.start_time desc
                     LIMIT 1
         """
-        last = self.fetchone(query, (_(u"Unsorted"), dt.date.today()))
+        last = self.fetchone(query, (_("Unsorted"), dt.date.today()))
         if not last:
             #try yesterday if there is nothing today
-            last = self.fetchone(query, (_(u"Unsorted"),
+            last = self.fetchone(query, (_("Unsorted"),
                                          dt.date.today() - dt.timedelta(days=1)))
 
         if last and last["end_time"]: #will consider as last only if it is going on
@@ -353,7 +353,7 @@
         """
         end_date = end_date or date
         
-        facts = self.fetchall(query, (_(u"Unsorted"), date, end_date, date, end_date))
+        facts = self.fetchall(query, (_("Unsorted"), date, end_date, date, end_date))
         res = []
 
         today = dt.date.today()
@@ -455,7 +455,7 @@
                  GROUP BY b.category_id
                  ORDER BY popularity desc
         """
-        return self.fetchall(query, (_(u"Unsorted"), ))
+        return self.fetchall(query, (_("Unsorted"), ))
 
     def __get_interval_activity_ids(self, date, end_date = None):
         """returns activities used in the specified interval"""
@@ -469,7 +469,7 @@
         """
         end_date = end_date or date        
 
-        return self.fetchall(query, (_(u"Unsorted"), date, end_date, date, end_date))
+        return self.fetchall(query, (_("Unsorted"), date, end_date, date, end_date))
         
     
     def __remove_fact(self, fact_id):
@@ -643,16 +643,16 @@
 
     def run_fixtures(self):
         # defaults
-        work_category = {"name": _(u"Work"),
-                         "entries": [_(u"Reading news"),
-                                     _(u"Checking stocks"),
-                                     _(u"Super secret project X"),
-                                     _(u"World domination")]}
-        
-        nonwork_category = {"name": _(u"Day to day"),
-                            "entries": [_(u"Lunch"),
-                                        _(u"Watering flowers"),
-                                        _(u"Doing handstands")]}
+        work_category = {"name": _("Work"),
+                         "entries": [_("Reading news"),
+                                     _("Checking stocks"),
+                                     _("Super secret project X"),
+                                     _("World domination")]}
+        
+        nonwork_category = {"name": _("Day to day"),
+                            "entries": [_("Lunch"),
+                                        _("Watering flowers"),
+                                        _("Doing handstands")]}
         
         """upgrade DB to hamster version"""
         version = self.fetchone("SELECT version FROM version")["version"]
@@ -835,13 +835,13 @@
         category_count = self.fetchone("select count(*) from categories")[0]
         
         if category_count == 0:
-            work_cat_id = self.__add_category(_(work_category["name"]))
+            work_cat_id = self.__add_category(work_category["name"])
             for entry in work_category["entries"]:
-                self.__add_activity(_(entry), work_cat_id)
+                self.__add_activity(entry, work_cat_id)
         
-            nonwork_cat_id = self.__add_category(_(nonwork_category["name"]))
+            nonwork_cat_id = self.__add_category(nonwork_category["name"])
             for entry in nonwork_category["entries"]:
-                self.__add_activity(_(entry), nonwork_cat_id)
+                self.__add_activity(entry, nonwork_cat_id)
         
         
         



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