Commits

Andriy Kornatskyy committed b14facd

Added upload_docs to make upload target

Comments (0)

Files changed (3)

 	if [ "$$(echo $(VERSION) | sed 's/\.//')" -eq 27 ]; then \
 		$(PYTHON) setup.py -q egg_info --tag-build .$$REV \
 			sdist register upload; \
-		make -s doc; \
+		$(EASY_INSTALL) -i $(PYPI) sphinx; \
+		$(PYTHON) env/bin/sphinx-build -D release=0.1.$$REV \
+			-a -b html doc/ doc/_build/;\
 		python setup.py upload_docs; \
 	fi; \
 	$(PYTHON) setup.py -q egg_info --tag-build .$$REV \
 # built documents.
 #
 # The short X.Y version.
-version = '0.1.1'
+version = '0.1'
 # The full version, including alpha/beta/rc tags.
-release = '0.1.1'
+release = '0.1'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.

src/wheezy/html/widgets.py

 
 def hidden(name, value, attrs=None):
     """
-        >>> hidden('pref', 'abc')
-        <input type="hidden" name="pref" value="abc" />
+        '<input type="hidden" name="pref" value="abc" />'
     """
     return Tag('input', attrs={
             'name': name,
     })
 
 
+def hidden2(name, value, attrs=None):
+    """
+    """
+    return '<input type="hidden" name="' + name + '" value="' + value + '" />'
+
+
+def x():
+    """
+        >> x = [x() for i in xrange(100000)]
+    """
+    return str(hidden('pref', 'abc'))
+
+
 def multiple_hidden(name, value, attrs=None):
     """
         >>> items = ('a', 'b')
     return Tag('input', attrs=tag_attrs)
 
 
+def join_attrs(attrs):
+    if attrs:
+        return ''.join([' ' + k.rstrip('_') + '="' + attrs[k] + '"'
+                        for k in attrs])
+    else:
+        return ''
+
+
+def textbox2(name, value, attrs=None):
+    """
+        >>> x = textbox2('zip_code', '79053',
+        ...         attrs={'class': 'error'})  #doctest: +NORMALIZE_WHITESPACE
+    """
+    return '<input type="text" id="' + id(name) \
+            + '" name="' + name + '" value="' \
+            + value + '" ' + join_attrs(attrs) + ' />'
+
+
+def x2():
+    """
+        >> x = [x2() for i in xrange(100000)]
+    """
+    return str(textbox('zip_code', '79053', attrs={'class': 'error'}))
+
+
 def password(name, value, attrs=None):
     """
         >>> password('passwd', '',