Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/gi/overrides/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/gi/overrides/GLib.pyc


,Oc@sddlmZddlmZmZedjZgZdefdYZ	dej
fdYZ
edZd	Z
ee
d
eee
de
ejddS(
i(tmodules(tvariant_new_tupletvariant_type_from_stringtGLibt_VariantCreatorcBseZiejjd6ejjd6ejjd6ejjd6ejjd6ejj	d6ejj
d6ejjd6ejjd6ejj
d	6ejjd
6ejjd6ejjd6ejjd
6ZdZdZdZdZRS(tbtytntqtitutxttthtdtstotgtvcCs|jj|d}|rv|dk	rb|s=tdn||d}||d|dfSd|ddfSn|ddkr|j||S|jdr|j||S|ddkr|j||Std|dS(	s@Create a GVariant object from given format and argument list.

        This method recursively calls itself for complex structures (arrays,
        dictionaries, boxed).

        Return a tuple (variant, rest_format, rest_args) with the generated
        GVariant, the remainder of the format string, and the remainder of the
        arguments.

        If args is None, then this won't actually consume any arguments, and
        just parse the format string and generate empty GVariant structures.
        This is required for creating empty dictionaries or arrays.
        is/not enough arguments for GVariant format stringit(sa{tascannot handle GVariant type N(	t_LEAF_CONSTRUCTORStgettNonet	TypeErrort
_create_tuplet
startswitht_create_dictt
_create_arraytNotImplementedError(tselftformattargstconstructorR((s5/usr/lib/python2.7/dist-packages/gi/overrides/GLib.pyt_create/scCs|d}tjjtd}|dk	r|sQt|dtdkr`tdfnxltt|dD]T}|j	drtdfn|j
||d|\}}}|j|qwW|d}n|j|d|fS(	s>Handle the case where the outermost type of format is a tuple.itrisexpected tuple argumentt)s&too many arguments for tuple signatureN((
RtVariantBuildertnewRRttypeRtrangetlenRR"t	add_valuetend(RRR tbuilderR	Rt_((s5/usr/lib/python2.7/dist-packages/gi/overrides/GLib.pyRSs
##
cCsd}|dks|dr|j|ddd}|j|dd}|jdsktdn|d}|t|t| }tjjt|}ntjjtd}x|dj	D]\}}|j|d|g\}}}	|j||g\}
}}	|jds=tdn|d}tjjtd}|j
||j
|
|j
|jqW|dk	r|d}n|j||fS(	s=Handle the case where the outermost type of format is a dict.iiit}s(dictionary type string not closed with }sa{?*}s{?*}N(RR"Rt
ValueErrorR)RR%R&RtitemsR*R+(RRR R,trest_formattelement_typetkRtkey_vR-tval_vtentry((s5/usr/lib/python2.7/dist-packages/gi/overrides/GLib.pyRes.
"



c	Csd}|dks|drl|j|ddd}|t|t| }tjjt|}nmtjjtd}xRtt|dD]:}|j|d|d|\}}}|j|qW|dk	r|d}n|j	||fS(s?Handle the case where the outermost type of format is an array.iisa*N(
RR"R)RR%R&RR(R*R+(	RRR R,R1R2R	RR-((s5/usr/lib/python2.7/dist-packages/gi/overrides/GLib.pyRs'
(t__name__t
__module__RtVarianttnew_booleantnew_bytet	new_int16t
new_uint16t	new_int32t
new_uint32t	new_int64t
new_uint64t
new_handlet
new_doublet
new_stringtnew_object_patht
new_signaturetnew_variantRR"RRR(((s5/usr/lib/python2.7/dist-packages/gi/overrides/GLib.pyRs&












	$		!R9cBszeZdZdZdZdZdZdZedZ	dZ
dZd	Zd
Z
dZRS(cCsDt}|j||g\}}}|r@td|n|S(sCreate a GVariant from a native Python object.

        format_string is a standard GVariant type signature, value is a Python
        object whose structure has to match the signature.
        
        Examples:
          GLib.Variant('i', 1)
          GLib.Variant('(is)', (1, 'hello'))
          GLib.Variant('(asa{sv})', ([], {'foo': GLib.Variant('b', True), 
                                          'bar': GLib.Variant('i', 2)}))
        s%invalid remaining format string: "%s"(RR"R(tclst
format_stringtvaluetcreatorRR1R-((s5/usr/lib/python2.7/dist-packages/gi/overrides/GLib.pyt__new__s
	cCsdt|dtS(Ns<GLib.Variant(%s)>tprint(tgetattrtTrue(R((s5/usr/lib/python2.7/dist-packages/gi/overrides/GLib.pyt__repr__scCs*y|j|SWntk
r%tSXdS(N(tequalRtFalse(Rtother((s5/usr/lib/python2.7/dist-packages/gi/overrides/GLib.pyt__eq__s
cCs+y|j|SWntk
r&tSXdS(N(RQRRO(RRS((s5/usr/lib/python2.7/dist-packages/gi/overrides/GLib.pyt__ne__s
cCst|j|jfS(N(thashtget_type_stringtunpack(R((s5/usr/lib/python2.7/dist-packages/gi/overrides/GLib.pyt__hash__scCsi
|jd6|jd6|jd6|jd6|jd6|jd6|jd6|jd6|jd	6|j	d
6|j
d6|j
d6|j
d
6}|j|j}|r|S|jj
drgt|jD]}|j|j^q}t|S|jj
drpi}xQt|jD]=}|j|}|jdj||jdj<q+W|S|jj
drgt|jD]}|j|j^qS|jj
dr|jjStd|jdS(s1Decompose a GVariant into a native Python object.RRRRR	R
RRR
RRRRRsa{iiRRsunsupported GVariant type N(tget_booleantget_bytet	get_int16t
get_uint16t	get_int32t
get_uint32t	get_int64t
get_uint64t
get_handlet
get_doublet
get_stringRRWRR(t
n_childrentget_child_valueRXttupletget_variantR(RtLEAF_ACCESSORStlaR	tresR((s5/usr/lib/python2.7/dist-packages/gi/overrides/GLib.pyRXsB












1
,/c	Cs,|dkrgS|jds&|gSg}d}|dd!}x|r'|d}||7}|d}|dkrxqBn|d
krd}|}|dkrd
}nd}xc|dkr
|d}||7}|d}||kr|d7}q||kr|d8}qqWn|j|d}qBW|S(scReturn a list of the element signatures of the topmost signature tuple.

        If the signature is not a tuple, it returns one element with the entire
        signature. If the signature is an empty tuple, the result is [].
        
        This is useful for e. g. iterating over method parameters which are
        passed as a single Variant.
        s()RtiiitmRt{R$R.(RmR(RRn(Rtappend(	tklasst	signaturetresulttheadttailtctleveltuptdown((s5/usr/lib/python2.7/dist-packages/gi/overrides/GLib.pytsplit_signatures<

	


	





cCsp|jdkr"t|jS|jjdsL|jjdrV|jStd|jdS(NRRRRRs'GVariant type %s does not have a length(RRR(RWR)RdRReR(R((s5/usr/lib/python2.7/dist-packages/gi/overrides/GLib.pyt__len__'s
*
cCs|jjdryA|j|td}|dkrKt|n|jSWqtk
rxWt|j	D]C}|j
|}|j
dj|kry|j
djSqyWt|qXn|jjds|jjdrht|}|dkr(|j	|}n|dksF||j	krUtdn|j
|jS|jdkr|j
j|Std|jdS(
Nsa{t*iiRRslist index out of rangeRRRs#GVariant type %s is not a container(RRR(RWRtlookup_valueRRtKeyErrorRXRR(ReRftintt
IndexErrorRdt__getitem__(RtkeytvalR	R((s5/usr/lib/python2.7/dist-packages/gi/overrides/GLib.pyR/s,
*cCs
|jS(N(t__bool__(R((s5/usr/lib/python2.7/dist-packages/gi/overrides/GLib.pyt__nonzero__Ssc
Cs|jdkr"|jd
kS|jdkr>|jS|jdkrft|jd
kS|jjds|jjdr|jd
kS|jdkrt|jStS(NRRRR	R
RRR
RiRRRRRRR(	RRRR	R
RRR
R(R(RRR(R(	RWRXRZR)RdRRetboolRO(R((s5/usr/lib/python2.7/dist-packages/gi/overrides/GLib.pyRVs
*cCs{|jjds)td|jfSg}xEt|jD]1}|j|}|j|jdjqBW|S(Nsa{s$GVariant type %s is not a dictionaryi(RWRRR(ReRfRoRX(RRkR	R((s5/usr/lib/python2.7/dist-packages/gi/overrides/GLib.pytkeysfs (R7R8RLRPRTRURYRXtclassmethodRyRzRRRR(((s5/usr/lib/python2.7/dist-packages/gi/overrides/GLib.pyR9s						15		$		cGs
t|S(N(R(RHtelements((s5/usr/lib/python2.7/dist-packages/gi/overrides/GLib.pyt	new_tuplepscCstjj|\}}|S(N(RR9Rd(RRJtlength((s5/usr/lib/python2.7/dist-packages/gi/overrides/GLib.pyRdtsRRdN(timporterRt_giRRt_introspection_moduleRt__all__tobjectRR9RRRdtsetattrRo(((s5/usr/lib/python2.7/dist-packages/gi/overrides/GLib.pyt<module>s
}