Viewing File: /usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyc


?–Sc@sddlZddlZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZddl
mZddlmZyLddlZddlmZdd	lmZdd
lmZmZmZWnek
reZnXeZgZgZ dZ!dZ"d
Z#dZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+dZ,dZ-defdYZ.de
fdYZ/defdYZ0defdYZ1d e2fd!YZ3d"e1fd#YZ4dS($iN(tdep_util(t	build_ext(tinstall_lib(tinstall_data(t	Extension(tfind_executable(t	Overrides(t
DefsParser(tregister_typestSourceWritert
FileOutputs
***************************************************************************
Codegen could not be found on your system and is required by the
dsextras.Template and dsextras.TemplateExtension classes.
***************************************************************************
cCstjd|d}tjjdr2d}n'tjjdrMd}ntdx<t|jD](}|j|}|rl|j	dSqlWdS(s@Return the value of a m4_define variable as set in configure.in.sm4_define\(s\,\s*(.+)\)sconfigure.acsconfigure.ins$ERROR: Could not find configure fileiN(tretcompiletostpathtexistst
SystemExittopent	readlinestmatchtgrouptNone(tvarnametpatterntfnametlinet	match_obj((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyt
get_m4_define*s		cCst|dS(s=Return output (stdout or stderr) of executing cmd in a shell.i(tgetstatusoutput(tcmd((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyt	getoutput=scCstjdkrjtj|d}|j}|jp<d}x|dd	kr_|d }qBW||fSddlm}||SdS(
s4Return (status, output) of executing cmd in a shell.twin32triis
s
(RN(s
s
(tsystplatformR
tpopentreadtclosetcommandsR(RtpipettexttstsR((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRAs
cCstdrtSdS(sChecks for the existence of gcctgccN(RtTrue(((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pythave_gccPscCstdrtSdS(s&Checks for the existence of pkg-configs
pkg-configN(RR+(((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pythave_pkgconfigUscCs|jtjdkrP|jtj}tj|d tj}|d}n|}d}tjj|}g}xHtj|D]7}t	j	||r|j
tjj||qqW|S(sList all files in a dir, with filename match support:
    for example: glade/*.glade will return all files in the glade directory
    that matches *.glade. It also looks up the full pathit.(tfindR
tseptsplittstringtjoinRtabspathtlistdirtfnmatchtappend(tdirtpartsRtretvaltfile((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyt
list_filesZs
#cCsntjd|}|stSt|}tt|jd}tt|jd}||krjtStS(ssCheck the existence and version number of a package:
    returns False if not installed or too old, True otherwise.spkg-config --exists %sR.(R
tsystemtFalsetpkgc_get_versiontmaptintR1R+(tnametreq_versiontis_installedtorig_versiontversiontpkc_version((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pytpkgc_version_checkoscCstd|S(s7return the version as return by pkg-config --modversionspkg-config --modversion %s(R(RB((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyR?scCs&td|}|jddjS(sCreturns a list of libraries as returned by pkg-config --libs-only-lspkg-config --libs-only-l %ss-lt(RtreplaceR1(RBtoutput((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pytpkgc_get_librariesscCs&td|}|jddjS(sFreturns a list of library dirs as returned by pkg-config --libs-only-Lspkg-config --libs-only-L %ss-LRI(RRJR1(RBRK((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pytpkgc_get_library_dirsscCs&td|}|jddjS(sHreturns a list of include dirs as returned by pkg-config --cflags-only-Ispkg-config --cflags-only-I %ss-IRI(RRJR1(RBRK((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pytpkgc_get_include_dirsscCstd|}|S(sAreturns the defs dir as returned by pkg-config --variable=defsdirs pkg-config --variable=defsdir %s(R(RBRK((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pytpkgc_get_defs_dirstBuildExtcBs,eZdZdZdZdZRS(cCsg|_tjdkr|jjdkrtsBtdnidd6dd6dd6}td	}d
|||dfGH|jj||dndS(NRtmingw32sERROR: Could not find gcc.s-fnative-structt2s-mms-bitfieldst3t4sgcc -dumpversions)using MinGW GCC version %s with %s optioni(	textra_compile_argsR!R"tcompilert
compiler_typeR,RRR7(tselftmsnative_structtgcc_version((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pytinit_extra_compile_argss	!	

cCsktjdkrg|jjdkrgts9tdn|jjjdrg|jjjdqgndS(NRRQsERROR: Could not find gcc.s-static(	R!R"RVRWR,Rt	linker_sotcounttremove(RX((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pytmodify_compilers
!	cCs%|j|jtj|dS(N(R[R_Rtbuild_extensions(RX((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyR`s

cCs|j|j7_t|dr.|jntjdkr|jjdkr|j}g|jD]}|dkrb|^qb|_n	|j}tj	|||dk	r||jkr||_ndS(NtgenerateRtmsvctctm(RcRd(RUthasattrRaR!R"RVRWt	librariesRtbuild_extensionR(RXtextt	save_libstlib((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRgs
!		(t__name__t
__module__R[R_R`Rg(((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRPs		
	t
InstallLibcBs/eZgZgZdZdZdZRS(cCs
||_dS(N(tinstall_dir(RXRn((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pytset_install_dirscCstj||jS(N(Rtget_outputst
local_outputs(RX((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRpscCstj||jS(N(Rt
get_inputstlocal_inputs(RX((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRrs(RkRlRqRsRoRpRr(((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRms
		tInstallDatacBsPeZgZgZiZdZdZdZdZdZ	dZ
RS(cCs(tjdkr:tjj|jjtjd |_n(tjj|jjtjd |_d|_d|_d|_	d|_
d|_|jd|j|jd	|j|jd
|j|jd|j	|jd|j
|jd
|j|jdt
j|jdddS(Ntntiis
${prefix}/bins${prefix}/includes
${prefix}/libs${prefix}/sharetprefixtexec_prefixt
includedirtlibdirtdatarootdirtdatadirtPYTHONtTHREADING_CFLAGSRI(R
RBR0R3RnR1RvRwRxRyRzR{tadd_template_optionR!t
executable(RX((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pytprepares +(					cCs
||_dS(N(Rn(RXRn((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRoscCs||jd|<dS(Ns@%s@(ttemplate_options(RXRBtvalue((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyR~scCstjj|dd }t|j}x/|jjD]\}}|j||}q<Wtjj||}|j	|t|dj
||jj||j
j||S(s<Install template filename into target directory install_dir.iitwb(R
RR1RR$RtitemsRJR3tmkpathtwriteRsR7Rq(RXtfilenameRntoutput_filettemplatetkeyRRK((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pytinstall_templates
cCstj||jS(N(RRpRq(RX((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRpscCstj||jS(N(RRrRs(RX((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRrs(RkRlRqRsRRRoR~RRpRr(((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRts					tPkgConfigExtensioncBsJeZdZdZdZdZdZdZdZ	dZ
RS(s
pygobject-2.0cKs|d}d|kr6|dc|j|t7<n|j|t|d<t|d<d|kr|dc|j|7<n|j||d<d|kr|dc|j|7<n|j||d<d|kr|jd|_n|jrN|dc|j|j7<|dc|j|j7<|dc|j|j7<n|d|_|d|_|d|_	|d=|d=t
j||dS(	Ntpkc_nametinclude_dirst
define_macrosRftlibrary_dirst
pygobject_pkcRBRG(tget_include_dirst
GLOBAL_INCt
GLOBAL_MACROSt
get_librariestget_library_dirstpopRRBRRGRt__init__(RXtkwargsRB((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyR#s,
 
	


cCsLt|tkr|f}ng}x!|D]}|jt|q+W|S(N(ttypettupletextendRN(RXtnamesR:RB((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyREs
cCsLt|tkr|f}ng}x!|D]}|jt|q+W|S(N(RRRRL(RXRR:RB((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRPs
cCsLt|tkr|f}ng}x!|D]}|jt|q+W|S(N(RRRRM(RXRR:RB((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyR[s
cCs|jdk	r|jSt|jtkrC|j|jfg}nt|j|j}x|D]\}}tjd|}|rd||j	fGHt
|_t
St|}tt
|jdtt
|jdkrt|_tSd|GHd||fGHt
|_t
Sq_WdS(s.If the pkg-config version found is good enoughspkg-config --exists %ss>* %s.pc could not be found, bindings for %s will not be built.R.sWarning: Too old version of %ss%         Need %s, but %s is installedN(tcan_build_okRRRRRGtzipR
R=RBR>R?R@RAR1R+(RXtreqstpackageRFR:RE((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyt	can_buildfs*				cCsdS(N((RX((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRasN(RkRlRRRRRRRRRa(((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRs	"				 tTemplatecBs>eZdZgdedZdZdZdZRS(cOs/ts"td|jtfntj|S(Ns'%s' is not defined
%s(ttemplate_classes_enabledt	NameErrorRktcodegen_error_messagetobjectt__new__(tclstargstkwds((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRsc	Cs||_||_||_||_||_g|_t|tre|d|_|jj	|n	||_g|_
xT|D]L}t|tr|j
j	|d|jj	|q~|j
j	|q~WdS(Ni(toverrideRKRvt
load_typestpy_ssize_t_cleant
built_defst
isinstanceRtdefsR7tregister(	RXRRKRRvRRRR ((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRs 						
		
cCs>|j}|j|j|j|jtj||jS(N(RR7RRRtnewer_groupRK(RXtfiles((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pytcheck_datess
cCsSxL|jD]A\}}tj||r
d|g|}tjj|q
q
WdS(Ntdummy(RRRtcodegent
createdefstmain(RXttargettsourcesR((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyt
generate_defsscCs|j|jrdSx:|jD]/}t|tt}|jt|q$W|jryi}t	|j|nt|j
tt}|jt|t|jd}t
|t|j|jt||j}|j|j|jdS(Ntw(RRRRtdictRtstartParsingRRtexecfileRRRKR	RRRvR
RRR%(RXtitemtdptglobalstfdtsw((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRas$

	

N(	RkRlRRR>RRRRa(((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRs
				tTemplateExtensioncBs#eZdZdZdZRS(cOs5ts"td|jtfntj|||S(Ns'%s' is not defined
%s(RRRkRRR(RRR((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRsc	Ks
|d}|d}t|tr8|dd d}n|d d}|d}|jd}|jdt}g|_|jjt|||d	||d
|||d
=|d=|d=|r|d=n|jdr|d|d<|d=nt	j
||dS(NRBRiis.cRRRtpyRRK(RRtgetRR>t	templatesR7Rthas_keyRR(RXRRBRRKRRR((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRs&


	



cCstd|jdS(NcSs
|jS(N(Ra(tx((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyt<lambda>s(R@R(RX((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRas(RkRlRRRa(((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyRs		(5R
R!R6RR2t	distutilsRtdistutils.command.build_extRtdistutils.command.install_libRtdistutils.command.install_dataRtdistutils.extensionRtdistutils.spawnRtcodegen.createdefsRtcodegen.overrideRtcodegen.defsparserRtcodegen.codegenRR	R
tImportErrorR>RR+RRRRRRR,R-R<RHR?RLRMRNRORPRmRtRRRR(((s6/usr/lib64/python2.7/site-packages/gtk-2.0/dsextras.pyt<module>sN 

												?8lN
Back to Directory File Manager