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