Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes
MoinMoin.support.pygments.filters.KeywordCaseFilter Class Reference
Inheritance diagram for MoinMoin.support.pygments.filters.KeywordCaseFilter:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.support.pygments.filters.KeywordCaseFilter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def filter

Public Attributes

 convert

Detailed Description

Convert keywords to lowercase or uppercase or capitalize them, which
means first letter uppercase, rest lowercase.

This can be useful e.g. if you highlight Pascal code and want to adapt the
code to your styleguide.

Options accepted:

`case` : string
   The casing to convert keywords to. Must be one of ``'lower'``,
   ``'upper'`` or ``'capitalize'``.  The default is ``'lower'``.

Definition at line 105 of file __init__.py.


Constructor & Destructor Documentation

Definition at line 120 of file __init__.py.

00120 
00121     def __init__(self, **options):
00122         Filter.__init__(self, **options)
00123         case = get_choice_opt(options, 'case', ['lower', 'upper', 'capitalize'], 'lower')
00124         self.convert = getattr(unicode, case)


Member Function Documentation

def MoinMoin.support.pygments.filters.KeywordCaseFilter.filter (   self,
  lexer,
  stream 
)

Definition at line 125 of file __init__.py.

00125 
00126     def filter(self, lexer, stream):
00127         for ttype, value in stream:
00128             if ttype in Keyword:
00129                 yield ttype, self.convert(value)
00130             else:
00131                 yield ttype, value
00132 


Member Data Documentation

Definition at line 123 of file __init__.py.


The documentation for this class was generated from the following file: