[Mpuls-commits] r2734 - in base/trunk: . mpulsweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue May 25 15:26:10 CEST 2010


Author: bh
Date: 2010-05-25 15:26:09 +0200 (Tue, 25 May 2010)
New Revision: 2734

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/model/document.py
Log:
* mpulsweb/model/document.py (Document.getName): Remove encoding
parameter.  No caller used anything but the default value anyway.
Also, make non-ascii names actually work by using ensure_unicode
to convert the name to unicode instead of unconditionally
converting to byte-string first.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-05-25 13:11:24 UTC (rev 2733)
+++ base/trunk/ChangeLog	2010-05-25 13:26:09 UTC (rev 2734)
@@ -1,5 +1,13 @@
 2010-05-25  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/model/document.py (Document.getName): Remove encoding
+	parameter.  No caller used anything but the default value anyway.
+	Also, make non-ascii names actually work by using ensure_unicode
+	to convert the name to unicode instead of unconditionally
+	converting to byte-string first.
+
+2010-05-25  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/lib/validators.py (FileExistsChecker.casedoc_sql)
 	(FileExistsChecker.globaldoc_sql): Fix parameter markers so that
 	the normal DB-API parameter substitution can be used.

Modified: base/trunk/mpulsweb/model/document.py
===================================================================
--- base/trunk/mpulsweb/model/document.py	2010-05-25 13:11:24 UTC (rev 2733)
+++ base/trunk/mpulsweb/model/document.py	2010-05-25 13:26:09 UTC (rev 2734)
@@ -159,13 +159,11 @@
     def isCaseAttached(self):
         return not self.case is None
 
-    def getName(self, encoding="utf-8"):
+    def getName(self):
         name = self.name
         if name is None:
             return None
-        if encoding:
-            return unicode(str(name), encoding)
-        return name
+        return h.ensure_unicode(name)
 
     def create(self, name, src, case=None, uuid=None):
         name = name.strip().rsplit('\\', 1)[-1].rsplit('/', 1)[-1]



More information about the Mpuls-commits mailing list