[Mpuls-commits] r1719 - in wasko/branches/2.0: . mpulsweb/lib/helper

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Feb 23 20:20:10 CET 2010


Author: bh
Date: 2010-02-23 20:20:09 +0100 (Tue, 23 Feb 2010)
New Revision: 1719

Modified:
   wasko/branches/2.0/ChangeLog
   wasko/branches/2.0/mpulsweb/lib/helper/filters.py
Log:
* mpulsweb/lib/helper/filters.py (no_none, NA): Simplify check for
empty value.  Now both functions use the same test.
There's no need to check for the unicode variants explicitly
because byte-strings are automatically converted to unicode
anyway.  Also NA now also return "-/-" when the value is None.


Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog	2010-02-23 16:58:48 UTC (rev 1718)
+++ wasko/branches/2.0/ChangeLog	2010-02-23 19:20:09 UTC (rev 1719)
@@ -1,5 +1,13 @@
 2010-02-23  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/lib/helper/filters.py (no_none, NA): Simplify check for
+	empty value.  Now both functions use the same test.
+	There's no need to check for the unicode variants explicitly
+	because byte-strings are automatically converted to unicode
+	anyway.  Also NA now also return "-/-" when the value is None.
+
+2010-02-23  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/lib/renderer.py: Remove unused imports
 
 2010-02-23  Bernhard Herzog  <bh at intevation.de>

Modified: wasko/branches/2.0/mpulsweb/lib/helper/filters.py
===================================================================
--- wasko/branches/2.0/mpulsweb/lib/helper/filters.py	2010-02-23 16:58:48 UTC (rev 1718)
+++ wasko/branches/2.0/mpulsweb/lib/helper/filters.py	2010-02-23 19:20:09 UTC (rev 1719)
@@ -31,12 +31,12 @@
 from cgi import escape
 
 def no_none(text):
-    if text == 'None' or text == u'None' or not text:
+    if text == 'None' or not text:
         return ''
     return text
 
 def NA(text):
-    if text == 'None' or text == u'None' or text == '' or text == u'':
+    if text == 'None' or not text:
         return '-/-'
     return text
 



More information about the Mpuls-commits mailing list