def __init__(self, selector=None, parent=None, min=None, max=None, expression=None, **kwargs): assert parent is None or isinstance(parent, Style) State.__init__(self, **kwargs) self.selector = selector self.min = min self.max = max self.expression = expression self.parent = parent
def __init__(self, selector=None, parent=None, component=None, **kwargs): u""" Constructor of a new style. The self.media holds a list of styles related to a specific @media size range of self. """ assert parent is None or isinstance(parent, Style) State.__init__(self, **kwargs) self._uid = None self.selector = selector # If omitted, then just build the block, not the selector open/close. self.component = component self.parent = parent # Parent, can be None, will be filled when style is attached to a parent. self.media = [] # Can be overwritten by key/value in kwargs. self.styles = [] # Children styles of this style
def __init__(self, **kwargs): State.__init__(self) for key, value in kwargs.items(): self[key] = value self.initializeForm()