Since they are new style classes we need to use the __reduce__

protocol for pickling.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25031 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2003-12-29 23:06:38 +00:00
parent 0dfb2393dd
commit 02376d7348
3 changed files with 16 additions and 25 deletions

View 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())
}
};

View 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 {

View 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())
}
};