ó LzñWc@sbdZddlZddlZddlZddlZd„Zdefd„ƒYZeƒZdS(s] This module defines the messages diplay class, and creates the application-wide msg object. iÿÿÿÿNcCs|S(N((ttxt((s?/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/msg.pyt_ stMessagecBs­eZdZddd„Zdd„Zdd„Zd„Zd„Zd„Z d „Z d „Z d „Z d „Z d „Zd„Zd„Zd„Zd„Zdd„ZRS(s’ All messages in the program are output using the `msg' object in the main package. This class defines the interface for this object. icCs ||_|j|_|r'||_nd|_d|_d|_g|_tjdƒ|_ |j j ƒ}|tj kr“t t jdƒ|_n d|_dS(sÜ Initialize the object with the specified verbosity level and an optional writing function. If no such function is specified, no message will be output until the 'write' field is changed. its./tdblatextwN(tlevelt write_stdouttwritetshorttpathtcwdtpostloggingt getLoggert_logtgetEffectiveLeveltWARNINGtopentostdevnulltstdouttNone(tselfRR((s?/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/msg.pyt__init__s       icCs |GHdS(N((RttextR((s?/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/msg.pyR'scCstj|IJdS(N(tsyststderr(RRR((s?/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/msg.pyt write_stderr)scCs|jj|ƒdS(N(R tappend(RR ((s?/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/msg.pytpush_pos,scCs|jd=dS(Niÿÿÿÿ(R (R((s?/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/msg.pytpop_pos.scCs2|jr.||jkr.|j|d|ƒndS(sË This is the low level printing function, it receives a line of text with an associated verbosity level, so that output can be filtered depending on command-line options. RN(RR(RRR((s?/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/msg.pyt__call__1scKs|dkr›|dd!dkr,|d}n|jj|j||ƒƒ|jdƒr|dr|j r|jj|j|tdƒ|dƒƒqne|dkr|jrÇtdƒ|d }ntd ƒ||d f}|jj|j||ƒƒnd S( s0 Print an error or warning message. The argument 'kind' indicates the kind of message, among "error", "warning", "abort", the argument 'text' is the main text of the message, the other arguments provide additional information, including the location of the error. terrorii s LaTeX Error: tcodesleading text: tabortscompilation aborted twhyscompilation aborted: %s %sN(RR!t format_posthas_keyR R(RtkindRtinfotmsg((s?/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/msg.pytdisplay:s  #  cKs|jddd||dS(NR'R!R(R*(RRR(((s?/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/msg.pyR!SscKs |jj|j||ƒƒdS(N(RtwarningR%(Rtwhattwhere((s?/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/msg.pytwarnUscKs$|jj|j||dƒƒdS(Ns...(RR(R%(RR,R-((s?/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/msg.pytprogressWscKs |jj|j||ƒƒdS(N(RR(R%(RR,R-((s?/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/msg.pyR(YscKs |jj|j||ƒƒdS(N(RtdebugR%(RR,R-((s?/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/msg.pytlog[scKs |jj|j||ƒƒdS(N(RR0R%(RR,R-((s?/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/msg.pyR0]scCsxt|jƒdkrD|dks1|jdƒ r`|jd}q`n|dks\|ikr`|S|jdƒr|ddk r|j|dƒ}|jdƒr |dr d|t|dƒf}|jdƒr |d|dkrd|t|dƒf}qq n|d}nd }|jd ƒrJd |t|d ƒf}n|jd ƒrpd |d |f}n||S(sÖ Format the given text into a proper error message, with file and line information in the standard format. Position information is taken from the dictionary given as first argument. itfileiÿÿÿÿtlines%s:%dtlasts%s-%ds: Rtpages %s (page %d)tpkgs[%s] %sN(tlenR RR&tsimplifytint(RR-RR ((s?/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/msg.pyR%`s&# cCsUtjjtjj|j|ƒƒ}|t|jƒ |jkrQ|t|jƒS|S(s} Simplify an path name by removing the current directory if the specified path is in a subdirectory. (RR tnormpathtjoinR7R (RtnameR ((s?/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/msg.pyR8|s$cCs[|r|j}||_nd}x!|D]}|j|d}q(W|rW||_n|S(Nii(RR*(Rt generatortwriterRt somethingR)((s?/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/msg.pyt display_all†s      N(t__name__t __module__t__doc__RRRRRRR R*R!R.R/R(R1R0R%R8R@(((s?/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/msg.pyR s"             ( RCRtos.pathRR RtobjectRR)(((s?/usr/lib/python2.7/dist-packages/dbtexmf/dblatex/grubber/msg.pyts    …