HEX
Server: Apache
System: Linux hp3-stn-1011028.hostingp3.local 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: csh958633 (951153)
PHP: 8.3.30
Disabled: shell_exec,exec,system,popen,set_time_limit
Upload Files
File: //lib/python2.7/site-packages/packagekit/progress.pyc
�
�^c@sRyddlmZWn!ek
r7ddlmZnXdefd��YZdS(i����(tIterabletPackagekitProgresscBsGeZdZdd�Zd�Zd�Zd�Zd�Zd�Z	RS(s%
    Progress class there controls the total progress of a transaction
    the transaction is divided in n milestones. the class contains
    the current step (milestone n -> n+1) and the percentage of the whole transaction

    Usage:

    from packagekit import PackagekitProgress

    steps = [10, 30, 50, 70] # Milestones in %
    progress = PackagekitProgress(steps)
    for milestone in progress:
        # do the action is this step
        for i in range(100):
            # do some action
            print "progress : %s " % milestone
    cCs7tt|�j�|s&|j�n
|j|�dS(N(tsuperRt__init__tresett	set_steps(tselftsteps((s7/usr/lib/python2.7/site-packages/packagekit/progress.pyR/s
cCs |j�||_d|_dS(s�
        Set the steps for the whole transaction
        @param steps: list of int representing the percentage of each step in the transaction
        iN(RRtcurrent_step(RR((s7/usr/lib/python2.7/site-packages/packagekit/progress.pyR6s
	cCsd|_g|_d|_dS(Ni(tpercentRR(R((s7/usr/lib/python2.7/site-packages/packagekit/progress.pyR?s		cCs`|jt|j�dkrA|jd7_|j|j|_nt|j�|_d|_dS(s:
        Step to the next step in the transaction
        iidN(RtlenRR	(R((s7/usr/lib/python2.7/site-packages/packagekit/progress.pytstepDs
ccs;x.|jt|j�kr0|jV|j�qWt�dS(N(RR
RR	Rt
StopIteration(R((s7/usr/lib/python2.7/site-packages/packagekit/progress.pyt__iter__OscCs�|jdkrd}n|j|jd}|jt|j�dkr_|j|jd}nd}||}|||_dS(s<
        Increment percentage based on current step
        iiidN(RRR
R	(Rtstartpcttendpcttincr((s7/usr/lib/python2.7/site-packages/packagekit/progress.pyt_update_percentVs	
N(
t__name__t
__module__t__doc__tNoneRRRRR
R(((s7/usr/lib/python2.7/site-packages/packagekit/progress.pyRs					N(tcollectionsRtImportErrortcollections.abcR(((s7/usr/lib/python2.7/site-packages/packagekit/progress.pyt<module>s