403Webshell
Server IP : 192.158.238.246  /  Your IP : 216.73.216.56
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python37/lib/python3.7/site-packages/paste/util/looper/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python37/lib/python3.7/site-packages/paste/util/looper/__pycache__/_looper.cpython-37.pyc
B

���]��@s>dZdgZGdd�de�ZGdd�de�ZGdd�de�ZdS)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@s(eZdZdZdd�Zdd�Zdd�ZdS)	rz�
    Helper for looping (particularly in templates)
    
    Use this like::
    
        for loop, item in looper(seq):
            if loop.first:
                ...
    cCs
||_dS)N)�seq)�selfr�r�J/opt/alt/python37/lib/python3.7/site-packages/paste/util/looper/_looper.py�__init__"szlooper.__init__cCs
t|j�S)N)�looper_iterr)rrrr�__iter__%szlooper.__iter__cCsd|jj|jfS)Nz<%s for %r>)�	__class__�__name__r)rrrr�__repr__(szlooper.__repr__N)r
�
__module__�__qualname__�__doc__rrrrrrrrs	c@s$eZdZdd�Zdd�Zdd�ZdS)rcCst|�|_d|_dS)N�)�listr�pos)rrrrrr.s
zlooper_iter.__init__cCs|S)Nr)rrrrr2szlooper_iter.__iter__cCs@|jt|j�krt�t|j|j�|j|jf}|jd7_|S)N�)r�lenr�
StopIteration�loop_pos)r�resultrrr�next5s
zlooper_iter.nextN)r
rr
rrrrrrrr,src@s�eZdZdd�Zdd�Zdd�Zee�Zdd�Zee�Zd	d
�Zee�Zdd�Z	ee	�Z	d
d�Z
ee
�Z
dd�Zee�Zdd�Zee�Zdd�Z
ee
�Z
dd�Zee�Zdd�Zee�Zd dd�Zd!dd�Zdd�ZdS)"rcCs||_||_dS)N)rr)rrrrrrr>szloop_pos.__init__cCsd|jttfS)Nz<loop pos=%r at %r>)rr)rrrrrBszloop_pos.__repr__cCs|jS)N)r)rrrr�indexFszloop_pos.indexcCs
|jdS)Nr)r)rrrr�numberJszloop_pos.numbercCs|j|jS)N)rr)rrrr�itemNsz
loop_pos.itemcCs*y|j|jdStk
r$dSXdS)Nr)rr�
IndexError)rrrrrRsz
loop_pos.nextcCs|jdkrdS|j|jdS)Nrr)rr)rrrr�previousYs
zloop_pos.previouscCs|jdS)N�)r)rrrr�odd_szloop_pos.oddcCs
|jdS)Nr)r)rrrr�evencsz
loop_pos.evencCs
|jdkS)Nr)r)rrrr�firstgszloop_pos.firstcCs|jt|j�dkS)Nr)rrr)rrrr�lastksz
loop_pos.lastcCs
t|j�S)N)rr)rrrr�lengthoszloop_pos.lengthNcCs|jr
dS|�|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_grouprr)r�getterrrr�first_groupsszloop_pos.first_groupcCs|jr
dS|�|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)r!r#rr)rr$rrr�
last_group~szloop_pos.last_groupcCs�|dkr||kSt|t�rt|�d�rt|dd�}|�d�r^|dd�}t||��t||��kSt||�t||�kSn(t|�r�||�||�kS||||kSdS)N�.rz()���)�
isinstance�
basestring�
startswith�endswith�getattr�callable)rr�otherr$rrrr#�s


zloop_pos._compare_group)N)N)r
rr
rrr�propertyrrrrrrr r!r"r%r&r#rrrrr<s2

rN)r�__all__�objectrrrrrrr�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit