Anonymous avatar Anonymous committed 0544ba1

Docs.

Comments (0)

Files changed (7)

 
 Run tests on Python 2.4 to see if any 2.5isms have crept in.
 
-What is the purpose of webhelpers.mimehelper? It has a hidden Pylons
-dependency, although it's optional. Under what circumstances would you use it, 
-and how much of an advantage is it to pass a short alias like
-m.mimetype("html")? Need better documentation.`
-
-Document MIMETypes.__init__().
-
-webhelpers.number: document __call__ methods.
-
 Too many strip_tags / sanitize / bleach functions.
 # other places throughout the built documents.
 #
 # The short X.Y version.
-version = '1.0b3'
+version = '1.0'
 # The full version, including alpha/beta/rc tags.
-release = '1.0b1'
+release = '1.0b3'
 
 # There are two options for replacing |today|: either, you set today to some
 # non-false value, then it is used:

docs/modules/number.rst

 -------
 
 .. autoclass:: SimpleStats
-    :members:
-    :undoc-members:
+    :members: __call__, extend
 
 .. autoclass:: Stats
-    :members:
-    :undoc-members:
+    :members: __call__, extend, finish
 

docs/modules/pylonslib/flash.rst

 
 .. currentmodule:: webhelpers.pylonslib.flash
 
+Classes
+-------
+
 .. autoclass:: Flash
-    :members:
+   :members: __call__, pop_messages
+
+.. autoclass:: Message
+   :members:

webhelpers/mimehelper.py

-"""MIMEType helpers
+"""MIME Type helpers
 
-These helpers depend on the WebOb package.
+This helper depends on the WebOb package, and has optional Pylons support.
 """
 import mimetypes
 
     add_alias = classmethod(add_alias)
     
     def __init__(self, environ):
+        """``environ`` is the WSGI environment of the current request."""
         self.env = environ
     
     def _set_response_content_type(self, mimetype):

webhelpers/number.py

         self._init_stats()
 
     def __call__(self, value):
+        """Add a data value."""
         if self.count == 0:
             self.min = self.max = value
         else:
         self.set.add(value)
 
     def finish(self):
+        """Finish calculations. (Call after adding all data values.)
+        
+        Call this after adding all data values, or the results will be
+        incomplete.
+        """
         self.mean = mean(self.list)
         self.median = median(self.list)
         self.standard_deviation = standard_deviation(self.list)

webhelpers/pylonslib/flash.py

 categories are "*warning*", "*notice*", "*error*", and "*success*", with
 the default being "*notice*".  The category is available in the message's
 ``.category`` attribute, and is normally used to set the container's CSS
-class.  Unlike the logging system, the flash object does not filter out
-messages below a certain level; it returns all messages set. 
+class.  
+
+This is the *only* thing it does. Calling ``.pop_messages()`` pops all messages
+in the order registered, regardless of category.  It is *not* possible to pop
+only a certain category, or all levels above a certain level, or to group
+messages by category. If you want to group different kinds of messages
+together, or pop only certain categories while leaving other categories, you
+should use multiple ``Flash`` objects.
 
 You can change the standard categories by overriding the ``.categories``
 and ``.default_category`` class attributes, or by providing alternate
 values using constructor keywords.
 
-Note that messages are _not_ grouped by category, nor is it possible to 
-pop one category of messages while leaving the others.  If you want to 
-group different kinds of messages together, you should use multiple flash
-objects.
-
 Category example
 ----------------
 
 class Message(object):
     """A message returned by ``Flash.pop_messages()``.
 
-    ``Message`` instances have the following attributes:
+    Converting the message to a string returns the message text. Instances
+    also have the following attributes:
 
     * ``message``: the message text.
     * ``category``: the category specified when the message was created.
-
-    Calling ``str(message)`` ``unicode(message)``, or ``message.__html__()`` 
-    returns the message text. (The latter returns an escaped literal
-    unless the message is already a literal; see 
-    ``webhelpers.html.builder``.)
     """
 
     def __init__(self, category, message):
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.