[POS-commit] Kiwi/Kiwi/WidgetProxies Base.py,1.7,1.8

kiko at async.com.br kiko at async.com.br
Fri May 16 15:21:10 BRST 2003


Update of /cvs/Kiwi/Kiwi/WidgetProxies
In directory anthem:/tmp/cvs-serv20531/Kiwi/WidgetProxies

Modified Files:
	Base.py 
Log Message:
Remove hideous hack for swapping decimal chars for a slightly better one
using string.translate.


Index: Base.py
===================================================================
RCS file: /cvs/Kiwi/Kiwi/WidgetProxies/Base.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Base.py	11 May 2003 01:54:54 -0000	1.7
+++ Base.py	16 May 2003 18:21:08 -0000	1.8
@@ -241,15 +241,7 @@
         return self._do_decimal_swap(value)
 
     def _do_decimal_swap(self, value):
-        separator = self.proxy._decimal_separator
+        trans = self.proxy._decimal_translator
         value = str(value)
-        # Oy, what a hack ;)
-        KIWI_SYMBOL="@@KIWI@@"
-        if string.find(value, KIWI_SYMBOL) != -1:
-            raise AssertionError, \
-            "Value '%s' contains forbidden string %s" % (value, KIWI_SYMBOL)
-        value = string.replace(value, ".", KIWI_SYMBOL)
-        value = string.replace(value, separator, ".")
-        value = string.replace(value, KIWI_SYMBOL, separator)
-        return value
+        return string.translate(value, trans)
 



More information about the POS-commit mailing list