[Mpuls-commits] r773 - in wasko/branches/2.0: . waskaweb/lib waskaweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Jan 19 20:54:09 CET 2010


Author: bh
Date: 2010-01-19 20:54:08 +0100 (Tue, 19 Jan 2010)
New Revision: 773

Modified:
   wasko/branches/2.0/ChangeLog.txt
   wasko/branches/2.0/waskaweb/lib/helpers.py
   wasko/branches/2.0/waskaweb/model/phases_factory.py
Log:
* waskaweb/model/phases_factory.py (space_short),
waskaweb/lib/helpers.py (space_short): Move space_short from
helpers to phases_factory because that's the only place where it's
used.


Modified: wasko/branches/2.0/ChangeLog.txt
===================================================================
--- wasko/branches/2.0/ChangeLog.txt	2010-01-19 19:50:49 UTC (rev 772)
+++ wasko/branches/2.0/ChangeLog.txt	2010-01-19 19:54:08 UTC (rev 773)
@@ -1,5 +1,12 @@
 2010-01-19  Bernhard Herzog  <bh at intevation.de>
 
+	* waskaweb/model/phases_factory.py (space_short),
+	waskaweb/lib/helpers.py (space_short): Move space_short from
+	helpers to phases_factory because that's the only place where it's
+	used.
+
+2010-01-19  Bernhard Herzog  <bh at intevation.de>
+
 	* waskaweb/lib/helpers.py (get_adele_name, get_adele_description)
 	(str2date, str2time, str2datetime): Removed.  They're not used
 	anywhere

Modified: wasko/branches/2.0/waskaweb/lib/helpers.py
===================================================================
--- wasko/branches/2.0/waskaweb/lib/helpers.py	2010-01-19 19:50:49 UTC (rev 772)
+++ wasko/branches/2.0/waskaweb/lib/helpers.py	2010-01-19 19:54:08 UTC (rev 773)
@@ -234,20 +234,7 @@
 
     return " ".join(out)
 
-def space_short(s, n):
-    L = len(s)
-    if (L - 3) <= n: return s
-    r = list(s[0:n])
 
-    while True:
-        R = len(r)
-        if R >= L or r[-1].isspace() or s[R].isspace(): break
-        r.append(s[R])
-
-    r.append(R < (L-3) and u'...' or s[L-(L-R):])
-    return u''.join(r)
-
-
 def hasErrorsOnPage(page_id):
     case       = session.get('case')
     navigation = session.get('navigation.tree')

Modified: wasko/branches/2.0/waskaweb/model/phases_factory.py
===================================================================
--- wasko/branches/2.0/waskaweb/model/phases_factory.py	2010-01-19 19:50:49 UTC (rev 772)
+++ wasko/branches/2.0/waskaweb/model/phases_factory.py	2010-01-19 19:54:08 UTC (rev 773)
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 #
-# Copyright 2007, 2008 Intevation GmbH, Germany, <info at intevation.de>
+# Copyright 2007, 2008, 2010 Intevation GmbH, Germany, <info at intevation.de>
 # 
 # This file is part of mpuls WASKA (CoMPUter-based case fiLeS - 
 # Web-Anwendungs-Server fuer Kompetenzagenturen).
@@ -35,8 +35,6 @@
 
 #from waskaweb.model.casedocument     import WARNING
 
-from waskaweb.lib.helpers            import space_short
-
 from xml.sax.saxutils                import quoteattr
 
 import re
@@ -71,6 +69,23 @@
 def nescape(s):
     return escape(s).replace(' ', '&nbsp;')
 
+
+def space_short(s, n):
+    L = len(s)
+    if (L - 3) <= n:
+        return s
+    r = list(s[0:n])
+
+    while True:
+        R = len(r)
+        if R >= L or r[-1].isspace() or s[R].isspace():
+            break
+        r.append(s[R])
+
+    r.append(R < (L - 3) and u'...' or s[L - (L - R):])
+    return u''.join(r)
+
+
 class RequiredFields:
 
     def __init__(self, formed):



More information about the Mpuls-commits mailing list