]> git.saurik.com Git - wxWidgets.git/commitdiff
Since they are new style classes we need to use the __reduce__
authorRobin Dunn <robin@alldunn.com>
Mon, 29 Dec 2003 23:06:38 +0000 (23:06 +0000)
committerRobin Dunn <robin@alldunn.com>
Mon, 29 Dec 2003 23:06:38 +0000 (23:06 +0000)
protocol for pickling.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25031 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/src/_colour.i
wxPython/src/_gbsizer.i
wxPython/src/_gdicmn.i

index c1df0f8df2ece5d047b813697bc668bc60136df3..f16e701c48d928b147c27c40c1198e41aae8968a 100644 (file)
@@ -77,9 +77,8 @@ public:
         def __str__(self):                  return str(self.asTuple())
         def __repr__(self):                 return 'wx.Colour' + str(self.asTuple())
         def __nonzero__(self):              return self.Ok()
-        def __getinitargs__(self):          return ()
-        def __getstate__(self):             return self.asTuple()
-        def __setstate__(self, state):      self.Set(*state)
+        __safe_for_unpickling__ = True
+        def __reduce__(self):               return (Colour, self.Get())
         }
 };
 
index a1b12901b8c59158540bf9d65721d0222e685326..a28621347e2f206cd26fd57daeed742985283d7b 100644 (file)
@@ -94,9 +94,8 @@ public:
         elif index == 1: self.SetCol(val)
         else: raise IndexError
     def __nonzero__(self):               return self.Get() != (0,0)
-    def __getinitargs__(self):           return ()
-    def __getstate__(self):              return self.Get()
-    def __setstate__(self, state):       self.Set(*state)
+    __safe_for_unpickling__ = True
+    def __reduce__(self):                return (wx.GBPosition, self.Get())
     }
 
     %pythoncode {
@@ -147,9 +146,8 @@ public:
         elif index == 1: self.SetColspan(val)
         else: raise IndexError
     def __nonzero__(self):               return self.Get() != (0,0)
-    def __getinitargs__(self):           return ()
-    def __getstate__(self):              return self.Get()
-    def __setstate__(self, state):       self.Set(*state)
+    __safe_for_unpickling__ = True
+    def __reduce__(self):                return (wx.GBSpan, self.Get())
     }
 
     %pythoncode {
index 10e869f0381d2cb213d4fb62c4918e51368c0bf6..efe789a039b93f577a4ada71c7c56ac088d5352f 100644 (file)
@@ -192,9 +192,8 @@ public:
         elif index == 1: self.height = val
         else: raise IndexError
     def __nonzero__(self):               return self.Get() != (0,0)
-    def __getinitargs__(self):           return ()
-    def __getstate__(self):              return self.Get()
-    def __setstate__(self, state):       self.Set(*state)
+    __safe_for_unpickling__ = True
+    def __reduce__(self):                return (wx.Size, self.Get())
     }
 
 };
@@ -267,9 +266,8 @@ public:
         elif index == 1: self.y = val
         else: raise IndexError
     def __nonzero__(self):               return self.Get() != (0.0, 0.0)
-    def __getinitargs__(self):           return ()
-    def __getstate__(self):              return self.Get()
-    def __setstate__(self, state):       self.Set(*state)
+    __safe_for_unpickling__ = True
+    def __reduce__(self):                return (wx.RealPoint, self.Get())
     }
 };
 
@@ -353,9 +351,8 @@ public:
         elif index == 1: self.y = val
         else: raise IndexError
     def __nonzero__(self):               return self.Get() != (0,0)
-    def __getinitargs__(self):           return ()
-    def __getstate__(self):              return self.Get()
-    def __setstate__(self, state):       self.Set(*state)
+    __safe_for_unpickling__ = True
+    def __reduce__(self):                return (wx.Point, self.Get())
     }
 };
 
@@ -526,9 +523,8 @@ public:
         elif index == 3: self.height = val
         else: raise IndexError
     def __nonzero__(self):               return self.Get() != (0,0,0,0)
-    def __getinitargs__(self):           return ()
-    def __getstate__(self):              return self.Get()
-    def __setstate__(self, state):       self.Set(*state)
+    __safe_for_unpickling__ = True
+    def __reduce__(self):                return (wx.Rect, self.Get())
     }
 };
 
@@ -654,10 +650,8 @@ public:
         elif index == 1: self.y = val
         else: raise IndexError
     def __nonzero__(self):               return self.Get() != (0.0, 0.0)
-    def __getinitargs__(self):           return ()
-    def __getstate__(self):              return self.Get()
-    def __setstate__(self, state):       self.Set(*state)
-
+    __safe_for_unpickling__ = True
+    def __reduce__(self):                return (wx.Point2D, self.Get())
     }
 };