home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2012 January / maximum-cd-2012-01.iso / DiscContents / digsby_setup.exe / lib / common / slotssavable.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2011-10-05  |  2.7 KB  |  55 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.6)
  3.  
  4. from util.observe import Observable
  5. from util.primitives.funcs import do
  6.  
  7. class SlotsSavable(object):
  8.     
  9.     def __getstate__(self):
  10.         return (dict,)((lambda .0: for k in .0:
  11. (k, getattr(self, k)))(self.__slots__))
  12.  
  13.     
  14.     def __setstate__(self, info):
  15.         (None, do)((lambda .0: for key in .0:
  16. setattr(self, key, info.get(key, None)))(self.__slots__))
  17.  
  18.     
  19.     def __eq__(self, s):
  20.         
  21.         try:
  22.             return (None, all)((lambda .0: for attr in .0:
  23. getattr(self, attr) == getattr(s, attr))(self.__slots__))
  24.         except Exception:
  25.             return False
  26.  
  27.  
  28.     
  29.     def __ne__(self, other):
  30.         return not self.__eq__(other)
  31.  
  32.     
  33.     def __hash__(self):
  34.         val = 0
  35.         for slot in self.__slots__:
  36.             pass
  37.         
  38.         return val
  39.  
  40.  
  41.  
  42. class ObservableSlotsSavable(SlotsSavable, Observable):
  43.     
  44.     def __init__(self):
  45.         Observable.__init__(self)
  46.  
  47.     
  48.     def __setstate__(self, info):
  49.         if not hasattr(self, 'observers'):
  50.             Observable.__init__(self)
  51.         
  52.         return SlotsSavable.__setstate__(self, info)
  53.  
  54.  
  55.