Ë
    È[;j!  ã                   óJ   — d Z dgZ G d„ d«      Z G d„ d«      Z G d„ d«      Zy)a  
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

Úlooperc                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)r   z¤
    Helper for looping (particularly in templates)

    Use this like::

        for loop, item in looper(seq):
            if loop.first:
                ...
    c                 ó   — || _         y ©N)Úseq©Úselfr   s     ú_G:\00. PROJECTS\API\Inventory\templateJSON\kerjaOCR\Lib\site-packages\Cython/Tempita/_looper.pyÚ__init__zlooper.__init__#   s	   € Øˆ�ó    c                 ó,   — t        | j                  «      S r   )Úlooper_iterr   ©r   s    r	   Ú__iter__zlooper.__iter__&   s   € Ü˜4Ÿ8™8Ó$Ð$r   c                 óP   — d| j                   j                  ›d| j                  ›d�S )NÚ<z for Ú>)Ú	__class__Ú__name__r   r   s    r	   Ú__repr__zlooper.__repr__)   s   � à�N‰N×#Ó# T§X£Xð/ð 	/r   N)r   Ú
__module__Ú__qualname__Ú__doc__r
   r   r   © r   r	   r   r      s   „ ñòò%ó/r   c                   ó   — e Zd Zd„ Zd„ Zd„ Zy)r   c                 ó2   — t        |«      | _        d| _        y ©Né    )Úlistr   Úposr   s     r	   r
   zlooper_iter.__init__0   s   € Ü˜“9ˆŒØˆ�r   c                 ó   — | S r   r   r   s    r	   r   zlooper_iter.__iter__4   s   € Øˆr   c                 óò   — | j                   t        | j                  «      k\  rt        ‚t	        | j                  | j                   «      | j                  | j                      f}| xj                   dz  c_         |S ©Né   )r   Úlenr   ÚStopIterationÚloop_pos)r   Úresults     r	   Ú__next__zlooper_iter.__next__7   sT   € Ø�8‰8”s˜4Ÿ8™8“}Ò$ÜÐÜ˜$Ÿ(™( D§H¡HÓ-¨t¯x©x¸¿¹Ñ/AÐAˆØ�Š�A‰�Øˆr   N)r   r   r   r
   r   r(   r   r   r	   r   r   .   s   „ òòór   r   c                   ó
  — e Zd Zd„ Zd„ Zd„ Z ee«      Zd„ Z ee«      Zd„ Z ee«      Zd„ Z	 ee	«      Z	d„ Z
 ee
«      Z
d„ Z ee«      Zd	„ Z ee«      Zd
„ Z ee«      Zd„ Z ee«      Zd„ Z ee«      Zdd„Zdd„Zd„ Zy)r&   c                 ó    — || _         || _        y r   ©r   r   )r   r   r   s      r	   r
   zloop_pos.__init__A   s   € ØˆŒØˆ�r   c                 óV   — d| j                   | j                     ›d| j                  ›d�S )Nz
<loop pos=z at r   r+   r   s    r	   r   zloop_pos.__repr__E   s"   � à�H‰H�T—X‘XÓ §£ð*ð 	*r   c                 ó   — | j                   S r   ©r   r   s    r	   Úindexzloop_pos.indexI   s   € Ø�x‰xˆr   c                 ó    — | j                   dz   S r"   r.   r   s    r	   Únumberzloop_pos.numberM   ó   € Ø�x‰x˜!‰|Ðr   c                 ó4   — | j                   | j                     S r   r+   r   s    r	   Úitemzloop_pos.itemQ   s   € Ø�x‰x˜Ÿ™Ñ!Ð!r   c                 óZ   — 	 | j                   | j                  dz      S # t        $ r Y y w xY wr"   )r   r   Ú
IndexErrorr   s    r	   r(   zloop_pos.__next__U   s0   € ð	Ø—8‘8˜DŸH™H q™LÑ)Ð)øÜò 	Ùð	ús   ‚ ž	*©*c                 óZ   — | j                   dk(  ry | j                  | j                   dz
     S )Nr   r#   )r   r   r   s    r	   Úpreviouszloop_pos.previous\   s'   € Ø�8‰8�qŠ=ØØ�x‰x˜Ÿ™ 1™Ñ%Ð%r   c                 ó"   — | j                   dz   S ©Né   r.   r   s    r	   Úoddzloop_pos.oddb   s   € Ø—8‘8˜a‘<ÐÐr   c                 ó    — | j                   dz  S r:   r.   r   s    r	   Úevenzloop_pos.evenf   r2   r   c                 ó    — | j                   dk(  S r   r.   r   s    r	   Úfirstzloop_pos.firstj   s   € Ø�x‰x˜1‰}Ðr   c                 óL   — | j                   t        | j                  «      dz
  k(  S r"   )r   r$   r   r   s    r	   Úlastzloop_pos.lastn   s   € Ø�x‰xœ3˜tŸx™x›=¨1Ñ,Ñ,Ð,r   c                 ó,   — t        | j                  «      S r   )r$   r   r   s    r	   Úlengthzloop_pos.lengthr   s   € Ü�4—8‘8‹}Ðr   Nc                 ój   — | j                   ry| j                  | j                  | j                  |«      S )a  
        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.
        T)r@   Ú_compare_groupr4   r8   ©r   Úgetters     r	   Úfirst_groupzloop_pos.first_groupv   s+   € ð �:Š:ØØ×"Ñ" 4§9¡9¨d¯m©m¸VÓDÐDr   c                 ój   — | j                   ry| j                  | j                  | j                  |«      S )a  
        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.
        T)rB   rF   r4   r(   rG   s     r	   Ú
last_groupzloop_pos.last_group�   s+   € ð �9Š9ØØ×"Ñ" 4§9¡9¨d¯m©m¸VÓDÐDr   c                 óP  — |€||k7  S t        |t        «      rh|j                  d«      rW|dd  }|j                  d«      r(|d d } t	        ||«      «        t	        ||«      «       k7  S t	        ||«      t	        ||«      k7  S t        |d«      r ||«       ||«      k7  S ||   ||   k7  S )NÚ.r#   z()éþÿÿÿÚ__call__)Ú
isinstanceÚstrÚ
startswithÚendswithÚgetattrÚhasattr)r   r4   ÚotherrH   s       r	   rF   zloop_pos._compare_groupŒ   s¸   € Øˆ>Ø˜5‘=Ð Ü˜¤Ô%Ø×#Ñ# CÔ(Ø˜A˜B�ZˆFØ�‰˜tÔ$Ø  ˜�Ø,”w˜t VÓ,Ó.Ð2H´'¸%ÀÓ2HÓ2JÑJÐJä˜t VÓ,´¸¸vÓ0FÑFÐFÜ�V˜ZÔ(Ù˜$“<¡6¨%£=Ñ0Ð0à˜‘< 5¨¡=Ñ0Ð0r   r   )r   r   r   r
   r   r/   Úpropertyr1   r4   r(   r8   r<   r>   r@   rB   rD   rI   rK   rF   r   r   r	   r&   r&   ?   s±   „ òò*òá�U‹O€Eòá�fÓ€Fò"á�D‹>€Dòñ
 ˜Ó!€Hò&ñ ˜Ó!€Hò á
�3‹-€Còá�D‹>€Dòá�U‹O€Eò-á�D‹>€Dòá�fÓ€Fó	Eó	Eó1r   r&   N)r   Ú__all__r   r   r&   r   r   r	   Ú<module>rY      s3   ðñð( ˆ*€÷/ñ /÷,ñ ÷"[1ò [1r   