ó ÔÂ2Yc@sáddlZddlZddlmZddlmZddlmZddlmZddlmZddlm Z dd lm Z d „Z d „Z d „Z d „Zd„Zd„Zd„ZedkrÝeƒndS(iÿÿÿÿN(tpathi(tconfig(tutils(t dbustypes(tparser(tcodegen(tcodegen_docbookcCs(x!|D]}|j|kr|SqWdS(N(tnametNone(targ_listtarg_nameta((sY/home/vagrant/ruby-gnome2.win32/glib2/vendor/local/share/glib-2.0/codegen/codegen_main.pytfind_arg!s cCs+x$|jD]}|j|kr |Sq WdS(N(tmethodsRR(tifacetmethodtm((sY/home/vagrant/ruby-gnome2.win32/glib2/vendor/local/share/glib-2.0/codegen/codegen_main.pyt find_method'scCs+x$|jD]}|j|kr |Sq WdS(N(tsignalsRR(RtsignalR((sY/home/vagrant/ruby-gnome2.win32/glib2/vendor/local/share/glib-2.0/codegen/codegen_main.pyt find_signal-scCs+x$|jD]}|j|kr |Sq WdS(N(t propertiesRR(RtpropR((sY/home/vagrant/ruby-gnome2.win32/glib2/vendor/local/share/glib-2.0/codegen/codegen_main.pyt find_prop3scCsúd}x'|D]} | j|kr | }Pq q W|dkrOtd|ƒ‚nd} |rt||ƒ} | dkrtd||fƒ‚n|rùt| j|ƒ} | dkrðt| j|ƒ} | dkrðtd|||fƒ‚qðn| } q×| } nÕ|rŽt||ƒ} | dkr<td||fƒ‚n|r…t| j|ƒ} | dkr|td|||fƒ‚n| } q×| } nI|rÑt ||ƒ}|dkrÈtd||fƒ‚n|} n|} | j j dt j ||ƒƒdS(NsNo interface %ssNo method %s on interface %ss&No arg %s on method %s on interface %ssNo signal %s on interface %ss&No arg %s on signal %s on interface %ssNo property %s on interface %si(RRt RuntimeErrorRR tin_argstout_argsRtargsRt annotationstinsertRt Annotation(t iface_listRRRRtargtkeytvaluet iface_objtit target_objt method_objtarg_objt signal_objtprop_obj((sY/home/vagrant/ruby-gnome2.win32/glib2/vendor/local/share/glib-2.0/codegen/codegen_main.pytapply_annotation9sJ             c CsBx;|D]3\}}}|jdƒ}|dkrâ|d|!}||d}|jdƒ}|dkrÀ||d}|d|!}|jdƒ}|d|!}t||d|d|||ƒq:t||d|dd||ƒq|jdƒ}|dkr:|d|!}||d} t||dd| d||ƒq|jd ƒ}|dkr|d|!} | jd ƒ}| d|!}| |d} |jdƒ}|dkró||d}|jdƒ}|d|!}t||| dd|||ƒq:t||| ddd||ƒq|}t||dddd||ƒqWdS( Ns::iÿÿÿÿiit[it]t:s()t.(tfindR*Rtrfind( Rtannotation_listtwhatR!R"tposRRR RtcombinedR((sY/home/vagrant/ruby-gnome2.win32/glib2/vendor/local/share/glib-2.0/codegen/codegen_main.pytapply_annotationsgsB     ""  "     ""c Csêtjdƒ}|jdddddddd ƒ|jdd dd d ddd ƒ|jddddd dddƒ|jddddddƒ|jddddddƒ|jddddddddgd dddƒ|jdddddd ƒ|jdd!d"d#dddd$dd%ƒ|jdd&dd'd ddd(ƒ|jƒ\}}g}xO|D]G}t|d)ƒ}|jƒ}|jƒtj|ƒ}|j |ƒqcW|j dkrÐt ||j ƒnx$|D]}|j |j|jƒq×W|j} tj|| ƒ} | r'| jƒ} n|j} | rÙ|j} | d*}ttj| |ƒd+ƒ}ttj| | d,ƒd+ƒ}tj||j|j|j|j| |||ƒ }|jƒ} |jƒ|jƒntjd-ƒdS(.Ns%prog [options]ts --xml-filestmetavartFILEtactiontappendthelpsD-Bus introspection XML files--interface-prefixtPREFIXtdefaults<String to strip from D-Bus interface names for code and docss --c-namespacet NAMESPACEs)The namespace to use for generated C codes--c-generate-object-managert store_truesCGenerate a GDBusObjectManagerClient subclass when generating C codes--generate-c-codetOUTFILESs Generate C code in OUTFILES.[ch]s--c-generate-autocleanupttypetchoicetchoicestnonetobjectstallsGenerate autocleanup supports--generate-docbooks2Generate Docbook in OUTFILES-org.Project.IFace.xmls --annotatetnargsisWHAT KEY VALUEs*Add annotation (may be used several times)s--output-directorytOUTDIRs"Location to output generated filestrbs.htws.ci(toptparset OptionParsert add_optiont parse_argstopentreadtcloseRtparse_dbus_xmltextendtannotateRR5t post_processtinterface_prefixt c_namespacetgenerate_docbookRtDocbookCodeGeneratortgeneratetgenerate_c_codetoutput_directoryRtjoinRt CodeGeneratortc_generate_object_managertc_generate_autocleanuptsystexit(t arg_parsertoptsRt all_ifacestfnametftxml_datat parsed_ifacesR$tdocbookt docbook_gentrettc_codetoutdirt header_namethtctgen((sY/home/vagrant/ruby-gnome2.win32/glib2/vendor/local/share/glib-2.0/codegen/codegen_main.pyt codegen_main”sj*!             t__main__(RaRKtosRR6RRRRRRR RRRR*R5Rst__name__(((sY/home/vagrant/ruby-gnome2.win32/glib2/vendor/local/share/glib-2.0/codegen/codegen_main.pyts"       . - =