class lorem_ipsum(Tag): ''' silliness ensues ''' children = [ 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit.', 'In egestas nisl sit amet odio.', 'Duis iaculis metus eu nulla.', 'Donec venenatis sapien sed urna.', 'Donec et felis ut elit elementum pellentesque.', 'Praesent bibendum turpis semper lacus.' ] def __init__(self): Tag.__init__(self, 'span') tags = Namespace() for t in tag_names: tags[t] = HtmlProto(t) for t in empty_tag_names: tags[t] = Proto(t) tags.update( dict( checkbox=checkbox, option=option, inlineJS=inlineJS, minJS=minJS, lorem_ipsum=lorem_ipsum, ))
class Html4EmptyTag ( EmptyTag ): pass def flatten_empty_html4_tag ( o ): if o.render: o = o.render ( o, o.data ) attrs = u''.join ( quoteattrs ( o.attrs ) ) return u'<%s%s>' % ( o.name, attrs ) register_flattener ( Html4EmptyTag, flatten_empty_html4_tag ) class Html4EmptyProto ( HtmlEmptyProto ): Class = Html4EmptyTag pass def flatten_html4_empty_proto ( p ): return '<%s>' % ( p ) register_flattener ( Html4EmptyProto, flatten_html4_empty_proto ) tags = Namespace ( ) # copy the default html tag namespace for k, v in htmltags.iteritems(): tags [ k ] = v # so we can override the empty tags without stomping on the existing tags for t in empty_tag_names: tags [ t ] = Html4EmptyProto ( t )
# noinspection PyPep8Naming class lorem_ipsum(Tag): """ silliness ensues """ children = [ 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit.', 'In egestas nisl sit amet odio.', 'Duis iaculis metus eu nulla.', 'Donec venenatis sapien sed urna.', 'Donec et felis ut elit elementum pellentesque.', 'Praesent bibendum turpis semper lacus.' ] def __init__(self): Tag.__init__(self, 'span') tags = Namespace() for t in tag_names: tags[t] = HtmlProto(t) for t in empty_tag_names: tags[t] = Proto(t) tags.update(dict( checkbox=checkbox, option=option, inlineJS=inlineJS, minJS=minJS, lorem_ipsum=lorem_ipsum, ))
'access', 'isPublic', 'isAdmin', #'id', #'moderators', #'editors', #'secret_key', #'access_key', ] empty_tag_names = [ ] tags = Namespace ( ) for t in tag_names: tags [ t ] = BlueLinesXMLProto( t ) for t in empty_tag_names: tags [ t ] = BlueLinesXMLProto( t ) blank = BlueLinesXMLProto('blank') import hashlib tags.update ( dict ( blank = blank, atom = atom.tags, escape = escape, # XXX: vars?