%PDF- %PDF-
Direktori : /opt/alt/python27/lib/python2.7/site-packages/paste/util/looper/ |
Current File : //opt/alt/python27/lib/python2.7/site-packages/paste/util/looper/_looper.pyo |
� |��Wc @ sU d 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 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 ( ( sJ /opt/alt/python27/lib/python2.7/site-packages/paste/util/looper/_looper.pyt __init__"