KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/21573/root/usr/lib/xulrunner-devel-17.0.10/sdk/bin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21573/root/usr/lib/xulrunner-devel-17.0.10/sdk/bin/xpt.pyo
m
npRc@s9dZdkZdkZdkZdkZdZd*ZdefdYZdefdYZ	d	Z
d
ZdefdYZ
d
e
fdYZde
fdYZde
fdYZde
fdYZde
fdYZde
fdYZdefdYZdefdYZdefdYZdefd YZd!efd"YZd#Zd$Zed%joeeid&joeid'IJeidneidd(joeeidq5eidd)jo%eeid&i eidq5ndS(+s
A module for working with XPCOM Type Libraries.

The XPCOM Type Library File Format is described at:
http://www.mozilla.org/scriptable/typelib_file.html . It is used
to provide type information for calling methods on XPCOM objects
from scripting languages such as JavaScript.

This module provides a set of classes representing the parts of
a typelib in a high-level manner, as well as methods for reading
and writing them from files.

The usable public interfaces are currently:
Typelib.read(input_file) - read a typelib from a file on disk or file-like
                           object, return a Typelib object.

xpt_dump(filename)     - read a typelib from a file on disk, dump
                         the contents to stdout in a human-readable
                         format.

Typelib()              - construct a new Typelib object
Interface()            - construct a new Interface object
Method()               - construct a new object representing a method
                         defined on an Interface
Constant()             - construct a new object representing a constant
                         defined on an Interface
Param()                - construct a new object representing a parameter
                         to a method
SimpleType()           - construct a new object representing a simple
                         data type
InterfaceType()        - construct a new object representing a type that
                         is an IDL-defined interface

