hamster-applet r760 - branches/gnome-2-26/hamster



Author: tbaugis
Date: Fri Feb 20 18:20:33 2009
New Revision: 760
URL: http://svn.gnome.org/viewvc/hamster-applet?rev=760&view=rev

Log:
utf-8 fixes for python 2.6

Modified:
   branches/gnome-2-26/hamster/add_custom_fact.py
   branches/gnome-2-26/hamster/preferences.py

Modified: branches/gnome-2-26/hamster/add_custom_fact.py
==============================================================================
--- branches/gnome-2-26/hamster/add_custom_fact.py	(original)
+++ branches/gnome-2-26/hamster/add_custom_fact.py	Fri Feb 20 18:20:33 2009
@@ -217,14 +217,15 @@
         
     
     def on_ok_clicked(self, button):
-        activity = self.get_widget("activity-list").get_child().get_text()
+        activity = self.get_widget("activity-list").get_child().get_text().decode("utf-8")
         
         if not activity:
             return False
 
         # juggle with description - break into parts and then put together
         buf = self.get_widget('description').get_buffer()
-        description = buf.get_text(buf.get_start_iter(), buf.get_end_iter(), 0)
+        description = buf.get_text(buf.get_start_iter(), buf.get_end_iter(), 0)\
+                         .decode("utf-8")
         description = description.strip()
         
         # user might also type description in the activity name - strip it here

Modified: branches/gnome-2-26/hamster/preferences.py
==============================================================================
--- branches/gnome-2-26/hamster/preferences.py	(original)
+++ branches/gnome-2-26/hamster/preferences.py	Fri Feb 20 18:20:33 2009
@@ -315,7 +315,8 @@
                     self.category_store.remove(model.get_iter(path))
                 self.select_category(category['id'])
                 return False
-
+        
+        new_text = new_text.decode("utf-8")
         if id == -2: #new category
             id = storage.add_category(new_text)
             model[path][0] = id
@@ -338,7 +339,7 @@
                 self.select_activity(activity['id'])
                 return False
         
-        model[path][0] = storage.add_activity(new_text, category_id)
+        model[path][0] = storage.add_activity(new_text.decode("utf-8"), category_id)
         model[path][1] = new_text
         return True
         



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