ó Y-Qc@sŽdZddlmZddlmZmZmZddlmZddl m Z ddgZ defd„ƒYZ defd „ƒYZ d S( sę pygments.formatters.other ~~~~~~~~~~~~~~~~~~~~~~~~~ Other formatters: NullFormatter, RawTokenFormatter. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. i˙˙˙˙(t Formatter(t OptionErrortget_choice_opttb(tToken(tcolorizet NullFormattertRawTokenFormattercBs2eZdZdZddgZdgZd„ZRS(s; Output the text unchanged without any formatting. s Text onlyttexttnulls*.txtcCsP|j}x@|D]8\}}|r;|j|j|ƒƒq|j|ƒqWdS(N(tencodingtwritetencode(tselft tokensourcetoutfiletenctttypetvalue((sC/usr/local/lib/python2.7/site-packages/pygments/formatters/other.pytformats  (t__name__t __module__t__doc__tnametaliasest filenamesR(((sC/usr/local/lib/python2.7/site-packages/pygments/formatters/other.pyRs   cBsAeZdZdZddgZdgZeZd„Zd„Z RS(s} Format tokens as a raw representation for storing token streams. The format is ``tokentyperepr(tokenstring)\n``. The output can later be converted to a token stream with the `RawTokenLexer`, described in the `lexer list `_. Only two options are accepted: `compress` If set to ``'gz'`` or ``'bz2'``, compress the output with the given compression algorithm after encoding (default: ``''``). `error_color` If set to a color name, highlight error tokens using that color. If set but with no value, defaults to ``'red'``. *New in Pygments 0.11.* s Raw tokenstrawttokenss*.rawcKsÖtj|||jr(tdƒ‚nd|_t|dddddgdƒ|_|jddƒ|_|jt kr…d |_n|jdk rŇyt |jdƒWqŇt k rÎt d |jƒ‚qŇXndS( Ns6the raw formatter does not support the encoding optiontasciitcompressttnonetgztbz2t error_colortredsInvalid color %r specified( Rt__init__R RRRtgettNoneR"tTrueRtKeyErrort ValueError(R toptions((sC/usr/local/lib/python2.7/site-packages/pygments/formatters/other.pyR$>s     c s‰yˆjtdƒƒWntk r6tdƒ‚nX|jdkr…ddl}|jdddˆƒ‰‡fd†}ˆj}ni|jdkrÖddl}|jdƒ‰‡‡fd †}‡‡fd †}n‡fd †}ˆj}|j rSx„|D]N\}}d ||f} |t j krB|t |j | ƒƒqţ|| ƒqţWn+x(|D] \}}|d ||fƒqZW|ƒdS( NRs3The raw tokens formatter needs a binary output fileR i˙˙˙˙twbi csˆj|jƒƒdS(N(R R (R(R(sC/usr/local/lib/python2.7/site-packages/pygments/formatters/other.pyR YsR!cs ˆjˆj|jƒƒƒdS(N(R RR (R(t compressorR(sC/usr/local/lib/python2.7/site-packages/pygments/formatters/other.pyR _scs!ˆjˆjƒƒˆjƒdS(N(R tflush((R,R(sC/usr/local/lib/python2.7/site-packages/pygments/formatters/other.pyR-ascsˆj|jƒƒdS(N(R R (R(R(sC/usr/local/lib/python2.7/site-packages/pygments/formatters/other.pyR ess%s %r ( R Rt TypeErrorRtgziptGzipFileR-R!t BZ2CompressorR"RtErrorR( R RRR/R R-R!RRtline((R,RsC/usr/local/lib/python2.7/site-packages/pygments/formatters/other.pyRPs2      ( RRRRRRtFalset unicodeoutputR$R(((sC/usr/local/lib/python2.7/site-packages/pygments/formatters/other.pyR%s   N(Rtpygments.formatterRt pygments.utilRRRtpygments.tokenRtpygments.consoleRt__all__RR(((sC/usr/local/lib/python2.7/site-packages/pygments/formatters/other.pyt s