/usr/lib/python2.6/site-packages/pygments
NameSizeModeActions
filters/-0755rm
formatters/-0755rm
lexers/-0755rm
styles/-0755rm
cmdline.py130550644editdlrm
cmdline.pyc104430644editdlrm
cmdline.pyo104430644editdlrm
console.py18500644editdlrm
console.pyc23400644editdlrm
console.pyo23400644editdlrm
filter.py20710644editdlrm
filter.pyc31840644editdlrm
filter.pyo31840644editdlrm
formatter.py27900644editdlrm
formatter.pyc33440644editdlrm
formatter.pyo33440644editdlrm
lexer.py226250644editdlrm
lexer.pyc209710644editdlrm
lexer.pyo202040644editdlrm
plugin.py18620644editdlrm
plugin.pyc23730644editdlrm
plugin.pyo23730644editdlrm
scanner.py31140644editdlrm
scanner.pyc41740644editdlrm
scanner.pyo41740644editdlrm
style.py37450644editdlrm
style.pyc39430644editdlrm
style.pyo38670644editdlrm
token.py57840644editdlrm
token.pyc54080644editdlrm
token.pyo54080644editdlrm
unistring.py4042490644editdlrm
unistring.pyc2085150644editdlrm
unistring.pyo2085150644editdlrm
util.py65770644editdlrm
util.pyc77970644editdlrm
util.pyo77970644editdlrm
__init__.py29350644editdlrm
__init__.pyc33340644editdlrm
__init__.pyo33340644editdlrm
Edit: /usr/lib/python2.6/site-packages/pygments/util.pyo (7797B)
Ñò 5SsXc@szdZddkZddkZeidƒZeidƒZeidƒZdefd„ƒYZde fd „ƒYZ de d „Z dd „Zdd „Zdd „Zd„Zd„Zd„Zd„Zd„ZhZd„Zeidjo>eZZdZddkZddkZeiZeiZnCddk Z e iZdZd„Zddk!Z!e!iZe!iZdS(s± pygments.util ~~~~~~~~~~~~~ Utility functions. :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. iÿÿÿÿNs[/\\ ]sƒ(?smx) (<\?.*?\?>)?\s* ]*> s<(.+?)(\s.*?)?>.*?(?uism)t ClassNotFoundcBseZdZRS(sJ If one of the get_*_by_* functions didn't find a matching class. (t__name__t __module__t__doc__(((s1/usr/lib/python2.6/site-packages/pygments/util.pyRst OptionErrorcBseZRS((RR(((s1/usr/lib/python2.6/site-packages/pygments/util.pyR!scCsf|i||ƒ}|o|iƒ}n||jo,td|ditt|ƒƒfƒ‚n|S(Ns%Value for option %s must be one of %ss, (tgettlowerRtjointmaptstr(toptionstoptnametallowedtdefaulttnormcasetstring((s1/usr/lib/python2.6/site-packages/pygments/util.pytget_choice_opt%s &cCs¶|i||ƒ}t|tƒo|St|tƒo t|ƒSt|tƒptd||fƒ‚nG|iƒd jotS|iƒd jotStd ||fƒ‚dS( NsBInvalid type %r for option %s; use 1/0, yes/no, true/false, on/offt1tyesttruetont0tnotfalsetoffsCInvalid value %r for option %s; use 1/0, yes/no, true/false, on/off(RRRR(RRRR( Rt isinstancetbooltintt basestringRRtTruetFalse(R R R R((s1/usr/lib/python2.6/site-packages/pygments/util.pyt get_bool_opt/s cCsx|i||ƒ}yt|ƒSWnQtj otd||fƒ‚n*tj otd||fƒ‚nXdS(Ns=Invalid type %r for option %s; you must give an integer values>Invalid value %r for option %s; you must give an integer value(RRt TypeErrorRt ValueError(R R R R((s1/usr/lib/python2.6/site-packages/pygments/util.pyt get_int_optCscCsh|i||ƒ}t|tƒo |iƒSt|ttfƒo t|ƒStd||fƒ‚dS(Ns9Invalid type %r for option %s; you must give a list value(RRRtsplittlistttupleR(R R R tval((s1/usr/lib/python2.6/site-packages/pygments/util.pyt get_list_optQs  cCsq|ipdSg}xF|iiƒiƒD]/}|iƒo|id|iƒƒq+Pq+Wdi|ƒiƒS(Ntt (Rtstript splitlinestappendRtlstrip(tobjtrestline((s1/usr/lib/python2.6/site-packages/pygments/util.pytdocstring_headline]s  cs%‡fd†}ˆi|_t|ƒS(sR Return a static text analysation function that returns float values. c styˆ|ƒ}Wntj odSX|pdSy tdtdt|ƒƒƒSWnttfj odSXdS(Nggð?(t ExceptiontmintmaxtfloatR!R (ttexttrv(tf(s1/usr/lib/python2.6/site-packages/pygments/util.pyt text_analysens (Rt staticmethod(R8R9((R8s1/usr/lib/python2.6/site-packages/pygments/util.pytmake_analysatoris c Cs÷|idƒ}|djo|| iƒ}n |iƒ}|idƒo§yXg}ti|diƒƒD])}|o|idƒ o ||qmqm~d}Wntj otSXti d|ti ƒ}|i |ƒdj ot SntS( sõ Check if the given regular expression matches the last part of the shebang if one exists. >>> from pygments.util import shebang_matches >>> shebang_matches('#!/usr/bin/env python', r'python(2\.\d)?') True >>> shebang_matches('#!/usr/bin/python2.4', r'python(2\.\d)?') True >>> shebang_matches('#!/usr/bin/python-ruby', r'python(2\.\d)?') False >>> shebang_matches('#!/usr/bin/python/ruby', r'python(2\.\d)?') False >>> shebang_matches('#!/usr/bin/startsomethingwith python', ... r'python(2\.\d)?') True It also checks for common windows executable file extensions:: >>> shebang_matches('#!C:\Python2.4\Python.exe', r'python(2\.\d)?') True Parameters (``'-f'`` or ``'--foo'`` are ignored so ``'perl'`` does the same as ``'perl -e'``) Note that this method automatically searches the whole string (eg: the regular expression is wrapped in ``'^$'``) s is#!it-iÿÿÿÿs^%s(\.(exe|cmd|bat|bin))?$N(tfindRt startswitht split_path_reR#R*t IndexErrorRtretcompilet IGNORECASEtsearchtNoneR(R6tregextindext first_linet_[1]txtfound((s1/usr/lib/python2.6/site-packages/pygments/util.pytshebang_matches}s  $4 cCsRti|ƒ}|djotS|idƒ}ti|ƒi|iƒƒdj S(sÅ Check if the doctype matches a regular expression (if present). Note that this method only checks the first part of a DOCTYPE. eg: 'html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"' iN(tdoctype_lookup_retmatchRERtgroupRARBR*(R6RFtmtdoctype((s1/usr/lib/python2.6/site-packages/pygments/util.pytdoctype_matches«s  cCs t|dƒS(s= Check if the file looks like it has a html doctype. s%html\s+PUBLIC\s+"-//W3C//DTD X?HTML.*(RR(R6((s1/usr/lib/python2.6/site-packages/pygments/util.pythtml_doctype_matches¸scCswt|ƒ}y t|SWnXtj oLti|ƒ}|dj otSti|d ƒdj }|t|<|SXdS(s< Check if a doctype exists or if we have some tags. ièN( thasht_looks_like_xml_cachetKeyErrorRMRNRERttag_reRD(R6tkeyRPR7((s1/usr/lib/python2.6/site-packages/pygments/util.pytlooks_like_xmlÀs    iituR(cCsPt|tƒottt|ƒƒSt|tƒo|Std|fƒ‚dS(NsInvalid argument %r for b()(RR tbytesRtordR (ts((s1/usr/lib/python2.6/site-packages/pygments/util.pytbÛs (ii("RRAtsysRBR?RMRWR!RR2RRERRRR"R'R1R;RLRRRSRURYt version_infoR R^R[tu_prefixtStringIOt cStringIOtBytesIOtbuiltinstio(((s1/usr/lib/python2.6/site-packages/pygments/util.pyt s@       .