NsXPCOM
TypeLib
iitFileFormatErrorcBstZRS(N(t__name__t
__module__(((t//usr/lib/xulrunner-devel-17.0.10/sdk/bin/xpt.pyRLst	DataErrorcBstZRS(N(RR(((RROscsd}|S(Ncs1xD]\}}|||<qWt|||S(N(tattribstvtktdict_ttypetnametbases(R
RRRR(R(RtfooTs(R(RR((RRtM_add_class_attribsSscs dtfdY}|S(NtFoocs#tZeeZdZRS(NcCs
tdS(N(tNotImplementedError(tselfR
tvalue((Rt__setattr__]s(RRR
t	enumeratetnamest
__metaclass__R((R(RR[s(tobjectR(RR((RRtenumZstTypecBstZdZeZeddddddddd	d
ddd
ddddddddddddddZeedZe	dZ
dZe	dZd Z
RS(!s
    Data type of a method parameter or return value. Do not instantiate
    this class directly. Rather, use one of its subclasses.
    
    tint8tint16tint32tint64tuint8tuint16tuint32tuint64tfloattdoubletbooleantchartwchar_ttvoidtnsIIDt	DOMStringtchar_ptrtwchar_t_ptrt	InterfacetInterfaceIstArraytStringWithSizetWideStringWithSizet
UTF8StringtCStringtAStringtjsvalcCs5||_||_|o|otdndS(Ns-If reference is True pointer must be True too(tpointerRt	referencet	Exception(RR4R5((Rt__init__s		cCs*hdt|d@<dt|d@<S(s7
        Given |byte|, an unsigned uint8 containing flag bits,
        decode the flag bits as described in
        http://www.mozilla.org/scriptable/typelib_file.html#TypeDescriptor
        and return a dict of flagname: (True|False) suitable
        for passing to Type.__init__ as **kwargs.
        
        R4iR5i N(tbooltbyte(R9((Rtdecodeflagss	cCs:d}|io|dO}n|io|dO}n|S(sL
        Encode the flag bits of this Type object. Returns a byte.

        iii N(tflagsRR4R5(RR;((Rtencodeflagss

c	Cs||d}tiid|||tiid!\}|d@}ti
|}|d@}|tiid7}d}|tiijp|tiijoti|||}n|tiijo%ti|||||\}}n|tiijo%ti|||||\}}n|tiijo%ti|||||\}}nq|tiijo%ti|||||\}}n9|tiijo%ti|||||\}}n||fS(s

        Read a TypeDescriptor at |offset| from the mmaped file |map| with
        data pool offset |data_pool|. Returns (Type, next offset),
        where |next offset| is an offset suitable for reading the data
        following this TypeDescriptor.
        
        is>BiiN(t	data_pooltoffsettstartRt_prefixdescriptortunpacktmaptcalcsizetdataR;R:ttagtNonetttTagsR*R0t
SimpleTypetgetR+t
InterfaceTypetreadttypelibR,tInterfaceIsTypeR-t	ArrayTypeR.tStringWithSizeTypeR/tWideStringWithSizeType(	RMRBR=R>R?RER;RGRD((RRLs*/

&%%%%%cCs-|itiid|i|iBdS(s
        Write a TypeDescriptor to |file|, which is assumed
        to be seeked to the proper position. For types other than
        SimpleType, this is not sufficient for writing the TypeDescriptor,
        and the subclass method must be called.

        s>BN(tfiletwriteRR@tpackRR<RE(RRMRR((RRSs(RRt__doc__tstructR@RRHtFalseR7tstaticmethodR:R<RLRS(((RRbsD		 RIcBs5tZdZhZdZedZdZRS(sU
    A simple data type. (SimpleTypeDescriptor from the typelib specification.)

    cKsti||||_dS(N(RR7RtkwargsRE(RRERY((RR7scCs5|tijot||ti|<nti|S(s
        Get a SimpleType object representing |data| (a TypeDescriptorPrefix).
        May return an already-created object. If no cached object is found,
        construct one with |tag| and |flags|.
        
        N(RDRIt_cacheRER;(RDRER;((RRJscCsd}|itiijo|iodSn|itiijo|iodSnx>ttiD]-}|it
ti|jo|}PqfqfW|io&|io|d7}q|d7}n|S(Ntunknowntstringtwstrings &s *(tsRRERRHR)R4R*tdirRGtgetattrR5(RR^RG((Rt__str__s  	

(RRRURZR7RXRJRa(((RRIs
	RKcBsAtZdZeZedZedZdZ	dZ
RS(s
    A type representing a pointer to an IDL-defined interface.
    (InterfaceTypeDescriptor from the typelib specification.)

    cKsF|p
tdnti|d||||_tii|_	dS(Ns-InterfaceType is not valid with pointer=FalseR4(
R4RRR7RRYtifaceRHR+RE(RRbR4RY((RR7s

	cCs|dpd|fSn||d}tiid|||tii	d!\}|tii	d7}d}|djo+|t|ijo|i|d}nt|||fS(s1
        Read an InterfaceTypeDescriptor at |offset| from the mmaped
        file |map| with data pool offset |data_pool|.
        Returns (InterfaceType, next offset),
        where |next offset| is an offset suitable for reading the data
        following this InterfaceTypeDescriptor.
        
        R4is>HiN(R;RFR>R=R?RKt_descriptorRARBRCtiface_indexRbtlenRMt
interfaces(RMRBR=R>R;RbRdR?((RRLs	/#cCsFti||||itiid|ii	|i
ddS(s|
        Write an InterfaceTypeDescriptor to |file|, which is assumed
        to be seeked to the proper position.

        s>HiN(RRSRRMRRRKRcRTRftindexRb(RRMRR((RRS'scCs|io|iiSndS(Nsunknown interface(RRbR
(R((RRa1s
(RRRURVRctTrueR7RXRLRSRa(((RRKs	
RNcBsGtZdZeZhZedZedZ	dZ
dZRS(s
    A type representing an interface described by one of the other
    arguments to the method. (InterfaceIsTypeDescriptor from the
    typelib specification.)
    
    cKsF|p
tdnti|d||||_tii|_	dS(Ns/InterfaceIsType is not valid with pointer=FalseR4(
R4RRR7RRYtparam_indexRHR,RE(RRiR4RY((RR7@s

	cCs|dpd|fSn||d}tiid|||tii	d!\}|tii	d7}|tijot||ti|<nti||fS(sZ
        Read an InterfaceIsTypeDescriptor at |offset| from the mmaped
        file |map| with data pool offset |data_pool|.
        Returns (InterfaceIsType, next offset),
        where |next offset| is an offset suitable for reading the data
        following this InterfaceIsTypeDescriptor.
        May return a cached value.
        
        R4is>BN(R;RFR>R=R?RNRcRARBRCRiRZ(RMRBR=R>R;RiR?((RRLGs
/cCs6ti||||itiid|idS(s~
        Write an InterfaceIsTypeDescriptor to |file|, which is assumed
        to be seeked to the proper position.

        s>BN(	RRSRRMRRRNRcRTRi(RRMRR((RRS[scCsdS(Ns
InterfaceIs *((R((RRads(RRRURVRcRZRhR7RXRLRSRa(((RRN6s		ROcBsAtZdZeZedZedZdZ	dZ
RS(s
    A type representing an Array of elements of another type, whose
    size and length are passed as separate parameters to a method.
    (ArrayTypeDescriptor from the typelib specification.)
    
    cKsX|p
tdnti|d||||_||_||_ti	i
|_dS(Ns)ArrayType is not valid with pointer=FalseR4(R4RRR7RRYtelement_typetsize_is_arg_numtlength_is_arg_numRHR-RE(RRjRkRlR4RY((RR7ps
			c	Cs|dpd|fSn||d}tiid|||tii	d!\}}|tii	d7}ti
||||\}}t|||||fS(s
        Read an ArrayTypeDescriptor at |offset| from the mmaped
        file |map| with data pool offset |data_pool|.
        Returns (ArrayType, next offset),
        where |next offset| is an offset suitable for reading the data
        following this ArrayTypeDescriptor.
        R4is>BBN(R;RFR>R=R?RORcRARBRCRkRlRRLRMRG(	RMRBR=R>R;R?RGRlRk((RRLzs2cCsOti||||itiid|i|i	|i
i||dS(sx
        Write an ArrayTypeDescriptor to |file|, which is assumed
        to be seeked to the proper position.

        s>BBN(RRSRRMRRRORcRTRkRlRj(RRMRR((RRSs

cCsdt|iS(Ns%s [](tstrRRj(R((RRas(RRRURVRcRhR7RXRLRSRa(((RROgs
	RPcBsAtZdZeZedZedZdZ	dZ
RS(s
    A type representing a UTF-8 encoded string whose size and length
    are passed as separate arguments to a method. (StringWithSizeTypeDescriptor
    from the typelib specification.)

    cKsO|p
tdnti|d||||_||_tii	|_
dS(Ns2StringWithSizeType is not valid with pointer=FalseR4(R4RRR7RRYRkRlRHR.RE(RRkRlR4RY((RR7s
		cCs|dpd|fSn||d}tiid|||tii	d!\}}|tii	d7}t||||fS(s7
        Read an StringWithSizeTypeDescriptor at |offset| from the mmaped
        file |map| with data pool offset |data_pool|.
        Returns (StringWithSizeType, next offset),
        where |next offset| is an offset suitable for reading the data
        following this StringWithSizeTypeDescriptor.
        R4is>BBN(R;RFR>R=R?RPRcRARBRCRkRl(RMRBR=R>R;R?RlRk((RRLs2cCs<ti||||itiid|i|i	dS(s
        Write a StringWithSizeTypeDescriptor to |file|, which is assumed
        to be seeked to the proper position.

        s>BBN(
RRSRRMRRRPRcRTRkRl(RRMRR((RRSscCsdS(Ntstring_s((R((RRas(RRRURVRcRhR7RXRLRSRa(((RRPs		
RQcBsAtZdZeZedZedZdZ	dZ
RS(s
    A type representing a UTF-16 encoded string whose size and length
    are passed as separate arguments to a method.
    (WideStringWithSizeTypeDescriptor from the typelib specification.)

    cKsO|p
tdnti|d||||_||_tii	|_
dS(Ns6WideStringWithSizeType is not valid with pointer=FalseR4(R4RRR7RRYRkRlRHR/RE(RRkRlR4RY((RR7s
		cCs|dpd|fSn||d}tiid|||tii	d!\}}|tii	d7}t||||fS(sC
        Read an WideStringWithSizeTypeDescriptor at |offset| from the mmaped
        file |map| with data pool offset |data_pool|.
        Returns (WideStringWithSizeType, next offset),
        where |next offset| is an offset suitable for reading the data
        following this WideStringWithSizeTypeDescriptor.
        R4is>BBN(R;RFR>R=R?RQRcRARBRCRkRl(RMRBR=R>R;R?RlRk((RRLs2cCs<ti||||itiid|i|i	dS(s
        Write a WideStringWithSizeTypeDescriptor to |file|, which is assumed
        to be seeked to the proper position.

        s>BBN(
RRSRRMRRRQRcRTRkRl(RRMRR((RRSscCsdS(Nt	wstring_s((R((RRas(RRRURVRcRhR7RXRLRSRa(((RRQs		
tParamcBsqtZdZeZeeeeeedZedZ	dZ
edZdZdZ
dZRS(sz
    A parameter to a method, or the return value of a method.
    (ParamDescriptor from the typelib specification.)

    cCsC||_||_||_||_||_||_||_dS(sp
        Construct a Param object with the specified |type| and
        flags. Params default to "in".

        N(R	Rtin_touttretvaltsharedtdippertoptional(RR	RqRrRsRtRuRv((RR7s						cCsvhdt|d@<dt|d@<dt|d@<dt|d@<d	t|d
@<dt|d@<S(s/
        Given |byte|, an unsigned uint8 containing flag bits,
        decode the flag bits as described in
        http://www.mozilla.org/scriptable/typelib_file.html#ParamDescriptor
        and return a dict of flagname: (True|False) suitable
        for passing to Param.__init__ as **kwargs
        RqiRri@Rsi RtiRuiRviN(R8R9(R9((RR:scCsd}|io|dO}n|io|dO}n|io|dO}n|io|dO}n|io|dO}n|io|dO}n|S(	sp
        Encode the flags of this Param. Return a byte suitable for
        writing to a typelib file.

        iii@i iiiN(R;RRqRrRsRtRuRv(RR;((RR<"s





cCs||d}tiid|||tiid!\}|dM}ti	|}|tiid7}t
i||||\}}t||}||fS(s
        Read a ParamDescriptor at |offset| from the mmaped file |map| with
        data pool offset |data_pool|. Returns (Param, next offset),
        where |next offset| is an offset suitable for reading the data
        following this ParamDescriptor.
        is>BiN(R=R>R?Rpt_descriptorstartRARBRCR;R:RRLRMRGtp(RMRBR=R>RxR?R;RG((RRL7s/
cCs9|itiid|i|ii||dS(st
        Write a ParamDescriptor to |file|, which is assumed to be seeked
        to the correct position.

        s>BN(	RRRSRpRwRTRR<R	RM(RRMRR((RRSIs"cCsd}|io|io
d}q4d}nd}|io|d7}n|io|d7}n|io|d7}n|io|d7}n|S(
sc
        Return a human-readable string representing the flags set
        on this Param.

        tsinout sout sin sdipper sretval sshared s	optional N(R^RRrRqRuRsRtRv(RR^((RtprefixRs 







cCs|it|iS(N(RRzRmR	(R((RRajs(RRRURVRwRhRWR7RXR:R<RLRSRzRa(((RRps				tMethodc	BstZdZeZgeeeeeeedZdZdZe	dZ
dZe	dZdZ
dZRS(	s
    A method of an interface, defining its associated parameters
    and return value.
    (MethodDescriptor from the typelib specification.)
    
    cCs||_d|_||_||_||_||_||_|	|_|
|_	t
||_|o!t
|totdn||_dS(Nisresult must be a Param!(R
Rt_name_offsettgettertsettertnotxpcomtconstructorthiddentoptargctimplicit_jscontexttlisttparamstresultt
isinstanceRpR6(RR
RRR}R~RRRRR((RR7vs									cCsIxBt|D]4}ti||||\}}|ii|q
W|S(s:
        Read |num_args| ParamDescriptors representing this Method's arguments
        from the mmaped file |map| with data pool at the offset |data_pool|,
        starting at |offset| into self.params. Returns the offset
        suitable for reading the data following the ParamDescriptor array.
        
        N(
trangetnum_argstiRpRLRMRBR=R>RxRRtappend(RRMRBR=R>RRRx((Rtread_paramss
cCs%ti||||\|_}|S(s,
        Read a ParamDescriptor representing this Method's return type
        from the mmaped file |map| with data pool at the offset |data_pool|,
        starting at |offset| into self.result. Returns the offset
        suitable for reading the data following the ParamDescriptor.
        
        N(RpRLRMRBR=R>RR(RRMRBR=R>((Rtread_results!cCshdt|d@<dt|d@<dt|d@<dt|d@<d	t|d
@<dt|d@<d
t|d@<S(s:
        Given |byte|, an unsigned uint8 containing flag bits,
        decode the flag bits as described in
        http://www.mozilla.org/scriptable/typelib_file.html#MethodDescriptor
        and return a dict of flagname: (True|False) suitable
        for passing to Method.__init__ as **kwargs
        
        R}iR~i@Ri RiRiRiRiN(R8R9(R9((RR:s	cCsd}|io|dO}n|io|dO}n|io|dO}n|io|dO}n|io|dO}n|io|dO}n|io|dO}n|S(
sx
        Encode the flags of this Method object, return a byte suitable
        for writing to a typelib file.

        iii@i iiiiN(	R;RR}R~RRRRR(RR;((RR<s"






c
Cs||d}tiid|||tiid!\}}	}|dM}ti|}ti
|||	}t|d|}|tiid7}|i|||||}|i||||}||fS(s
        Read a MethodDescriptor at |offset| from the mmaped file |map| with
        data pool offset |data_pool|. Returns (Method, next offset),
        where |next offset| is an offset suitable for reading the data
        following this MethodDescriptor.
        
        is>BIBiN(R=R>R?R{RwRARBRCR;tname_offsetRR:tTypelibtread_stringR
RFtmRRMR(
RMRBR=R>R
RR?R;RR((RRLs5
cCso|itiid|i|it|i	x!|i	D]}|i||q>W|ii||dS(ss
        Write a MethodDescriptor to |file|, which is assumed to be
        seeked to the right position.

        s>BIBN(
RRRSR{RwRTRR<R|ReRRxRMR(RRMRRRx((RRSs
cCsF|io/|i|d|_|i|idn
d|_dS(s
        Write this method's name to |file|.
        Assumes that |file| is currently seeked to an unused portion
        of the data pool.

        itiN(RR
RRttelltdata_pool_offsetR|RS(RRRR((Rt
write_names

(RRRURVRwRWR7RRRXR:R<RLRSR(((RR{ms!	
			
tConstantcBstZdZeZheiid<eiid<eii	d<eii
d<ZdZe
dZdZdZd	ZRS(
s
    A constant value of a specific type defined on an interface.
    (ConstantDesciptor from the typelib specification.)

    s>hs>Hs>is>IcCs(||_d|_||_||_dS(Ni(R
RR|R	R(RR
R	R((RR7
s			cCs)||d}tiid|||tiid!\}
t	i
|||
}|tiid7}ti
||||\}	}d}t|	to|	itijopti|	i}||d}ti||||ti|!\}|ti|7}t||	|}n||fS(s
        Read a ConstDescriptor at |offset| from the mmaped file |map| with
        data pool offset |data_pool|. Returns (Constant, next offset),
        where |next offset| is an offset suitable for reading the data
        following this ConstDescriptor.
        
        is>IN(R=R>R?RRwRARBRCRRRR
RRLRMRGRFtcRRIREttypemaptttRVtval(RMRBR=R>RR
RR?RRGR((RRLs/#)cCse|itiid|i|ii||ti	|ii
}|iti||i
dS(ss
        Write a ConstDescriptor to |file|, which is assumed
        to be seeked to the proper position.

        s>IN(RRRSRRwRTRR|R	RMRRERRVR(RRMRRR((RRS(s
cCsF|io/|i|d|_|i|idn
d|_dS(s
        Write this constants's name to |file|.
        Assumes that |file| is currently seeked to an unused portion
        of the data pool.

        iRiN(RR
RRRRR|RS(RRRR((RR3s

cCs d|it|i|ifS(NsConstant(%s, %s, %d)(RR
RmR	R(R((Rt__repr__@s(RRRURVRwRRHRRRRRR7RXRLRSRR(((RRsB			
R+c
BstZdZeZeZdZedeeggeeed	Z	dZ
dZdZdZ
dZd	Zd
ZdZRS(s
    An Interface represents an object, with its associated methods
    and constant values.
    (InterfaceDescriptor from the typelib specification.)
    
    s$00000000-0000-0000-0000-000000000000RycCs||_||_||_||_||_t||_t||_||_	|	|_
|
|_|ip
|io4|iti
jotd|int|_nd|_d|_d|_d|_dS(NsVCannot instantiate Interface %s containing methods or constants with an unresolved IIDi(tresolvedRtiidR
t	namespacetparentRtmethodst	constantst
scriptabletfunctiontbuiltinclassR+tUNRESOLVED_IIDRRht_descriptor_offsetR|t_namespace_offsetRFtxpt_filename(RR
RRRRRRRRR((RR7Os$								
			cCs d|i|i|i|ifS(Ns'Interface('%s', '%s', '%s', methods=%s)(RR
RRR(R((RRkscCsd|i|ifS(NsInterface(name='%s', iid='%s')(RR
R(R((RRanscCst|i|ifS(N(thashRR
R(R((Rt__hash__qscCst|i|i}|djo|Snt|i|i}|djo|Snt|i|i}|djo|Sn|i|ijo|iodSqdSndSdS(Niii(tcmpRRtotherRR
RR(RRR((Rt__cmp__ts



c
Cs,|i}|djodSn||d}	tiid||	|	tii	d!\}}|djo.|t|ijo|i|d|_
n|tii	d7}xBt|D]4}ti||||\}}|ii|qW||d}	tid||	|	ti	d!\}
|ti	d}xBt|
D]4}ti||||\}}|ii|qKW||d}	tid||	|	ti	d!\}|ti	d}|dM}|d@o
t|_n|d@o
t|_n|d	@o
t|_nt|_ dS(
Niis>HHs>Hs>Biii@i (!RRR>R=R?R+RwRARBRCRtnum_methodsReRMRfRRR{RLRRRRVt
num_constantsRRRR;RhRRRR(
RRMRBR=RRRRRR?RR;R>((Rtread_descriptors<	
2#
)
)



cCs>|itiidti|i|i	|i
|idS(s
        Write an InterfaceDirectoryEntry for this interface
        to |file|, which is assumed to be seeked to the correct offset.

        s>16sIIIN(RRRSR+t	_direntryRTRt
string_to_iidRRR|RR(RRR((Rtwrite_directory_entrys
!cCs\|ipd|_dSn|i|d|_d}|io|i	i
|id}n|iti
id|t|ix!|iD]}|i||qW|itidt|ix!|iD]}|i||qWd}|io|dO}n|io|dO}n|io|dO}n|itid	|dS(
s
        Write an InterfaceDescriptor to |file|, which is assumed
        to be seeked to the proper position. If this interface
        is not resolved, do not write any data.

        iNis>HHs>Hii@i s>B(RRRRRRRt
parent_idxRRMRfRgRSR+RwRTReRRRVRRR;RRR(RRMRRRRRR;R((RRSs0
	
(
"



cCs|io/|i|d|_|i|idn
d|_|io/|i|d|_|i|idn
d|_x!|i	D]}|i||qWx!|iD]}|i||qWdS(s
        Write this interface's name and namespace to |file|,
        as well as the names of all of its methods and constants.
        Assumes that |file| is currently seeked to an unused portion
        of the data pool.

        iRiN(RR
RRRRR|RSRRRRRRR(RRRRRR((Rtwrite_namess
	
	

(RRRURVRRwRRWRFR7RRaRRRRRSR(((RR+Cs$					"		RcBstZdZeZeggdZedZedZ	edZ
edZdZdZ
dZd	Zd
ZRS(sR
    A typelib represents one entire typelib file and all the interfaces
    referenced within, whether defined entirely within the typelib or
    merely referenced by name or IID.

    Typelib objects may be instantiated directly and populated with data,
    or the static Typelib.read method may be called to read one from a file.

    cCs4||_t||_t||_d|_dS(s-
        Instantiate a new Typelib.

        N(tversionRRRftannotationsRFtfilename(RRRfR((RR7s
	cCs[d}d||d ||dd!||dd!||dd!||dfS(s<
        Convert a 16-byte IID into a UUID string.

        cCs2dig}|D]}|dt|q~S(NRys%02x(tjoint_[1]R^txtord(R^RR((Rthexifyss%s-%s-%s-%s-%siiii
N(RR(RR((Rt
iid_to_strings	c
Csf|idd}dig}tdt|dD]'}|tt	|||d!dq5~S(s<
        Convert a UUID string into a 16-byte IID.

        t-RyiiiN(
tiid_strtreplaceR^RRRReRtchrtint(RRRR^((RRscCsW|djodSn|id||d}|djodSn|||d|!S(NiRyRii(R>RBtfindR=tsz(RBR=R>R((RRs

cCsd}d}d}t|toS|}t|d}t	i
|i}|i
|i}|i}|in
|i
}tiid|tiid \}}
}}}}	}|tjotd|nt|
|f}||_|o$||jotd||fn|	d8}	tiid}
tid||
|
tid!\}|d@}|d	@}|d
jo|i#i$dnxt%|D]}|	|t'i(id}
|	|dt'i(id}t'i(id||
|!}ti+|d
}ti-|||d}ti-|||d}t'|||}|d
|_1|i|_2|i3i$|qWx$|i3D]}|i4|||qW|S(s
        Read a typelib from |input_file| and return
        the constructed Typelib object. |input_file| can be a filename
        or a file-like object.

        Rytrbs
>16sBBHIIIs
Bad magic: %ss2File is of wrong length, got %d bytes, expected %dis>Biiis>16sIIIiiN(5RRFRDt
expected_sizeRt
input_filet
basestringtopentftostfstattfilenotstRLtst_sizetcloseRt_headerRARCtmagict	major_vert	minor_vertnum_interfacestfile_lengthtinterface_directory_offsetRt	XPT_MAGICRtxptR?RVtannotislastRERRRRR+RtendtideRRRR
RRbRRRfR(RRRRRERRRbRRRRRR?RRRRDRR
RRRRR((RRL sT	:
	
)





cCsdt|iS(Ns<Typelib with %d interfaces>(ReRRf(R((RRbsc	Cs4|iix |iD]}|io3|i|ijo td|i|iifnx|iD]}xit	|i
D]X\}}t
|to<|i|ijo)td|i|i||iifqzqzWt
|ito?|ii|ijo)td|i|i|iiifqdqdWqWdS(s
        Check certain assumptions about data contained in this typelib.
        Sort the interfaces array by IID, check that all interfaces
        referenced by methods exist in the array.

        s2Interface %s has parent %s not present in typelib!sUInterface method %s::%s, parameter %d references interface %s not present in typelib!sOInterface method %s::%s, result references interface %s not present in typelib!N(RRftsortRRRR
RRRRtnRxRRKRbR(RRRRRx((Rt_sanityCheckes

 
#-)c
Cshtiidd}|do|d|d7}n|id||i}|idti	idt
|i|i}x4|iD])}|i|||i|||qW|i}|id|itiidttdtdt
|i||||itidd|i|dx|iD]}|i|qMWdS(	Ns
>16sBBHIIIiiRs>16sIIIis>Bi(RRRCt
headersizetfdRSRRR+RReRRfRRRtfile_lentseekRTRtTYPELIB_VERSIONRVR(RRRRRRR((Rtwritefdxs2*



cCsU|it|to*t|d}|i||in|i|dS(s
        Write the contents of this typelib to |output_file|,
        which can be either a filename or a file-like object.

        twbN(	RRRtoutput_fileRRRRR(RRR((RRSs

cCs|id|id|idt|ifx?t|iD].\}}|djo|id|qAqAW|idx\|iD]Q}|id|i|i|i
f|ip|idq|io'|id|ii|iifn|id	|iod
pd|iod
pd|iod
pdf|idt|idjo|id
nx|iD]}|id|iodpd|iodpd|iodpd|iodpd|iodpd|iodpd|iodpdt|ii|i|iodi d|iDpdf
qW|idt|i!djo|idqx4|i!D])}|id|i|i|i#fqWqWdS(s
        Print a human-readable listing of the contents of this typelib
        to |out|, in the format of xpt_dump.
        
        soHeader:
   Major version:         %d
   Minor version:         %d
   Number of interfaces:  %d
   Annotations:
iis      Annotation #%d is empty.
s
Interface Directory:
s   - %s::%s (%s):
s      [Unresolved]
s      Parent: %s::%s
sU      Flags:
         Scriptable: %s
         BuiltinClass: %s
         Function: %s
tTRUEtFALSEs      Methods:
s         No Methods
s   %s%s%s%s%s%s%s %s %s(%s);
tGt tStHtNtCtOtJs, ccsx|]}t|VqWdS(N(t[outmost-iterable]RxRm(RRx((Rt<generator expression>sRys      Constants:
s         No Constants
s         %s %s = %d;
N($RrRSRRReRfRRRtaRFRR
RRRRRRRRR}R~RRRRRRmRR	RRRRR(RRrRRRR((Rtdumps61


#

'M



(RRRURVRRR7RXRRRRLRRRRSR(((RRs	

		B			$	cCs#ti|}|itidS(sK
    Dump the contents of |file| to stdout in the format of xpt_dump.

    N(RRLRRRGRtsyststdout(RRRG((Rtxpt_dumpsc
sd}|ptidIJd
Sng}hx*|D]"}||}
|i	|
iq8W|i
dtidt
ddddd	}d
}x|t|jo|||d
||}|ijo|d
7}q|ijo||=q|ijo!||d
||<||=q|ijo%||||d
<||d
=qqWd}xw|D]o}|ijo|i|_nxB|iD]7}||iix|iD]}||iqWqWqW|i
td|S(s
    Link all of the xpt files in |inputs| together and return the result
    as a Typelib object. All entries in inputs may be filenames or
    file-like objects.

    cCs%t|to|Snti|S(N(RRRRL(R((Rt
read_inputss0Usage: xpt_link <destination file> <input files>tkeyR
tEqualtNotEqualt	KeepFirstt
KeepSecondcsq||joiSn|i|ijo`|i|ijoB|itijo/td|i|i|i	|i|i	fni
Sn|i|ijo |ioiSq<i
Sn|i|ijok|itijoi
Sq<|itijoiSq<td|i|i|i	|i|i	fntd|i|i|i	|i|i|i	fdS(s
        Compare two interfaces, determine if they're equal or
        completely different, or should be merged (and indicate which
        one to keep in that case).

        sWTypelibs contain definitions of interface %s with different names (%s (%s) vs %s (%s))!sVTypelibs contain definitions of interface %s with different IIDs (%s (%s) vs %s (%s))!s2No idea what happened here: %s:%s (%s), %s:%s (%s)N(RtjtResultRR
RR+RRRRRRR(RR(R(Rtcompares,
&/
/icst|to$|ijo|i|_nQt|to@t|ito-|iijo|ii|i_ndS(N(RRGRKRbtmerged_interfacesRORj(RG(R(Rt	checkTypeKs 6RfN( RtinputsRtstderrRFRfRRRGtextendRtoperatort
attrgetterRRRRRetresRRRRRRRRRR	RRxR(
RRRRRfRRRRxRRGRR((RRRtxpt_linksX	
	4


t__main__isxpt <dump|link> <files>Rtlink(ii(!RURRRVR	RRR6RRR
RRRRIRKRNRORPRQRpR{RR+RRRRRetargvRtexitRS(RORRR	RR{RIRVRRKR
R+RRRRRQRRpRRNRPRR((Rt?Bs>				x)312//vH		y



Anon7 - 2021