[component] give Links a __repr__
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Wed, 22 Oct 2014 15:59:52 +0200
changeset 10044 5907c2b0acd7
parent 10043 c0e5164cc917
child 10045 0a49d61c8cca
[component] give Links a __repr__
web/component.py
--- a/web/component.py	Wed Nov 12 14:33:12 2014 +0100
+++ b/web/component.py	Wed Oct 22 15:59:52 2014 +0200
@@ -218,6 +218,10 @@
     def render(self, w):
         w(tags.a(self.label, href=self.href, **self.attrs))
 
+    def __repr__(self):
+        return '<%s: href=%r label=%r %r>' % (self.__class__.__name__,
+                                              self.href, self.label, self.attrs)
+
 
 class Separator(object):
     """a menu separator.