common/tags.py
branchtls-sprint
changeset 980 59552ba2015f
parent 909 4685a8c21d73
child 1054 434e098f6c76
--- a/common/tags.py	Tue Feb 24 17:20:04 2009 +0100
+++ b/common/tags.py	Fri Feb 27 16:16:33 2009 +0100
@@ -1,5 +1,13 @@
-from logilab.mtconverter import html_escape
+"""helper classes to generate simple (X)HTML tags
+
+:organization: Logilab
+:copyright: 2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
+"""
+__docformat__ = "restructuredtext en"
+
 from cubicweb.common.uilib import simple_sgml_tag
+
 class tag(object):
     def __init__(self, name):
         self.name = name
@@ -14,6 +22,11 @@
 img = tag('img')
 label = tag('label')
 option = tag('option')
+h1 = tag('h1')
+h2 = tag('h2')
+h3 = tag('h3')
+h4 = tag('h4')
+h5 = tag('h5')
 
 def select(name, id=None, multiple=False, options=[]):
     attrs = {}
@@ -21,8 +34,8 @@
         attrs['multiple'] = 'multiple'
     if id:
         attrs['id'] = id
-    html = [u'<select name="%s" %s>' % (name,
-                                        ' '.join('%s="%s"' % kv for kv in attrs.items()))]
+    html = [u'<select name="%s" %s>' % (
+        name, ' '.join('%s="%s"' % kv for kv in attrs.items()))]
     html += options
     html.append(u'</select>')
     return u'\n'.join(html)