[Zope-CVS] CVS: Products/Ape/lib/apelib/core - serializers.py:1.4

Shane Hathaway shane@zope.com
Wed, 30 Jul 2003 18:12:16 -0400


Update of /cvs-repository/Products/Ape/lib/apelib/core
In directory cvs.zope.org:/tmp/cvs-serv11553/lib/apelib/core

Modified Files:
	serializers.py 
Log Message:
Fixed backward compatibility.

Class names now use a dot instead of a colon to qualify the module name.
The conversion to the new syntax was not done early enough until now.

Made the object ID serializer handle classes that switch between storing
the ID in the '__name__' and the 'id' attribute.



=== Products/Ape/lib/apelib/core/serializers.py 1.3 => 1.4 ===
--- Products/Ape/lib/apelib/core/serializers.py:1.3	Wed Jul  9 11:39:59 2003
+++ Products/Ape/lib/apelib/core/serializers.py	Wed Jul 30 18:11:40 2003
@@ -121,15 +121,11 @@
             # This serializer can't do anything without the classification.
             return None
         cn = classification['class_name']
-        if ':' in cn:
-            # Old spelling
-            module, name = cn.split(':', 1)
-        else:
-            pos = cn.rfind('.')
-            if pos < 0:
-                raise ValueError, "class_name must include the module"
-            module = cn[:pos]
-            name = cn[pos + 1:]
+        pos = cn.rfind('.')
+        if pos < 0:
+            raise ValueError, "class_name must include the module"
+        module = cn[:pos]
+        name = cn[pos + 1:]
         c = class_factory.getClass(module, name)
         return c.__basicnew__()