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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Feb 10 18:33:14 CET 2011


Author: bh
Date: 2011-02-10 18:33:13 +0100 (Thu, 10 Feb 2011)
New Revision: 4609

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/lib/helper/filters.py
Log:
* mpulsweb/lib/helper/filters.py (nl_to_br): Removed.  Import the
identical function from formed.renderer.helpers instead.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2011-02-10 17:31:00 UTC (rev 4608)
+++ base/trunk/ChangeLog	2011-02-10 17:33:13 UTC (rev 4609)
@@ -1,5 +1,10 @@
 2011-02-10  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/lib/helper/filters.py (nl_to_br): Removed.  Import the
+	identical function from formed.renderer.helpers instead.
+
+2011-02-10  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/lib/helpers.py: Do not import nl_to_br anymore. The
 	last code that used this function through the helpers module was
 	in waska and that has been changed with revision 4607.

Modified: base/trunk/mpulsweb/lib/helper/filters.py
===================================================================
--- base/trunk/mpulsweb/lib/helper/filters.py	2011-02-10 17:31:00 UTC (rev 4608)
+++ base/trunk/mpulsweb/lib/helper/filters.py	2011-02-10 17:33:13 UTC (rev 4609)
@@ -31,6 +31,10 @@
 from cgi import escape
 import logging
 
+# nl_to_br is not used directly in this module. Many templates access it
+# through this module, though, so this import shouldn't be removed.
+from formed.renderer.helpers import nl_to_br
+
 log = logging.getLogger(__name__)
 
 def no_none(text):
@@ -53,11 +57,4 @@
         log.warning('Trying to shorten a non string type: %s' % text)
     return text
 
-def nl_to_br(text):
-    """Replace newlines in text with <br> tags"""
-    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