Anonymous avatar Anonymous committed 420a53f

Docs.

Comments (0)

Files changed (3)

 
 webhelpers.number: document __call__ methods.
 
-
+Too many strip_tags / sanitize / bleach functions.

webhelpers/text.py

 def plural(n, singular, plural, with_number=True):
     """Return the singular or plural form of a word, according to the number.
 
+    If ``with_number`` is true (default), the return value will be the number
+    followed by the word. Otherwise the word alone will be returned.
+
     Usage:
 
     >>> plural(2, "ox", "oxen")
 def wrap_paragraphs(text, width=72):
     """Wrap all paragraphs in a text string to the specified width.
 
-    ``width`` may also be a ``textwrap.TextWrapper`` instance, in which case it
-    will be used to do the wrapping.  This provides a way to set other options
-    besides the width, and is more efficient when wrapping many texts.
+    ``width`` may be an int or a ``textwrap.TextWrapper`` instance.  
+    The latter allows you to set other options besides the width, and is more
+    efficient when wrapping many texts.  
     """
     if isinstance(width, textwrap.TextWrapper):
         wrapper = width

webhelpers/util.py

-"""Utility functions used by various web helpers
+"""Utility functions used by various web helpers.
 
 This module contains support functions used by other helpers, and functions for
 URL manipulation. Most of these helpers predate the 0.6 reorganization; they
         return self.fn(*(self.args + args), **d)
 
 class SimplerXMLGenerator(XMLGenerator):
+    """A subclass of Python's SAX XMLGenerator."""
+
     # Used by webhelpers.feedgenerator
 
     def addQuickElement(self, name, contents=None, attrs=None):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.