Hackfut Security File Manager
Current Path:
/usr/lib/python2.6/site-packages/pygments/formatters
usr
/
lib
/
python2.6
/
site-packages
/
pygments
/
formatters
/
📁
..
📄
__init__.py
(1.8 KB)
📄
__init__.pyc
(2.52 KB)
📄
__init__.pyo
(2.52 KB)
📄
_mapping.py
(5.37 KB)
📄
_mapping.pyc
(5.74 KB)
📄
_mapping.pyo
(5.74 KB)
📄
bbcode.py
(3.24 KB)
📄
bbcode.pyc
(3.5 KB)
📄
bbcode.pyo
(3.5 KB)
📄
html.py
(25.48 KB)
📄
html.pyc
(24.01 KB)
📄
html.pyo
(24.01 KB)
📄
img.py
(16.37 KB)
📄
img.pyc
(17 KB)
📄
img.pyo
(17 KB)
📄
latex.py
(10.39 KB)
📄
latex.pyc
(8.63 KB)
📄
latex.pyo
(8.63 KB)
📄
other.py
(3.77 KB)
📄
other.pyc
(4.67 KB)
📄
other.pyo
(4.67 KB)
📄
rtf.py
(4.43 KB)
📄
rtf.pyc
(4.32 KB)
📄
rtf.pyo
(4.32 KB)
📄
svg.py
(5.73 KB)
📄
svg.pyc
(5.94 KB)
📄
svg.pyo
(5.94 KB)
📄
terminal.py
(3.92 KB)
📄
terminal.pyc
(4.16 KB)
📄
terminal.pyo
(4.16 KB)
📄
terminal256.py
(7.43 KB)
📄
terminal256.pyc
(7.12 KB)
📄
terminal256.pyo
(7.12 KB)
Editing: __init__.py
# -*- coding: utf-8 -*- """ pygments.formatters ~~~~~~~~~~~~~~~~~~~ Pygments formatters. :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import os.path import fnmatch from pygments.formatters._mapping import FORMATTERS from pygments.plugin import find_plugin_formatters from pygments.util import docstring_headline, ClassNotFound ns = globals() for fcls in FORMATTERS: ns[fcls.__name__] = fcls del fcls __all__ = ['get_formatter_by_name', 'get_formatter_for_filename', 'get_all_formatters'] + [cls.__name__ for cls in FORMATTERS] _formatter_alias_cache = {} _formatter_filename_cache = [] def _init_formatter_cache(): if _formatter_alias_cache: return for cls in get_all_formatters(): for alias in cls.aliases: _formatter_alias_cache[alias] = cls for fn in cls.filenames: _formatter_filename_cache.append((fn, cls)) def find_formatter_class(name): _init_formatter_cache() cls = _formatter_alias_cache.get(name, None) return cls def get_formatter_by_name(name, **options): _init_formatter_cache() cls = _formatter_alias_cache.get(name, None) if not cls: raise ClassNotFound("No formatter found for name %r" % name) return cls(**options) def get_formatter_for_filename(fn, **options): _init_formatter_cache() fn = os.path.basename(fn) for pattern, cls in _formatter_filename_cache: if fnmatch.fnmatch(fn, pattern): return cls(**options) raise ClassNotFound("No formatter found for file name %r" % fn) def get_all_formatters(): """Return a generator for all formatters.""" for formatter in FORMATTERS: yield formatter for _, formatter in find_plugin_formatters(): yield formatter
Upload File
Create Folder