home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / lib / python2.6 / dist-packages / checkbox / attribute.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-10-12  |  1.1 KB  |  31 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. from checkbox.variables import Variable
  5.  
  6. class Attribute(object):
  7.     
  8.     def __init__(self, name, cls, variable_factory = None):
  9.         self.name = name
  10.         self.cls = cls
  11.         if not variable_factory:
  12.             pass
  13.         self.variable_factory = Variable
  14.  
  15.  
  16.  
  17. def get_attributes(cls):
  18.     if '__checkbox_attributes__' in cls.__dict__:
  19.         return cls.__dict__['__checkbox_attributes__']
  20.     attributes = { }
  21.     for name in dir(cls):
  22.         attribute = getattr(cls, name, None)
  23.         if isinstance(attribute, Attribute):
  24.             attributes[name] = attribute
  25.             continue
  26.         '__checkbox_attributes__' in cls.__dict__
  27.     
  28.     cls.__checkbox_attributes__ = attributes
  29.     return cls.__checkbox_attributes__
  30.  
  31.