403Webshell
Server IP : 61.19.30.66  /  Your IP : 216.73.216.15
Web Server : Apache/2.2.22 (Ubuntu)
System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64
User : www-data ( 33)
PHP Version : 5.3.10-1ubuntu3.48
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python2.7/dist-packages/landscape/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/landscape/lib/sequenceranges.pyc
ó
}9Rc@s]defd„ƒYZdefd„ƒYZd„Zd„Zd„Zd„Zd„Zd	S(
t
SequenceErrorcBseZdZRS(s@Raised when the sequence isn't proper for translation to ranges.(t__name__t
__module__t__doc__(((s@/usr/lib/python2.7/dist-packages/landscape/lib/sequenceranges.pyRstSequenceRangescBskeZdZd„Zed„ƒZed„ƒZd„Zd„Zd„Z	d„Z
d„Zd	„ZRS(
sZHigh level interface to ranges.

    A ranges list represent a sequence of ordered and non-repeating
    elements into a more compact format, by representing 3 or more
    consecutive entries by a range.

    This means that a sequence such as

        [1, 2, 4, 5, 6, 8, 10, 11, 12, 14]

    becomes

        [1, 2, (4, 6), 8, (10, 12), 14]
    cCs
g|_dS(N(t_ranges(tself((s@/usr/lib/python2.7/dist-packages/landscape/lib/sequenceranges.pyt__init__scCs|ƒ}t|ƒ|j(|S(N(tsequence_to_rangesR(tclstsequencetobj((s@/usr/lib/python2.7/dist-packages/landscape/lib/sequenceranges.pyt
from_sequences	cCs|ƒ}||j(|S(N(R(R	trangesR((s@/usr/lib/python2.7/dist-packages/landscape/lib/sequenceranges.pytfrom_ranges s	
cCstt|jƒƒS(N(tlisttranges_to_sequenceR(R((s@/usr/lib/python2.7/dist-packages/landscape/lib/sequenceranges.pytto_sequence&scCs
t|jƒS(N(RR(R((s@/usr/lib/python2.7/dist-packages/landscape/lib/sequenceranges.pyt	to_ranges)scCs
t|jƒS(N(RR(R((s@/usr/lib/python2.7/dist-packages/landscape/lib/sequenceranges.pyt__iter__,scCsqt|j|ƒ}|t|jƒkrm|j|}t|tƒrc|d|ko`|dkSS||kStS(Nii(tfind_ranges_indexRtlent
isinstancettupletFalse(Rtitemtindexttest((s@/usr/lib/python2.7/dist-packages/landscape/lib/sequenceranges.pyt__contains__/s
 
cCst|j|ƒdS(N(t
add_to_rangesR(RR((s@/usr/lib/python2.7/dist-packages/landscape/lib/sequenceranges.pytadd8scCst|j|ƒdS(N(tremove_from_rangesR(RR((s@/usr/lib/python2.7/dist-packages/landscape/lib/sequenceranges.pytremove;s(
RRRRtclassmethodRRRRRRRR (((s@/usr/lib/python2.7/dist-packages/landscape/lib/sequenceranges.pyRs							ccs,t|ƒ}y|jƒ}}Wntk
r4dSXxð|dk	r'y|jƒ}Wntk
rmd}nX||dkr‹|d7}q8|dk	rÞ||krÞ||krÈtd||fƒ‚qÞtd|fƒ‚n||krò|Vn(||dkr|V|Vn||fV|}}q8WdS(s9Iterate over range items that compose the given sequence.NisSequence is unordered (%r < %r)sFound duplicated item (%r)(titertnextt
StopIterationtNoneR(R
titeratortrange_startt
range_stopR((s@/usr/lib/python2.7/dist-packages/landscape/lib/sequenceranges.pyR?s0



ccsWxP|D]H}t|tƒrJx0t|d|ddƒD]}|Vq8Wq|VqWdS(s;Iterate over individual items represented in a ranges list.iiN(RRtxrange(R
R((s@/usr/lib/python2.7/dist-packages/landscape/lib/sequenceranges.pyR_s

"cCs‚d}t|ƒ}xi||kr}||d}||}y|d}Wntk
rZnX||krt|d}q|}qW|S(s'Find the index where an entry *may* be.iii(Rt	TypeError(R
RtlothitmidR((s@/usr/lib/python2.7/dist-packages/landscape/lib/sequenceranges.pyRjs



c	CsÃt||ƒ}}}|}}t|ƒ}||kr||}t|tƒr}|d|koq|dknrdSq||krdSnxz|dkr||d}t|tƒrá|d|dkrÔPn|d}n||dkrõPn|d8}|d8}q“Wxv||kr…||}t|tƒrZ|d|dkrMPn|d}n||dkrnPn|d7}|d7}qW||dkr©|j||ƒn||ff|||+dS(s.Insert item in ranges, reorganizing as needed.iiNi(RRRRtinsert(	R
Rtindex_startt
index_stopRR'R(t
ranges_lenR((s@/usr/lib/python2.7/dist-packages/landscape/lib/sequenceranges.pyR|sB

$




cCs t||ƒ}t|ƒ}||kr||}t|tƒr|\}}||kr||dkrt|d|dƒ|||d+n|d|ff|||d+||dkrã||krýt||ƒ|||+qýq||dff|||+qq||kr||=qndS(s0Remove item from ranges, reorganizing as needed.iiN(RRRRtrange(R
RRR1RR'R(((s@/usr/lib/python2.7/dist-packages/landscape/lib/sequenceranges.pyR­s 
% N(	t	ExceptionRtobjectRRRRRR(((s@/usr/lib/python2.7/dist-packages/landscape/lib/sequenceranges.pyt<module>s8	 			1

Youez - 2016 - github.com/yon3zu
LinuXploit