(name, choices, initial)
return property(getter, setter, deleter)
Define a simple CSS property attribute.
Define a simple CSS property attribute.
Define a simple CSS property attribute .
def unvalidated_property(name, choices, initial):
    "Define a simple CSS property attribute."
    initial = choices.validate(initial)

    def getter(self):
        return getattr(self, '_%s' % name, initial)

    def setter(self, value):
        if value != getattr(self, '_%s' % name, initial):
            setattr(self, '_%s' % name, value)
            self.dirty = True

    def deleter(self):
        try:
            delattr(self, '_%s' % name)
            self.dirty = True
        except AttributeError:
            # Attribute doesn't exist
            pass

    _CSS_PROPERTIES.add(name)
    return property(getter, setter, deleter)
def unvalidated_property ( name , choices , initial ) : initial = choices . validate ( initial ) def getter ( self ) : return getattr ( self , '_%s' % name , initial ) def setter ( self , value ) : if value != getattr ( self , '_%s' % name , initial ) : setattr ( self , '_%s' % name , value ) self . dirty = True def deleter ( self ) : try : delattr ( self , '_%s' % name ) self . dirty = True except AttributeError : # Attribute doesn't exist pass _CSS_PROPERTIES . add ( name ) return property ( getter , setter , deleter )