Anonymous avatar Anonymous committed d17111b

[svn] small cleanup to counter

Comments (0)

Files changed (1)

webhelpers/rails/text.py

     """
     del request_config().environ['railshelpers.cycles'][name]
 
-def counter(*args, **kwargs):
+def counter(name='default', start=1, step=1):
     """Return the next cardinal in a sequence.
 
     Every time ``counter`` is called, the value returned will be the next
         </tr>
         % #endfor
 
-    You can used named counters to prevent clashes in nested loops.
+    You can use named counters to prevent clashes in nested loops.
     You'll have to reset the inner cycle manually though.  See the
     documentation for ``webhelpers.text.cycle()`` for a similar
     example.
     """
-    # optional name of this list
-    name = kwargs.get('name', 'default')
-    # optional starting value for this sequence
-    start = kwargs.get('start', 1)
-    # optional step size of this sequence
-    step = kwargs.get('step', 1)
-
     counters = request_config().environ.setdefault('railshelpers.counters', {})
 
     # ripped off of itertools.count
     """
     return markdown.markdown(text)
 
-__all__ = ['cycle', 'reset_cycle', 'truncate', 'highlight', 'excerpt', 'word_wrap', 'simple_format',
-           'auto_link', 'strip_links', 'textilize', 'markdown']
+__all__ = ['cycle', 'reset_cycle', 'counter', 'reset_counter', 'truncate', 'highlight', 'excerpt',
+           'word_wrap', 'simple_format', 'auto_link', 'strip_links', 'textilize', 'markdown']
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.