σ ˜ρΒZc@`sΝddlmZddlmZddlmZddlmZddlZddlmZddlm Z d e fd „ƒYZ d e fd „ƒYZ d e fd„ƒYZ d„Zd„Zd„ZdS(i(tabsolute_import(tdivision(tprint_function(tunicode_literalsNi(tast(tto_underscorest SectionsFilecB`seZd„ZRS(cC`s ||_dS(N(tsections(tselfR((sq/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyt__init__s(t__name__t __module__R (((sq/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyRstSectioncB`seZd„ZRS(cC`s(d|_d|_d|_g|_dS(N(tNonetfilettitletincludest subsections(R((sq/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyR $s   (R R R (((sq/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyR #st SubsectioncB`seZd„ZRS(cC`s||_g|_dS(N(tnametsymbols(RR((sq/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyR ,s (R R R (((sq/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyR+scC`s΅g}d}d}x–|D]Ž}|jƒ}| s|jƒrDqn|dkrˆtƒ}|j|ƒtdƒ}|jj|ƒqn|dkr d}qntjd|ƒ}|rΞ|j d|_ qntjd|ƒ}|rό|j d|_ qntjd|ƒ}|r*|j d|_ qntjd|ƒ}|rst|j j ddƒƒ}|jj|ƒqn|jd ƒr—|jd ƒr—qn|jj|ƒqWt|ƒS( Nu
u
u(?P.*)ucontentsu(?P<contents>.*)u#(?P.*)u.*))?>unameu(R trstriptisspaceR tappendRRtretmatcht groupdictRRRtgett startswithtendswithRR(tlinesRtcurrent_sectiontcurrent_subsectiontlineR((sq/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pytparse_sections_file1sJ       cC`s$x|jD]}|jdƒ|jdk rF|jd|jfƒn|jdk ro|jd|jfƒn|jdk r˜|jd|jfƒnt}x{|jD]p}|jdk rΧ|jd|jfƒn|sν|jdƒnt }x"|j D]}|j|dƒqύWq¨Wq WdS(Nu
u%s u%s u%s u u u ( RtwriteRR RRtTrueRRtFalseR(tft sections_filetsectiontis_first_subsectiont subsectiontsymbol((sq/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pytwrite_sections_filees" c `sD|j}g‰‡fd†}d„}|ddƒ}x|jƒD]σ}t|tjƒrn|||jƒqCt|tjtjfƒrC|j}t |ƒj ddƒj ƒ}|||ƒ}|||ƒ|||j j j ddƒƒx!|jD]} ||| jƒqυWx$|jD]} ||| jƒqWqCqCWtˆƒS( Nc`sBtƒ}||_||_|jjtdƒƒˆj|ƒ|S(N(R RRRRRR (tfile_RR((R(sq/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyt new_sections     cS`s|jdjj|ƒdS(Ni(RRR(R(tsym((sq/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyt append_symbol‰sumainuMainu_u-u.u(t namespacetvaluest isinstanceRtFunctionR+tClasst Interfacet gtype_nameRtreplacetlowertglib_type_structt target_ginametmethodststatic_methodsR( t transformertnsR.R0tgeneral_sectiontnodeR7t file_nameR(tmeth((Rsq/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pytgenerate_sections_file|s&    (t __future__RRRRRtRtutilsRtobjectRR RR"R,RD(((sq/home/vagrant/ruby-gnome2/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/sectionparser.pyts  4