|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /proc/self/root/proc/self/root/usr/lib/python2.4/site-packages/yum/ |
Upload File : |
m
ODc @ s d k Z d k Z d k Z d k Z d k l Z d k Z d k Z d k Z d k Z d k
Z
d k Z d k Z d k
Z
d k Td k Z d k l Z d Z d d d Z d Z d f d
YZ d Z d Z d
Z d Z d d Z d Z d S( N( s StringIO( t *( s MiscErrorc C sA t | } | d j o g Sn h } y x | D] } d | | <q1 WWn t j
o
~ n X| i Sy t | } | i Wn t j
o
~ nn X| d } d } } xM | | j o? | | | j o | | | | <} | d 7} n | d 7} q W| | Sg } x, | D]$ } | | j o | i
| qqW| S( s Return a list of the elements in s, but without duplicates.
For example, unique([1,2,3,1,2,3]) is some permutation of [1,2,3],
unique("abcabc") some permutation of ["a", "b", "c"], and
unique(([1, 2], [2, 3], [1, 2])) some permutation of
[[2, 3], [1, 2]].
For best speed, all sequence elements should be hashable. Then
unique() will usually work in linear time.
If not possible, the sequence elements should enjoy a total
ordering, and if list(s).sort() doesn't raise TypeError it's
assumed that they do enjoy a total ordering. Then unique() will
usually work in O(N*log2(N)) time.
If that's not possible either, the sequence elements must support
equality-testing. Then unique() will usually work in quadratic
time.
i i N( t lent st nt ut xt TypeErrort keyst listt tt sortt lastt lastit it append( R R R
R R R R R ( ( t, /usr/lib/python2.4/site-packages/yum/misc.pyt unique sB
i i c C s# y t | t i j o
| } n t | d | } | d j o d k } | i } n4 | d j o d k } | i } n t d | | i
} x( | o | i
| } | i | q Wt | t i j o | i ~ n | i SWn( t t f j
o } t d | n Xd S( s takes filename, hand back Checksum of it
sumtype = md5 or sha
filename = /path/to/file
CHUNK=65536 by defaultt rt md5Nt shas- Error Checksumming file, bad checksum type %ss# Error opening file for checksum: %s( t typet filet typest
StringTypet fot opent CHUNKt sumtypeR t newt sumR t MiscErrort readt chunkt updatet closet hexdigestt IOErrort OSErrort e( R R R R&