File: //proc/self/root/opt/alt/python27/lib/python2.7/site-packages/tempita/_looper.pyc
�
V��Lc @ sq d Z d d l Z d d l m Z d g Z d e f d � � YZ d e f d � � YZ d e f d � � YZ d S(
s
Helper for looping over sequences, particular in templates.
Often in a loop in a template it's handy to know what's next up,
previously up, if this is the first or last item in the sequence, etc.
These can be awkward to manage in a normal Python loop, but using the
looper you can get a better sense of the context. Use like::
>>> for loop, item in looper(['a', 'b', 'c']):
... print loop.number, item
... if not loop.last:
... print '---'
1 a
---
2 b
---
3 c
i����N( t basestring_t looperc B s) e Z d Z d � Z d � Z d � Z RS( s�
Helper for looping (particularly in templates)
Use this like::
for loop, item in looper(seq):
if loop.first:
...
c C s
| | _ d S( N( t seq( t selfR ( ( s@ /opt/alt/python27/lib/python2.7/site-packages/tempita/_looper.pyt __init__&