Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes Class Reference
Inheritance diagram for
Inheritance graph
Collaboration diagram for
Collaboration graph

List of all members.

Public Member Functions

def __init__
def filter

Public Attributes


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

Constructor & Destructor Documentation

Definition at line 120 of file

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 (   self,

Definition at line 125 of file

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

Member Data Documentation

Definition at line 123 of file

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