ó   Qc@sÖddlZddlZddlZddlZddlZddlZddlZddlmZddl m Z ddl m Z m Z ddlmZddlmZmZddlmZddlmZdd lmZdd lmZdd lmZdd lmZdd lm Z ddl!m"Z"d„Z#d„Z$d„Z%d„Z&d„Z'd„Z(d„Z)d„Z*d„Z+d„Z,d„Z-d„Z.d„Z/d„Z0d„Z1d„Z2d „Z3d!„Z4dS("iÿÿÿÿN(tmessage(tAnnotationParser(tIncludet Namespace(tcompile_introspection_binary(t GDumpParsertIntrospectionBinary(tIntrospectablePass(t GIRParser(t GIRWriter(tMainTransformer(tresolve_shlibs(t SourceScanner(t Transformeri(tutilscCsat|j|jƒ}xEt|jƒdkr\|jddkr\|j|jjdƒƒqWdS(Nis --cflags-end(tgetattrtvaluestdesttlentrargstappendtpop(toptiontopttvaluetparsertcflags((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/scannermain.pytprocess_cflags_begin-s+cCsdS(N((RRRR((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/scannermain.pytprocess_cflags_end2sc Csîtj|dƒ}|jdddddddgd d d tƒ|jdd dd d d d tƒ|jd ddd ddddgƒ|jdddd ddddgƒ|jdddd ddddgƒ|jdddddƒ|S(NsPreprocessor optionsts--cflags-beginthelps!Start preprocessor/compiler flagsRRtdefaulttactiontcallbacks --cflags-endsEnd preprocessor/compiler flagss-IsPre-processor include fileRt cpp_includess-DsPre-processor definet cpp_definess-UsPre-processor undefinet cpp_undefiness-ptIgnored(toptparset OptionGroupt add_optionRR(Rtgroup((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/scannermain.pytget_preprocessor_option_group5s&      c Cs;tj|dƒ}|jdddddddd gƒ|S( NsMachine Dependent Optionss-mRssome machine dependent optionR RRtm_optionR(R&R'R((RR)((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/scannermain.pytget_windows_option_groupJs  c CsPtjdƒ}|jdddddddtd d d ƒ|jdd dd ddddd dƒ|jdddddddgd dƒ|jdddddddgd dƒ|jdddddddgd dƒ|jdddd ddddd dƒ|jdddddd dgd d!ƒ|jdd"dd dd#ddd d$ƒ|jdd%dddd&dtd d'ƒ|jdd(dddd)dtd d*d+ƒ|jd,d-dddd.dgd d/ƒ|jd0d1dddd2dgd d3ƒ|jdd4dddd5dgd d6ƒ|jd7d8dd dd9d d:ƒ|jdd;dd dd<d d=ƒ|jdd>dd dd?d d@ƒ|jddAddddBdgd dCƒ|jddDddddEdgd dFƒ|jddGddddHdtd dIƒ|jddJddddKdgd dLƒ|jdMdNdd ddOddPd dQƒ|jddRddddSdgd dTƒ|jddUddddVdgd dWƒ|jddXddddYdtd dZƒ|jdd[dddd\d d]ƒ|jd^d_dddd`d daƒ|jddbddddcdgd ddƒ|jddedd ddfdgd dgƒt|ƒ}|j|ƒtjj dhƒdikr¦t |ƒ}|j|ƒn|jddjdd ddkddd tj ƒ|jddldd ddmddd tj ƒ|jddnddddodtd tj ƒ|jddpddddqd tj ƒ|S(rNs%prog [options] sourcesRs--quietR t store_trueRtquietRRs)If passed, do not print details of normals operations--formattstoretformattgirsformat to use, one of gidl, girs-is --includeRtincludess$Add specified gir file as dependencys--include-uninstalledtincludes_uninstalleds¢A file path to a dependency; only use this " "when building multiple .gir files inside a " "single module.s--add-include-patht include_pathss!include paths for other GIR filess --programtprogramsprogram to executes --program-argt program_argssextra arguments to programs --libtoolt libtool_pathsfull path to libtools --no-libtoolt nolibtoolsdo not use libtools--external-librarytexternal_librarys.If true, the library is located on the system,snot in the current directorys-ls --libraryt librariesslibraries of this units-Ls--library-patht library_pathss#directories to search for librariess --header-onlyt header_onlys<If specified, just generate a GIR for the given header filess-ns --namespacetnamespace_names]name of namespace for this unit, also used to compute --identifier-prefix and --symbol-prefixs --nsversiontnamespace_versions"version of namespace for this units--strip-prefixt strip_prefixsXOption --strip-prefix is deprecated, please see --identifier-prefix and --symbol-prefix.s--identifier-prefixtidentifier_prefixess¸Remove this prefix from C identifiers (structure typedefs, etc.). May be specified multiple times. This is also used as the default for --symbol-prefix if the latter is not specified.s--symbol-prefixtsymbol_prefixess2Remove this prefix from C symbols (function names)s--accept-unprefixedtaccept_unprefixedsTIf specified, accept symbols and identifiers that do not match the namespace prefix.s--add-init-sectiont init_sectionss:add extra initialization code in the introspection programs-os--outputtoutputt-s3output filename to write to, defaults to - (stdout)s--pkgtpackagess&pkg-config packages to get cflags froms --pkg-exporttpackages_exports/Associated pkg-config packages for this librarys --warn-alltwarn_alls.If true, enable all warnings for introspections --warn-errort warn_fatalsTurn warnings into fatal errorss-vs --verbosetverboses be verboses --c-includet c_includess.headers which should be included in C programss --filelisttfilelists1file containing headers and sources to be scannedtMSYSTEMtMINGW32s--generate-typelib-testst test_codegens--passthrough-girtpassthrough_girs--reparse-validatetreparse_validate_girs --typelib-xmlt typelib_xml( R&t OptionParserR(tFalsetNoneR*tadd_option_grouptostenvirontgetR,t SUPPRESS_HELP(RR)((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyt_get_option_parserRsÖ               cCstd|fƒ‚dS(Ns ERROR: %s(t SystemExit(tmsg((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyt_errorÌscCs?tƒ}|j|ƒt|jƒƒ}|j|jƒƒdS(N(RtparseR t get_namespacetwritetget_xml(tpathtfRtwriter((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyRPÏs  cCse|jdƒ\}}}|dkrPddlm}|||ƒ}|jƒntd|fƒdS(Nt,t Everythingi(tEverythingCodeGeneratorsInvaild namespace %ri(tsplitt testcodegenRhRaR^(t optstringt namespacetout_h_filenametout_c_filenameRhtgen((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyROÖs  ccsGx@|jƒD]2}x)|D]!}|j|ƒs5qn|VPqWq WdS(N(Rit startswith(RDt allowed_flagsRtflag((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/scannermain.pytprocess_optionsàs  c CsÐddg}|j|ƒtj|dtjƒjƒd}|dkrKdSdddd d g}tt||ƒƒ}tƒ}|j |ƒ\}}|j j|j ƒ|j j|j ƒ|j j|j ƒdS( Ns pkg-configs--cflagststdoutiis-Is-Ds-Us-ls-L( textendt subprocesstPopentPIPEt communicateRUtlistRsR[t parse_argsR"R#R$( toptionsRFtargsRDtoptions_whitelisttfiltered_outputRt pkg_optionstunused((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/scannermain.pytprocess_packagesès     c CsÆg}x¹|D]±}|jdƒs||jdƒs||jdƒs||jdƒs||jdƒs||jdƒs||jdƒr tjj|ƒs¢td|fƒn|jtjj|ƒƒq q W|S( Ns.cs.cpps.ccs.cxxs.hs.hpps.hxxs%s: no such a file or directory(tendswithRWRctexistsR^Rtabspath(R}t filenamestarg((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/scannermain.pytextract_filenamesûs  c Csg}tjj|jƒs2td|jfƒnt|jdƒ}|jƒ}xÅ|D]½}|jƒ}|jdƒsÒ|jdƒsÒ|jdƒsÒ|jdƒsÒ|jdƒsÒ|jdƒsÒ|jd ƒrWtjj|ƒsøtd |fƒn|j tjj |ƒƒqWqWW|S( Ns%s: no such filelist filetrs.cs.cpps.ccs.cxxs.hs.hpps.hxxs4%s: Invalid filelist entry-no such file or directory( RWRcR„RLR^topent readlineststripRƒRR…(R|R†t filelist_filetlinestlinetfilename((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/scannermain.pytextract_filelist s    cCs¬|jr$dGH|jj|jƒn|jr9|j}nd}|jr‡x0|jD]%}|jƒ|krRtdƒqRqRW|j}nd}t|j|j d|d|ƒS(Nsng-ir-scanner: warning: Option --strip-prefix has been deprecated; see --identifier-prefix and --symbol-prefix.s5Values for --symbol-prefix must be entirely lowercaseR@RA( R?R@RRURAtlowerR^RR=R>(R|R@tprefixRA((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/scannermain.pytcreate_namespace s        cCsÜt|d|jƒ}|j|jƒ|jrE|jƒ|jƒnxo|jD]d}tj |krxt d|fƒnyt j |ƒ}Wnt d|fƒnX|j |ƒqOWx|jD]}|j|ƒqÁW|S(NRBsInvalid include path %rsMalformed include %r (R RBtset_include_pathsR4RPt disable_cachetset_passthrough_modeR2RWtsepR^Rt from_stringtregister_includeR3tregister_include_uninstalled(RlR|t transformertincludet include_objt include_path((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/scannermain.pytcreate_transformer<s"     cCs˜t|ƒ}|jƒ|jrJ|jg}|j|jƒt|ƒ}nt||jƒ|jƒƒ}t |||j ƒ}|j |ƒ|j ƒ|S(N( Rt init_parseR5RuR6RRtget_get_type_functionstget_error_quark_functionsR R:tset_introspection_binaryR_(RœR|R}t gdump_parsertbinarytshlibs((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyt create_binaryQs       cCst|dƒr'|jr't|ƒ}n t|ƒ}tƒ}|j|j|j|jd|j ƒ|j |ƒ|j |ƒ|S(NRLR( thasattrRLR‘RˆR tset_cpp_optionsR"R#R$Rt parse_filest parse_macros(R|R}R†tss((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/scannermain.pytcreate_source_scannerhs       cCs²|jdkrtj}nX|jr3tjddƒ\}}tj|dƒ}|j|ƒ|j ƒtjddƒ\}}tj|dƒ}t ||ƒ|j ƒt j ||ƒsÏt d||fƒntj|ƒytj||jƒWn9tk r.}|jtjkr(tj|ƒdS‚nXdSyt|jdƒ}Wn'tk rr}t d|jfƒnXy|j|ƒWn'tk r­}t d|jfƒnXdS( NREtsuffixs.girtws6Failed to re-parse gir file; scanned=%r passthrough=%risopening output for writing: %sswhile writing output: %s(RDtsysRtRQttempfiletmkstempRWtfdopenRatcloseRPRtfiles_are_identicalR^tunlinktshutiltmovetOSErrorterrnotEPERMRŠtIOErrortstrerror(tdataR|RDtmain_ft main_f_namettemp_ft temp_f_namete((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyt write_outputys>        cCstƒ}|j|ƒ\}}|jr=t|jtjƒn|jrSt|jƒSt|dƒrŽ|j rŽt|ƒdkrŽt dƒqŽn|j s¤t dƒn|j dkrÆddl m }nt d|j fƒ|jpò|jpò|jst d ƒnt|ƒ}tjjd |ƒ}|jr<|jtƒnt||ƒ}t|jƒ}|j|jƒƒ|rt||ƒ}|r|Snt||ƒ} tƒ} | j | j!ƒƒ} |j"| ƒ|j | j#ƒƒ|jsút$|||ƒ} ng} | |j%_&t'|| ƒ} | j(ƒt)j*d ƒt+|| ƒ}|j,ƒ|j-ƒ}|j.r}|d kr}tj/d ƒdS|d kr°|jt0kr°d|j%j1|fGHn|j2rÅ|j2}n |j}|j3|j%_3||j%_4||j%ƒ}|j5ƒ}t6||ƒd S(NRLisNeed at least one filenamesNamespace name missingR1iÿÿÿÿ(R sUnknown format: %ss#Must specify --program or --libraryRlttreeiswarnings configured as fatalsNg-ir-scanner: %s: warning: %d warnings suppressed (use --warn-all to see them)(7R[R{RPR±RtROR©RLRR^R=R0tgiscanner.girwriterR R:R5R<R”Rt MessageLoggerRYRHtenable_warningstTrueR tsetRFtupdatetget_pkgconfig_packagesR‚R®RR_t get_commentstset_annotationst get_symbolsR¨Rltshared_librariesR t transformRtbreak_on_debug_flagRtvalidatetget_warning_countRItfatalRTtnameRGRKtexported_packagesRbRÅ(R}RR|tWriterRltloggerRœRFt exit_codeR­taptblocksR§tmaintfinalt warning_countRØReR¿((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/scannermain.pyt scanner_mainsv                           (5R»R&RWR¸RvR±R²t giscannerRtgiscanner.annotationparserRt giscanner.astRRtgiscanner.dumperRtgiscanner.gdumpparserRRtgiscanner.introspectablepassRtgiscanner.girparserRRÇR tgiscanner.maintransformerR tgiscanner.shlibsR tgiscanner.sourcescannerR tgiscanner.transformerR RRRRR*R,R[R^RPRORsR‚RˆR‘R”R R¨R®RÅRá(((s{/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/scannermain.pytsJ            z           $