<s> """<STR_LIT>""" <EOL> def prop ( func ) : <EOL> """<STR_LIT>""" <EOL> if not callable ( func ) : <EOL> raise TypeError ( '<STR_LIT>' ) <EOL> return Property ( func ) <EOL> def readonly ( func ) : <EOL> """<STR_LIT>""" <EOL> if not callable ( func ) : <EOL> raise TypeError ( '<STR_LIT>' ) <EOL> return Readonly ( func ) <EOL> def emitter ( func ) : <EOL> """<STR_LIT>""" <EOL> if not callable ( func ) : <EOL> raise TypeError ( '<STR_LIT>' ) <EOL> return Emitter ( func ) <EOL> class BaseEmitter : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , func ) : <EOL> assert callable ( func ) <EOL> self . _func = func <EOL> self . _name = func . __name__ <EOL> self . _is_being_set = False <EOL> self . __doc__ = '<STR_LIT>' % ( self . __class__ . __name__ . lower ( ) , <EOL> func . __doc__ or self . _name ) <EOL> def __repr__ ( self ) : <EOL> cls_name = self . __class__ . __name__ <EOL> return '<STR_LIT>' % ( cls_name , self . _name , id ( self ) ) <EOL> class Property ( BaseEmitter ) : <EOL> """<STR_LIT>""" <EOL> _SUFFIX = '<STR_LIT>' <EOL> def __set__ ( self , instance , value ) : <EOL> if isinstance is not None : <EOL> return instance . _set_prop ( self . _name , value ) <EOL> def __delete__ ( self , instance ) : <EOL> raise AttributeError ( '<STR_LIT>' % self . _name ) <EOL> def __get__ ( self , instance , owner ) : <EOL> if instance is None : <EOL> return self <EOL> private_name = '<STR_LIT:_>' + self . _name + self . _SUFFIX <EOL> return getattr ( instance , private_name ) <EOL> class Readonly ( Property ) : <EOL> """<STR_LIT>""" <EOL> def __set__ ( self , instance , value ) : <EOL> raise AttributeError ( "<STR_LIT>" % self . _name ) <EOL> class Emitter ( BaseEmitter ) : <EOL> """<STR_LIT>""" <EOL> def __set__ ( self , instance , value ) : <EOL> raise AttributeError ( "<STR_LIT>" % self . _name ) <EOL> def __delete__ ( self , instance ) : <EOL> raise AttributeError ( '<STR_LIT>' % self . _name ) <EOL> def __get__ ( self , instance , owner ) : <EOL> if instance is None : <EOL> return self <EOL> func = instance . _get_emitter ( self . _name ) <EOL> func . __doc__ = self . __doc__ <EOL> return func </s>
