changeset 43:39d845d3fec4

Fix for #1638
author Sascha L. Teichmann <teichmann@intevation.de>
date Wed, 15 Dec 2010 12:40:40 +0100
parents a5439795ef09
children f10126519797
files ChangeLog getan/states.py getan/view.py
diffstat 3 files changed, 16 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Dec 15 12:02:55 2010 +0100
+++ b/ChangeLog	Wed Dec 15 12:40:40 2010 +0100
@@ -1,3 +1,10 @@
+2010-12-15	Sascha L. Teichmann <sascha.teichmann@intevation.de>
+
+	Fix for #1638
+
+	* getan/view.py: use preferred encoding in uwid
+	* getan/states.py: Fixed another no-project bug.
+
 2010-12-15	Sascha L. Teichmann <sascha.teichmann@intevation.de>
 
 	Make getan runnable if there is no project in database.
--- a/getan/states.py	Wed Dec 15 12:02:55 2010 +0100
+++ b/getan/states.py	Wed Dec 15 12:40:40 2010 +0100
@@ -303,10 +303,11 @@
 
     def exit(self):
         project = self.view.item_in_focus()
-        time    = (datetime.now() - project.start).seconds
-        self.state.sec = time
-        signal.signal(signal.SIGALRM, self.state.handle_signal)
-        signal.alarm(1)
+        if project:
+            time = (datetime.now() - project.start).seconds
+            self.state.sec = time
+            signal.signal(signal.SIGALRM, self.state.handle_signal)
+            signal.alarm(1)
         return self.state
  
 
--- a/getan/view.py	Wed Dec 15 12:02:55 2010 +0100
+++ b/getan/view.py	Wed Dec 15 12:40:40 2010 +0100
@@ -8,6 +8,7 @@
 #
 
 import logging
+import locale
 
 import urwid
 import urwid.raw_display
@@ -322,7 +323,9 @@
     ]
 
     def __init__(self, controller, proj_list, entr_list):
-        urwid.set_encoding("UTF-8")
+        encoding = locale.getpreferredencoding()
+        urwid.set_encoding(encoding)
+        logger.debug("used encoding: %s" % encoding)
         self.controller = controller
         self.proj_list  = proj_list
         self.entr_list  = entr_list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)