Ñò i'dWc@s]dZddkZddkZddklZdeifd„ƒYZd„Zd„Z dS(s* C structures from libefi.so and libefi.h iÿÿÿÿN(tUUIDtcUUIDcBsneZdZdeifdeifdeifdeifdeifdeidfgZdddddd„Z e d „ƒZ e d „ƒZ e d „ƒZ e d „ƒZe d „ƒZe d„ƒZe d„ƒZe d„ƒZe d„ƒZe d„ƒZe d„ƒZe d„ƒZe d„ƒZe d„ƒZd„Zd„Zd„Zd„ZRS(s. struct uuid from /usr/include/sys/uuid.h t _time_lowt _time_midttime_hi_and_versiontclock_seq_hi_and_reservedt_clock_seq_lowt node_addric Cs}td|d|d|d|d|ƒ}tidjo#titi|ƒ|idƒn titi|ƒ|idƒdS( sÁCreate a UUID for C from either a string of 32 hexadecimal digits, a string of 16 bytes as the 'bytes' argument, a string of 16 bytes in little-endian order as the 'bytes_le' argument, a tuple of six integers (32-bit time_low, 16-bit time_mid, 16-bit time_hi_version, 8-bit clock_seq_hi_variant, 8-bit clock_seq_low, 48-bit node) as the 'fields' argument, or a single 128-bit integer as the 'int' argument. Basically just like uuid.UUID(). These expressions all yield the same cUUID: cUUID('{12345678-1234-5678-1234-567812345678}') cUUID('12345678123456781234567812345678') cUUID('urn:uuid:12345678-1234-5678-1234-567812345678') cUUID(bytes='4Vx'*4) cUUID(bytes_le='xV44xV' + '4Vx4Vx') cUUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678)) cUUID(int=0x12345678123456781234567812345678) thextbytestbytes_letfieldstinttlittleiN(Rtsyst byteordertCtmemmovet addressofR R (tselfRR R R R tu((s ../cuuid.pyt__init__>s  #cCs|titi|ƒdƒ}tidjo|S|d|d|d|d|d|d|d |d |d Sd S( s'16 bytes of UUID as buffer (big-endian)itbigiiiiiiiiiN(Rt string_attbyrefRR(Rtnative((s ../cuuid.pyR ]s ?cCs|titi|ƒdƒ}tidjo|S|d|d|d|d|d|d|d |d |d Sd S( s*16 bytes of UUID as buffer (little-endian)iR iiiiiiiiiN(RRRRR(RR((s ../cuuid.pyR hs ?cCs(|i|i|i|i|i|ifS(N(ttime_lowttime_midttime_hi_versiontclock_seq_hi_variantt clock_seq_lowtnode(R((s ../cuuid.pyR sscCs|iS(s3closed interval of bytes [0:3] of the UUID (as int)(R(R((s ../cuuid.pyRxscCs|iS(s3closed interval of bytes [4:5] of the UUID (as int)(R(R((s ../cuuid.pyR}scCs|iS(s3closed interval of bytes [6:7] of the UUID (as int)(R(R((s ../cuuid.pyR‚scCs|iS(sbyte 8 of the UUID (as int)(R(R((s ../cuuid.pyR‡scCs|iS(sbyte 9 of the UUID (as int)(R(R((s ../cuuid.pyRŒscCsWtdƒ}xDttdƒtdddƒƒD]!\}}||i||>O}q.W|S(s6closed interval of bytes [10:15] of the UUID (as long)iii(iøÿÿÿ(tlongtziptrangeR(Rtxtidxtshift((s ../cuuid.pyR‘s  " cCs d|iS(s-the UUID as a 32-character hexadecimal strings%032x(R (R((s ../cuuid.pyR™scCsctdƒ}|i}xGttdƒtdddƒƒD]$\}}|t||ƒ|>O}q7W|S(sthe UUID as a 128-bit longiiixiøÿÿÿ(R R R!R"tord(RtvaltbyteR$R%((s ../cuuid.pyR žs   " cCsdt|ƒS(s*the UUID as a URN as specified in RFC 4122s urn:uuid:(tstr(R((s ../cuuid.pyturn§scCs!|id@d>|id>B|iBS(s the 60-bit timestamp of the UUIDlÿl0l (RRR(R((s ../cuuid.pyttime¬scCs|id@d>|iBS(s&the 14-bit sequence number of the UUIDl?l(RR(R((s ../cuuid.pyt clock_seq²scCs(t|tƒot|i|iƒStS(N(t isinstanceRtcmpR tNotImplemented(Rtother((s ../cuuid.pyt__cmp__¸scCs t|iƒS(N(thashR (R((s ../cuuid.pyt__hash__½sc CsAd|i}d|d |dd!|dd!|dd!|dfS(Ns%032xs%s-%s-%s-%s-%sii ii(R (RR((s ../cuuid.pyt__str__Às cCsdt|ƒS(NsUUID(%r)(R)(R((s ../cuuid.pyt__repr__ÅsN(t__name__t __module__t__doc__Rtc_uint32tc_uint16tc_uint8t_fields_tNoneRtpropertyR R R RRRRRRRR R*R+R,R1R3R4R5(((s ../cuuid.pyR0s6             cCs t|iƒS(sconvert cUUID to a uuid.UUID(RR*(tcuuid((s ../cuuid.pyt cUUID2UUIDÉscCs t|iƒS(sconvert uuid.UUID to a cUUID(RR*(tuuid((s ../cuuid.pyt UUID2cUUIDÎs( R8tctypesRRRARt StructureRR@RB(((s ../cuuid.pyts   ™