Beispiel #1
0
 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)
Beispiel #2
0
 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)
Beispiel #3
0
 def __setstate__(self, state):
     for key in ['url', 'state', 'lastcheck', 'reason']:
         if 'url' in state:
             del state['url']
     SimpleItem.__setstate__(self, state)