diff options
author | blackbird <devnull@localhost> | 2006-10-22 12:54:00 +0200 |
---|---|---|
committer | blackbird <devnull@localhost> | 2006-10-22 12:54:00 +0200 |
commit | f2db9aedba7959d57d43903e4eff78db101e6234 (patch) | |
tree | f84bda4581de9a456c47b2ee8aeb61482ff385d7 /pygments/formatters/__init__.py | |
parent | 7fd6f0d8a3903a6538ffeec2d64102cfe8ce23b1 (diff) | |
download | pygments-f2db9aedba7959d57d43903e4eff78db101e6234.tar.gz |
[svn] added experimental (untested) plugin support. i'll try writing some plugins tomorrow when i've more time ;)
Diffstat (limited to 'pygments/formatters/__init__.py')
-rw-r--r-- | pygments/formatters/__init__.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pygments/formatters/__init__.py b/pygments/formatters/__init__.py index d112a88e..74557440 100644 --- a/pygments/formatters/__init__.py +++ b/pygments/formatters/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ pygments.formatters - ~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~ Pygments formatters. @@ -14,6 +14,7 @@ from pygments.formatters.terminal import TerminalFormatter from pygments.formatters.latex import LatexFormatter from pygments.formatters.bbcode import BBCodeFormatter from pygments.formatters.other import NullFormatter, RawTokenFormatter +from pygments.plugin import find_plugin_formatters def _doc_desc(obj): @@ -46,12 +47,15 @@ FORMATTERS = { _formatter_cache = {} def _init_formatter_cache(): - if _formatter_cache: return + if _formatter_cache: + return for cls, info in FORMATTERS.iteritems(): for alias in info[1]: _formatter_cache[alias] = cls for ext in info[2]: _formatter_cache["/"+ext] = cls + for name, cls in find_plugin_formatters(): + _formatter_cache[name] = cls def get_formatter_by_name(name, **options): |