/opt/alt/python37/lib/python3.7/site-packages/tempita
NameSizeModeActions
__pycache__/-0755rm
compat3.py8380644editdlrm
compat3.pyc15680644editdlrm
compat3.pyo15680644editdlrm
_looper.py41640644editdlrm
_looper.pyc71020644editdlrm
_looper.pyo71020644editdlrm
__init__.py397060644editdlrm
__init__.pyc403250644editdlrm
__init__.pyo398440644editdlrm
Edit: /opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pyo (7102B)
Ñò :ä]c@sqdZddkZddklZdgZdefd„ƒYZdefd„ƒYZdefd „ƒYZdS( 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_tloopercBs)eZdZd„Zd„Zd„ZRS(s¤ Helper for looping (particularly in templates) Use this like:: for loop, item in looper(seq): if loop.first: ... cCs ||_dS(N(tseq(tselfR((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pyt__init__&scCs t|iƒS(N(t looper_iterR(R((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pyt__iter__)scCsd|ii|ifS(Ns <%s for %r>(t __class__t__name__R(R((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pyt__repr__,s(Rt __module__t__doc__RRR (((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pyRs   RcBs=eZd„Zd„Zd„Zeidjo eZnRS(cCst|ƒ|_d|_dS(Ni(tlistRtpos(RR((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pyR3scCs|S(N((R((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pyR7scCs[|it|iƒjo t‚nt|i|iƒ|i|if}|id7_|S(Ni(R tlenRt StopIterationtloop_pos(Rtresult((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pyt__next__:s  %t3(RR RRRtsystversiontnext(((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pyR1s    RcBs'eZd„Zd„Zd„ZeeƒZd„ZeeƒZd„ZeeƒZd„ZeeƒZe i djo eZ nd„Z ee ƒZ d„Z ee ƒZ d „ZeeƒZd „ZeeƒZd „ZeeƒZd „ZeeƒZdd „Zdd„Zd„ZRS(cCs||_||_dS(N(RR (RRR ((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pyRGs cCsd|i|i|ifS(Ns(RR (R((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pyR KscCs|iS(N(R (R((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pytindexOscCs |idS(Ni(R (R((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pytnumberSscCs|i|iS(N(RR (R((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pytitemWscCs1y|i|idSWntj odSXdS(Ni(RR t IndexErrortNone(R((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pyR[sRcCs'|idjodS|i|idS(Nii(R RR(R((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pytpreviousescCs |id S(Ni(R (R((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pytoddkscCs |idS(Ni(R (R((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pytevenoscCs |idjS(Ni(R (R((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pytfirstsscCs|it|iƒdjS(Ni(R RR(R((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pytlastwscCs t|iƒS(N(RR(R((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pytlength{scCs(|iotS|i|i|i|ƒS(s Returns true if this item is the start of a new group, where groups mean that some attribute has changed. The getter can be None (the item itself changes), an attribute name like ``'.attr'``, a function, or a dict key or list index. (RtTruet_compare_groupRR(Rtgetter((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pyt first_groups cCs(|iotS|i|i|i|ƒS(s Returns true if this item is the end of a new group, where groups mean that some attribute has changed. The getter can be None (the item itself changes), an attribute name like ``'.attr'``, a function, or a dict key or list index. (R R"R#RR(RR$((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pyt last_groupŠs cCsÜ|djo ||jSt|tƒow|idƒog|d}|idƒo-|d }t||ƒƒt||ƒƒjSt||ƒt||ƒjSn:t|dƒo||ƒ||ƒjS||||jSdS(Nt.is()iþÿÿÿt__call__(Rt isinstanceRt startswithtendswithtgetattrthasattr(RRtotherR$((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pyR#•s    # N(RR RR RtpropertyRRRRRRRRRRR R!RR%R&R#(((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pyREs6                        ( R Rttempita.compat3Rt__all__tobjectRRR(((s@/opt/alt/python37/lib/python3.7/site-packages/tempita/_looper.pyts