TLc@sddklZddklZddklZddklZddkZ ddk Z ddk Z ddk Z ddk Z ddkZgZgZdZdZdZd Zd Zd Zd efd YZdefdYZdefdYZdefdYZeZdZyLddklZddk l!Z!ddk"l#Z#l$Z$l%Z%ddk&Z'Wne(j oZ)e*ZnXde+fdYZ,defdYZ-dS(i(t build_ext(t install_lib(t install_data(t ExtensionNcCstid|d}tiido d}n*tiido d}n tdx>t|iD]*}|i|}|o|i dSqpWdS(s@Return the value of a m4_define variable as set in configure.in.s m4_define\(s \,\s*(.+)\)s configure.acs configure.inscould not find configure fileiN( tretcompiletostpathtexistst SystemExittopent readlinestmatchtgrouptNone(tvarnametpatterntfnametlinet match_obj((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyt get_m4_defines   cCst|dS(s=Return output (stdout or stderr) of executing cmd in a shell.i(tgetstatusoutput(tcmd((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyt getoutput%scCstidjo[ti|d}|i}|ipd}|ddjo|d }n||fSddkl}||SdS(s4Return (status, output) of executing cmd in a shell.twin32triis (RN(tsystplatformRtpopentreadtclosetcommandsR(RtpipettexttstsR((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyR)s  cCsKtidjotiddjodStdddjodSdS(s&Checks for the existence of pkg-configRspkg-config --version > NULiis pkg-configiN(RRRtsystemR(((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pythave_pkgconfig6s cCs|itidjo9|iti}ti|d ti}|d}n |}d}tii|}g}xJti|D]9}t i ||o |i tii||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.( tfindRtseptsplittstringtjoinRtabspathtlistdirtfnmatchtappend(tdirtpartsRtretvaltfile((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyt list_files?s$cCsvtid| }|pdStd|}tt|id}tt|id}||jodSdS(slCheck the existence and version number of a package: returns 0 if not installed or too old, 1 otherwise.spkg-config --exists %sispkg-config --modversion %sR%i(RR#RtmaptintR((tnamet req_versiont is_installedt orig_versiontversiont pkc_version((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pytpkgc_version_checkRs tBuildExtcBs,eZdZdZdZdZRS(cCsg|_tidjof|iidjoShdd6dd6}td}d|||d fGH|ii||d ndS( NRtmingw32s-fnative-structt2s-mms-bitfieldst3sgcc -dumpversions)using MinGW GCC version %s with %s optioni(textra_compile_argsRRtcompilert compiler_typeRR.(tselftmsnative_structt gcc_version((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pytinit_extra_compile_argscs    cCsXtidjoD|iidjo1|iiido|iiidqTndS(NRR>s-static(RRRBRCt linker_sotcounttremove(RD((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pytmodify_compilerrscCs%|i|iti|dS(N(RGRKRtbuild_extensions(RD((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyRLzs  cCs|i|i7_t|do|intidjoX|iidjoE|i}g}|iD]}|djo ||qjqj~|_n |i}ti |||djo||ijo ||_ndS(NtgenerateRtmsvctctm(RORP( RAthasattrRMRRRBRCt librariesRtbuild_extensionR(RDtextt save_libst_[1]tlib((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyRSs# ( (t__name__t __module__RGRKRLRS(((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyR=bs   t InstallLibcBs/eZgZgZdZdZdZRS(cCs ||_dS(N(t install_dir(RDR[((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pytset_install_dirscCsti||iS(N(Rt get_outputst local_outputs(RD((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyR]scCsti||iS(N(Rt get_inputst local_inputs(RD((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyR_s(RXRYR^R`R\R]R_(((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyRZs   t InstallDatacBsPeZgZgZhZdZdZdZdZdZ dZ RS(cCs*tidjo,tii|iitid |_n)tii|iitid |_d|_d|_d|_ d|_ d|_ |i d|i|i d |i|i d |i|i d |i |i d |i |i d |i |i dt i|i dddS(Ntntiis ${prefix}/bins${prefix}/includes ${prefix}/libs${prefix}/sharetprefixt exec_prefixt includedirtlibdirt datarootdirtdatadirtPYTHONtTHREADING_CFLAGSt(RR6R'R*R[R(RcRdReRfRgRhtadd_template_optionRt executable(RD((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pytprepares ,(     cCs ||_dS(N(R[(RDR[((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyR\scCs||id|* %s.pc could not be found, bindings for %s will not be built.ispkg-config --modversion %sR%isWarning: Too old version of %ss% Need %s, but %s is installedN(t can_build_okRRR}RR;tzipRR#R6RR4R5R((RDtreqstpackageR:R1R9((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyt can_build s0       cCsdS(N((RD((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyRM)sN( RXRYRRRRRRRRRM(((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyR|s  sz *************************************************************************** Codegen could not be found on your system and is required by the dsextras.Template and dsextras.TemplateExtension classes. codegen is part of PyGTK. To use either Template or TemplateExtension, you should also install PyGTK. *************************************************************************** (t Overrides(t DefsParser(tregister_typest SourceWritert FileOutputtTemplatecBs>eZdZgdedZdZdZdZRS(cOs5tptd|itnti|||S(Ns'%s' is not defined (ttemplate_classes_enabledt NameErrorRXtcodegen_error_messagetobjectt__new__(tclstargstkwds((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyRFs c Cs||_||_||_||_||_g|_t|to!|d|_|ii |n ||_g|_ xV|D]N}t|to(|i i |d|ii |q|i i |qWdS(Ni( toverrideRzRct load_typestpy_ssize_t_cleant built_defst isinstanceRtdefsR.tregister( RDRRzRRcRRRR((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyRLs"         cCsA|i}|i|i|i|itii||i S(N(RR.RRt distutilstdep_utilt newer_groupRz(RDtfiles((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyt check_datesds cCsXxQ|iD]F\}}tii||o$d|g|}tii|q q WdS(Ntdummy(RRRRtcodegent createdefstmain(RDttargettsourcesR((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyt generate_defsls  c Cs|i|iodSx:|iD]/}t|tt}|it|q&W|ioh}t |i|nt|i tt}|it|t |i d}t |t|i|it||i }|i|i|idS(NRq(RRRRtdictRt startParsingRRtexecfileRR RzRRRRcRRuRR(RDtitemtdptglobalstfdtsw((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyRMts&       N( RXRYRRtFalseRRRRM(((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyREs    tTemplateExtensioncBs#eZdZdZdZRS(cOs5tptd|itnti|||S(Ns'%s' is not defined (RRRXRR|R(RRR((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyRs c Ks|d}|d}t|to|dd d}n|d d}|d}|id}|idt}g|_|iit|||d ||d |||d =|d=|d=|o |d=n|id o|d |d<|d =nt i ||dS( NR6Riis.cRRRtpyRRz( RRtgetRRt templatesR.Rthas_keyR|R(RDRR6RRzRRR((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyRs&        cCstd|idS(NcSs |iS((RM(tx((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyts(R4R(RD((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyRMs(RXRYRRRM(((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyRs  (.tdistutils.command.build_extRtdistutils.command.install_libRtdistutils.command.install_dataRtdistutils.extensionRtdistutils.dep_utilRR-RRR)RRRRRRR$R3R<R=RZRaR|tTrueRRtcodegen.overrideRtcodegen.defsparserRtcodegen.codegenRRRtcodegen.createdefsRt ImportErrorteRRRR(((s6/usr/lib64/python2.6/site-packages/gtk-2.0/dsextras.pyts@          27Z I