class documentation

class MySectionizer(object): (source)

Constructor: MySectionizer(levelnfc)

View In Hierarchy

Helper class for generating hierarchical section numbers (e.g. '1.2.3.') with support for different numbering formats (numeric, uppercase, lowercase).

Method __init__ Initialise a new MySectionizer.
Method __str__ Return a string representation of the current section number.
Method clone Create and return a deep copy of this sectionizer.
Method getLevel Return the current nesting depth.
Method processLevel Update the section counter for the given nesting level.
Instance Variable levelnfc Undocumented
Instance Variable sections Undocumented
def __init__(self, levelnfc='0'): (source)

Initialise a new MySectionizer.

Parameters
levelnfc:strNumbering format code. Expected values are '0' for numeric sections (1.2.3), '1' for uppercase letters (A.B.C), and '2' for lowercase letters (a.b.c).
def __str__(self): (source)

Return a string representation of the current section number.

Returns
strSection string (e.g. '1.2.3.')
def clone(self): (source)

Create and return a deep copy of this sectionizer.

Returns
MySectionizerCloned MySectionizer instance
def getLevel(self): (source)

Return the current nesting depth.

Returns
intCurrent level (number of sections)
def processLevel(self, level): (source)

Update the section counter for the given nesting level.

Parameters
level:intHeading level to process. Expected values are positive integers where 1 is the top-level section and larger values increase nesting depth.
levelnfc = (source)

Undocumented

sections: list = (source)

Undocumented