[Zodb-checkins] CVS: Zope3/lib/python/Persistence - Class.py:1.9

Jeremy Hylton jeremy@zope.com
Fri, 22 Nov 2002 11:35:58 -0500


Update of /cvs-repository/Zope3/lib/python/Persistence
In directory cvs.zope.org:/tmp/cvs-serv8587

Modified Files:
	Class.py 
Log Message:
Move __newstate__().


=== Zope3/lib/python/Persistence/Class.py 1.8 => 1.9 ===
--- Zope3/lib/python/Persistence/Class.py:1.8	Fri Nov 22 11:33:29 2002
+++ Zope3/lib/python/Persistence/Class.py	Fri Nov 22 11:35:57 2002
@@ -290,6 +290,23 @@
         for k, v in dict.items():
             setattr(cls, k, v)
 
+    def _p_deactivate(cls):
+        # do nothing but mark the state change for now
+        cls._p_state = GHOST
+
+    def _p_activate(cls):
+        if cls._p_state is None:
+            dm = cls._p_jar
+            if dm is not None:
+                # reactivate
+                cls._p_state = UPTODATE
+
+    # Methods below here are not wrapped to be class-only attributes.
+    # They are available as methods of classes using this metaclass.
+
+    def __getnewargs__(cls):
+        return cls.__name__, cls.__bases__, {}
+
     def __newstate__(cls, acls):
         # Update a class's __dict__ in place.  Must use setattr and
         # delattr because __dict__ is a read-only proxy.
@@ -309,19 +326,3 @@
         for name in newnames:
             setattr(cls, name, acls.__dict__[name])
 
-    def _p_deactivate(cls):
-        # do nothing but mark the state change for now
-        cls._p_state = GHOST
-
-    def _p_activate(cls):
-        if cls._p_state is None:
-            dm = cls._p_jar
-            if dm is not None:
-                # reactivate
-                cls._p_state = UPTODATE
-
-    # Methods below here are not wrapped to be class-only attributes.
-    # They are available as methods of classes using this metaclass.
-
-    def __getnewargs__(cls):
-        return cls.__name__, cls.__bases__, {}