Back to index

moin  1.9.0~rc2
Classes | Functions | Variables
MoinMoin.support.pygments.filters Namespace Reference

Classes

class  CodeTagFilter
class  KeywordCaseFilter
class  NameHighlightFilter
class  ErrorToken
class  RaiseOnErrorTokenFilter
class  VisibleWhitespaceFilter

Functions

def find_filter_class
def get_filter_by_name
def get_all_filters
def _replace_special

Variables

dictionary FILTERS

Class Documentation

class MoinMoin::support::pygments::filters::ErrorToken

Definition at line 175 of file __init__.py.


Function Documentation

def MoinMoin.support.pygments.filters._replace_special (   ttype,
  value,
  regex,
  specialttype,
  replacefunc = lambda x: x 
) [private]

Definition at line 61 of file __init__.py.

00061 
00062                      replacefunc=lambda x: x):
00063     last = 0
00064     for match in regex.finditer(value):
00065         start, end = match.start(), match.end()
00066         if start != last:
00067             yield ttype, value[last:start]
00068         yield specialttype, replacefunc(value[start:end])
00069         last = end
00070     if last != len(value):
00071         yield ttype, value[last:]
00072 

Here is the caller graph for this function:

Lookup a filter by name. Return None if not found.

Definition at line 26 of file __init__.py.

00026 
00027 def find_filter_class(filtername):
00028     """
00029     Lookup a filter by name. Return None if not found.
00030     """
00031     if filtername in FILTERS:
00032         return FILTERS[filtername]
00033     for name, cls in find_plugin_filters():
00034         if name == filtername:
00035             return cls
00036     return None
00037 

Here is the call graph for this function:

Here is the caller graph for this function:

Return a generator of all filter names.

Definition at line 50 of file __init__.py.

00050 
00051 def get_all_filters():
00052     """
00053     Return a generator of all filter names.
00054     """
00055     for name in FILTERS:
00056         yield name
00057     for name, _ in find_plugin_filters():
00058         yield name
00059 

Here is the call graph for this function:

Here is the caller graph for this function:

def MoinMoin.support.pygments.filters.get_filter_by_name (   filtername,
  options 
)
Return an instantiated filter. Options are passed to the filter
initializer if wanted. Raise a ClassNotFound if not found.

Definition at line 38 of file __init__.py.

00038 
00039 def get_filter_by_name(filtername, **options):
00040     """
00041     Return an instantiated filter. Options are passed to the filter
00042     initializer if wanted. Raise a ClassNotFound if not found.
00043     """
00044     cls = find_filter_class(filtername)
00045     if cls:
00046         return cls(**options)
00047     else:
00048         raise ClassNotFound('filter %r not found' % filtername)
00049 

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Initial value:
00001 {
00002     'codetagify':     CodeTagFilter,
00003     'keywordcase':    KeywordCaseFilter,
00004     'highlight':      NameHighlightFilter,
00005     'raiseonerror':   RaiseOnErrorTokenFilter,
00006     'whitespace':     VisibleWhitespaceFilter,
00007 }

Definition at line 286 of file __init__.py.