def __init__(self, *args, **kwargs):
super(Tag, self).__init__(args)
self.attr = self.Attr(**kwargs)
def unicode(self, indent=2):
from py.__.xmlobj.visit import SimpleUnicodeVisitor
l = []
SimpleUnicodeVisitor(l.append, indent).visit(self)
return u"".join(l)
def __repr__(self):
name = self.__class__.__name__
return "<%r tag object %d>" % (name, id(self))
def __unicode__(self):
return self.unicode(indent=0)