Back to index

moin  1.9.0~rc2
Namespaces | Functions | Variables
MoinMoin.support.pygments.formatters Namespace Reference

Namespaces

namespace  _mapping
namespace  bbcode
namespace  html
namespace  img
namespace  latex
namespace  other
namespace  rtf
namespace  svg
namespace  terminal
namespace  terminal256

Functions

def _init_formatter_cache
def find_formatter_class
def get_formatter_by_name
def get_formatter_for_filename
def get_all_formatters

Variables

tuple ns = globals()
list __all__
dictionary _formatter_alias_cache = {}
list _formatter_filename_cache = []

Function Documentation

Definition at line 30 of file __init__.py.

00030 
00031 def _init_formatter_cache():
00032     if _formatter_alias_cache:
00033         return
00034     for cls in get_all_formatters():
00035         for alias in cls.aliases:
00036             _formatter_alias_cache[alias] = cls
00037         for fn in cls.filenames:
00038             _formatter_filename_cache.append((fn, cls))
00039 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 40 of file __init__.py.

00040 
00041 def find_formatter_class(name):
00042     _init_formatter_cache()
00043     cls = _formatter_alias_cache.get(name, None)
00044     return cls
00045 

Here is the call graph for this function:

Here is the caller graph for this function:

Return a generator for all formatters.

Definition at line 63 of file __init__.py.

00063 
00064 def get_all_formatters():
00065     """Return a generator for all formatters."""
00066     for formatter in FORMATTERS:
00067         yield formatter
00068     for _, formatter in find_plugin_formatters():
00069         yield formatter

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 46 of file __init__.py.

00046 
00047 def get_formatter_by_name(name, **options):
00048     _init_formatter_cache()
00049     cls = _formatter_alias_cache.get(name, None)
00050     if not cls:
00051         raise ClassNotFound("No formatter found for name %r" % name)
00052     return cls(**options)
00053 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 54 of file __init__.py.

00054 
00055 def get_formatter_for_filename(fn, **options):
00056     _init_formatter_cache()
00057     fn = os.path.basename(fn)
00058     for pattern, cls in _formatter_filename_cache:
00059         if fnmatch.fnmatch(fn, pattern):
00060             return cls(**options)
00061     raise ClassNotFound("No formatter found for file name %r" % fn)
00062 

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Initial value:
00001 ['get_formatter_by_name', 'get_formatter_for_filename',
00002            'get_all_formatters']

Definition at line 23 of file __init__.py.

Definition at line 27 of file __init__.py.

Definition at line 28 of file __init__.py.

Definition at line 18 of file __init__.py.