ó å)~Qc@s²ddlZddlZddlmZedƒ\ZZZdefd„ƒYZ defd„ƒYZ ddd „Z ddd „Z ddd „Zd „Zddd „ZdS(iÿÿÿÿNi(tutilsitPositioncBsDeZdZdddd„Zd„Zd„Zd„Zd„ZRS(sPRepresents a position in the source file which we want to inform about. cCs||_||_||_dS(N(tfilenametlinetcolumn(tselfRRR((sw/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/message.pyt__init__%s  cCs1t|j|j|jf|j|j|jfƒS(N(tcmpRRR(Rtother((sw/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/message.pyt__cmp__*scCs2dtjj|jƒ|jp!d|jp-dfS(Nsiÿÿÿÿ(tostpathtbasenameRRR(R((sw/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/message.pyt__repr__.s cCs€|j}|j|ƒr+|t|ƒ}n|jdk rQd||j|jfS|jdk rqd||jfSd|fSdS(Ns%s:%d:%ds%s:%ds%s:(Rt startswithtlenRtNoneR(RtcwdR((sw/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/message.pytformat4s cCst|j|j||jƒS(N(RRRR(Rtoffset((sw/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/message.pyR?sN( t__name__t __module__t__doc__RRR R RR(((sw/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/message.pyR!s    t MessageLoggercBsbeZdZdd„Zed„ƒZd„Zd„Zddd„Z ddd„Z d„Z RS(cCsV|dkrtj}ntjƒtj|_||_||_t |_ d|_ dS(Ni( RtsyststderrR tgetcwdtsept_cwdt_outputt _namespacetFalset_enable_warningst_warning_count(Rt namespacetoutput((sw/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/message.pyRFs     cOs+|jdkr$|||Ž|_n|jS(N(t _instanceR(tclstargstkwargs((sw/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/message.pytgetOscCs ||_dS(N(R (Rtenable((sw/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/message.pytenable_warningsUscCs|jS(N(R!(R((sw/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/message.pytget_warning_countXscCs¼tjdƒ|jd7_|j r6|tkr6dSt|ƒtkrWt|ƒ}nt|t ƒrr|g}n|sŠt dƒg}nx8|d D],}|j j d|j d|j ƒfƒq•W|dj d|j ƒ}|tkród}n*|tkrd }n|tkrd }n|rEd |||jj||f}n;|jrmd |||jj|f}nd |||f}|j j |ƒ|tkr¸tjdƒt|ƒ‚ndS(syLog a warning, using optional file positioning information. If the warning is related to a ast.Node type, see log_node().twarningiNs iÿÿÿÿs%s: RtWarningtErrortFatals%s: %s: %s: %s: %s s%s: %s: %s: %s s %s: %s: %s tfatal(Rtbreak_on_debug_flagR!R tFATALttypetsettlistt isinstanceRRtwriteRRtWARNINGtERRORRtnamet SystemExit(Rtlog_typettextt positionstprefixtpositiont last_positiont error_type((sw/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/message.pytlog[s:  *         cCsÕ|r nXt|ddƒr'|j}n:|rB|jrB|j}ng}|sad||f}n|r‰dt|d|jƒ|f}n5| r¾t|dƒr¾d|jj|j|f}n|j|||ƒdS(s Log a warning, using information about file positions from the given node. The optional context argument, if given, should be another ast.Node type which will also be displayed. If no file position information is available from the node, the position data from the context will be used.tfile_positionss context=%r %ss%s: %stsymbolR:s (%s)%s: %sN(tgetattrRRDR:thasattrt __class__RRC(RR<tnodeR=tcontextR>((sw/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/message.pytlog_nodeŠs  "cCs*|j|||jdd|jfƒdS(s1Log a warning in the context of the given symbol.R?s symbol=%rN(RCR@tident(RR<RER=((sw/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/message.pyt log_symbol¢sN( RRRR$Rt classmethodR(R*R+RCRKRM(((sw/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/message.pyRCs   /cCs/tjƒ}|j|||d|d|ƒdS(NRJR>(RR(RK(R<RIR=RJR>tml((sw/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/message.pyRK¨s cCs&tjƒ}|jt|||ƒdS(N(RR(RCR8(R=R>R?RO((sw/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/message.pytwarn¬s cCs tt||d|d|ƒdS(NRJR>(RKR8(RIR=RJR>((sw/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/message.pyt warn_node°scCs#tjƒ}|jt||ƒdS(N(RR(RMR8(RER=RO((sw/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/message.pyt warn_symbol³s cCs&tjƒ}|jt|||ƒdS(N(RR(RCR2(R=R>R?RO((sw/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/message.pyR0·s (R RtRtrangeR8R9R2tobjectRRRRKRPRQRRR0(((sw/home/kou/work/ruby/ruby-gnome2.win32/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/message.pyts  "e