def create_css_for_object(self, css_text, object): if inspect.isclass(object) and issubclass(object, Element) and inspect.isroutine(object.__dict__.get('css', None)): css.prop.start_css(tag = object.TAG_NAME, css_class = css.get_css_name(cls = object)) object.css() css_text += css.prop.get_css() + "\n\n" for item in object.__dict__: css_text = self.create_css_for_object(css_text = css_text, object = item) return css_text
def __init__(cls, name, bases, dict): pod.Meta.__init__(cls, name, bases, dict) if bases[0] is DomObject: cls.TAG_NAME = 'DOMDOM_ELEMENT' else: parent = [base for base in bases if issubclass(base, Element)][0] if parent.__dict__.get('DOM_NO_TAG', False): cls.TAG_NAME = name cls.CSS_CLASS = "" else: cls.TAG_NAME = parent.TAG_NAME if('css' in cls.__dict__ and 'CSS_CLASS' not in cls.__dict__): cls.CSS_CLASS = parent.CSS_CLASS + css.get_css_name(cls) + " "