def __setstate__(self, *args, **kwargs): """ When an instance of SAWrapper is unpickled, perform the normal 'wakeup', but also ensure that the instance is in the module registry of instances. """ # Don't use 'super' when old-style classes are involved. SimpleItem.__setstate__(self, *args, **kwargs) register_sa_wrapper(self.id, self._wrapper)
def __setstate__(self, *args, **kwargs): """ When an instance of SAWrapper is unpickled, perform the normal 'wakeup', but also ensure that the instance is in the module registry of instances. """ # Don't use 'super' when old-style classes are involved. SimpleItem.__setstate__(self, *args, **kwargs) wrapper = self.sa_zope_wrapper() if wrapper: register_sa_wrapper(self.id, wrapper)
def __setstate__(self, state): for key in ['url', 'state', 'lastcheck', 'reason']: if 'url' in state: del state['url'] SimpleItem.__setstate__(self, state)