[Mpuls-commits] r4368 - in base/trunk: . mpulsweb/lib/helper

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Dec 14 11:24:31 CET 2010


Author: bh
Date: 2010-12-14 11:24:29 +0100 (Tue, 14 Dec 2010)
New Revision: 4368

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/lib/helper/filters.py
Log:
* mpulsweb/lib/helper/filters.py (nl_to_br): nl_to_br is only
called with strings as arguments.  There's no need to do any
typechecks.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-12-14 10:22:45 UTC (rev 4367)
+++ base/trunk/ChangeLog	2010-12-14 10:24:29 UTC (rev 4368)
@@ -1,3 +1,9 @@
+2010-12-14  Bernhard Herzog  <bh at intevation.de>
+
+	* mpulsweb/lib/helper/filters.py (nl_to_br): nl_to_br is only
+	called with strings as arguments.  There's no need to do any
+	typechecks.
+
 2010-12-13  Roland Geider <roland.geider at intevation.de>
 
 	* mpulsweb/lib/helper/filters.py: only attempt to convert new lines to

Modified: base/trunk/mpulsweb/lib/helper/filters.py
===================================================================
--- base/trunk/mpulsweb/lib/helper/filters.py	2010-12-14 10:22:45 UTC (rev 4367)
+++ base/trunk/mpulsweb/lib/helper/filters.py	2010-12-14 10:24:29 UTC (rev 4368)
@@ -55,10 +55,9 @@
 
 def nl_to_br(text):
     """Replace newlines in text with <br> tags"""
-    if isinstance(text, basestring):
-       text = text.replace('\r\n', '<br>')
-       text = text.replace('\n', '<br>')
-       text = text.replace('\r', '<br>')
+    text = text.replace('\r\n', '<br>')
+    text = text.replace('\n', '<br>')
+    text = text.replace('\r', '<br>')
     return text
 
 # vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:



More information about the Mpuls-commits mailing list