Linux worldls-302.fr.planethoster.net 4.18.0-553.8.1.lve.el7h.x86_64 #1 SMP Thu Jul 4 15:19:33 UTC 2024 x86_64
LiteSpeed
Server IP : 10.185.0.203 & Your IP : 216.73.217.14
Domains :
Cant Read [ /etc/named.conf ]
User : gerathty
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
lib /
python2.7 /
site-packages /
pygments /
formatters /
Delete
Unzip
Name
Size
Permission
Date
Action
__init__.py
3.51
KB
-rw-r--r--
2014-11-10 20:17
__init__.pyc
4.27
KB
-rw-r--r--
2016-08-02 10:51
__init__.pyo
4.27
KB
-rw-r--r--
2016-08-02 10:51
_mapping.py
5.28
KB
-rw-r--r--
2014-11-10 20:17
_mapping.pyc
5.6
KB
-rw-r--r--
2016-08-02 10:51
_mapping.pyo
5.6
KB
-rw-r--r--
2016-08-02 10:51
bbcode.py
3.24
KB
-rw-r--r--
2014-11-10 20:17
bbcode.pyc
3.46
KB
-rw-r--r--
2016-08-02 10:51
bbcode.pyo
3.46
KB
-rw-r--r--
2016-08-02 10:51
html.py
30.48
KB
-rw-r--r--
2015-01-20 07:56
html.pyc
27.68
KB
-rw-r--r--
2016-08-02 10:51
html.pyo
27.68
KB
-rw-r--r--
2016-08-02 10:51
img.py
17.58
KB
-rw-r--r--
2014-11-10 20:17
img.pyc
17.74
KB
-rw-r--r--
2016-08-02 10:51
img.pyo
17.74
KB
-rw-r--r--
2016-08-02 10:51
latex.py
17.2
KB
-rw-r--r--
2015-01-20 07:56
latex.pyc
13.8
KB
-rw-r--r--
2016-08-02 10:51
latex.pyo
13.8
KB
-rw-r--r--
2016-08-02 10:51
other.py
5.04
KB
-rw-r--r--
2014-11-10 20:17
other.pyc
5.95
KB
-rw-r--r--
2016-08-02 10:51
other.pyo
5.95
KB
-rw-r--r--
2016-08-02 10:51
rtf.py
4.93
KB
-rw-r--r--
2014-11-10 20:17
rtf.pyc
4.65
KB
-rw-r--r--
2016-08-02 10:51
rtf.pyo
4.65
KB
-rw-r--r--
2016-08-02 10:51
svg.py
5.7
KB
-rw-r--r--
2014-11-10 20:17
svg.pyc
5.91
KB
-rw-r--r--
2016-08-02 10:51
svg.pyo
5.91
KB
-rw-r--r--
2016-08-02 10:51
terminal.py
5.27
KB
-rw-r--r--
2014-11-10 20:17
terminal.pyc
5.33
KB
-rw-r--r--
2016-08-02 10:51
terminal.pyo
5.33
KB
-rw-r--r--
2016-08-02 10:51
terminal256.py
7.5
KB
-rw-r--r--
2014-11-10 20:17
terminal256.pyc
7.13
KB
-rw-r--r--
2016-08-02 10:51
terminal256.pyo
7.13
KB
-rw-r--r--
2016-08-02 10:51
Save
Rename
# -*- coding: utf-8 -*- """ pygments.formatters ~~~~~~~~~~~~~~~~~~~ Pygments formatters. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re import sys import types import fnmatch from os.path import basename from pygments.formatters._mapping import FORMATTERS from pygments.plugin import find_plugin_formatters from pygments.util import ClassNotFound, itervalues __all__ = ['get_formatter_by_name', 'get_formatter_for_filename', 'get_all_formatters'] + list(FORMATTERS) _formatter_cache = {} # classes by name _pattern_cache = {} def _fn_matches(fn, glob): """Return whether the supplied file name fn matches pattern filename.""" if glob not in _pattern_cache: pattern = _pattern_cache[glob] = re.compile(fnmatch.translate(glob)) return pattern.match(fn) return _pattern_cache[glob].match(fn) def _load_formatters(module_name): """Load a formatter (and all others in the module too).""" mod = __import__(module_name, None, None, ['__all__']) for formatter_name in mod.__all__: cls = getattr(mod, formatter_name) _formatter_cache[cls.name] = cls def get_all_formatters(): """Return a generator for all formatter classes.""" # NB: this returns formatter classes, not info like get_all_lexers(). for info in itervalues(FORMATTERS): if info[1] not in _formatter_cache: _load_formatters(info[0]) yield _formatter_cache[info[1]] for _, formatter in find_plugin_formatters(): yield formatter def find_formatter_class(alias): """Lookup a formatter by alias. Returns None if not found. """ for module_name, name, aliases, _, _ in itervalues(FORMATTERS): if alias in aliases: if name not in _formatter_cache: _load_formatters(module_name) return _formatter_cache[name] for _, cls in find_plugin_formatters(): if alias in cls.aliases: return cls def get_formatter_by_name(_alias, **options): """Lookup and instantiate a formatter by alias. Raises ClassNotFound if not found. """ cls = find_formatter_class(_alias) if cls is None: raise ClassNotFound("no formatter found for name %r" % _alias) return cls(**options) def get_formatter_for_filename(fn, **options): """Lookup and instantiate a formatter by filename pattern. Raises ClassNotFound if not found. """ fn = basename(fn) for modname, name, _, filenames, _ in itervalues(FORMATTERS): for filename in filenames: if _fn_matches(fn, filename): if name not in _formatter_cache: _load_formatters(modname) return _formatter_cache[name](**options) for cls in find_plugin_formatters(): for filename in cls.filenames: if _fn_matches(fn, filename): return cls(**options) raise ClassNotFound("no formatter found for file name %r" % fn) class _automodule(types.ModuleType): """Automatically import formatters.""" def __getattr__(self, name): info = FORMATTERS.get(name) if info: _load_formatters(info[0]) cls = _formatter_cache[info[1]] setattr(self, name, cls) return cls raise AttributeError(name) oldmod = sys.modules[__name__] newmod = _automodule(__name__) newmod.__dict__.update(oldmod.__dict__) sys.modules[__name__] = newmod del newmod.newmod, newmod.oldmod, newmod.sys, newmod.types