PyFoam.Basics.RestructuredTextHelper module

Helps formatting output for restructured text

class PyFoam.Basics.RestructuredTextHelper.LabledReSTTable[source]

Bases: PyFoam.Basics.RestructuredTextHelper.ReSTTable

A ReSTTable that has rownames in the first column and column-names in the first row

__init__()[source]
__module__ = 'PyFoam.Basics.RestructuredTextHelper'
addItem(column, value, row=None)[source]
addRow(rowName)[source]
class PyFoam.Basics.RestructuredTextHelper.ReSTTable[source]

Bases: object

Class that administrates a two-dimensional table and prints it as a restructured text-table when asked

__dict__ = mappingproxy({'__weakref__': <attribute '__weakref__' of 'ReSTTable' objects>, '__setitem__': <function ReSTTable.__setitem__>, '__init__': <function ReSTTable.__init__>, '__doc__': 'Class that administrates a two-dimensional table and prints it as\n a restructured text-table when asked', '__str__': <function ReSTTable.__str__>, '__dict__': <attribute '__dict__' of 'ReSTTable' objects>, '__module__': 'PyFoam.Basics.RestructuredTextHelper', 'addLine': <function ReSTTable.addLine>, 'setElement': <function ReSTTable.setElement>})
__init__()[source]
__module__ = 'PyFoam.Basics.RestructuredTextHelper'
__setitem__(index, value)[source]

Sets an item of the table :param index: a tuple with a row and a column. If it is a single integer then the row is assumed :param value: the value to set. If only the row was specified it is a list with the column values

__str__()[source]

Output the actual table

__weakref__

list of weak references to the object (if defined)

addLine(val=None, head=False)[source]

Add a line after that row :param val: the row after which to add. If None a line will be added after the current last row

setElement(row, col, value)[source]

Sets a specific element :param row: the row :param col: column :param value: the used value

class PyFoam.Basics.RestructuredTextHelper.RestructuredTextHelper(defaultHeading=2)[source]

Bases: object

Helper class that formats stuff for restructured text

LevelChapter = 1
LevelParagraph = 5
LevelPart = 0
LevelSection = 2
LevelSubSection = 3
LevelSubSubSection = 4
_RestructuredTextHelper__markup(limiter, *txt)
__dict__ = mappingproxy({'__weakref__': <attribute '__weakref__' of 'RestructuredTextHelper' objects>, 'heading': <function RestructuredTextHelper.heading>, 'LevelSection': 2, 'code': <function RestructuredTextHelper.code>, 'LevelSubSubSection': 4, '__module__': 'PyFoam.Basics.RestructuredTextHelper', '_RestructuredTextHelper__markup': <function RestructuredTextHelper.__markup>, 'literal': <function RestructuredTextHelper.literal>, 'emphasis': <function RestructuredTextHelper.emphasis>, '__init__': <function RestructuredTextHelper.__init__>, 'definitionList': <function RestructuredTextHelper.definitionList>, 'buildHeading': <function RestructuredTextHelper.buildHeading>, '__doc__': 'Helper class that formats stuff for restructured text', 'strong': <function RestructuredTextHelper.strong>, 'table': <function RestructuredTextHelper.table>, 'LevelPart': 0, 'LevelParagraph': 5, 'bulletList': <function RestructuredTextHelper.bulletList>, 'LevelChapter': 1, 'enumerateList': <function RestructuredTextHelper.enumerateList>, '__dict__': <attribute '__dict__' of 'RestructuredTextHelper' objects>, 'LevelSubSection': 3})
__init__(defaultHeading=2)[source]
__module__ = 'PyFoam.Basics.RestructuredTextHelper'
__weakref__

list of weak references to the object (if defined)

buildHeading(*text, **keywords)[source]

General method to build a heading :param text: list of items that build the heading text :param level: The level of the heading

bulletList(data, bullet='-')[source]

Generate a bullet list from the data

code(code, language='python')[source]

@param code: string to be typeset as a program code @param language: programming language to be used

definitionList(data)[source]

Generate a definiton list from the data.

emphasis(*txt)[source]
enumerateList(data, first=1)[source]

Generate an enumerated list from the data. First number can be chosen and determines the format

heading(*text)[source]

Build a heading on the default level

literal(*txt)[source]
strong(*txt)[source]
table(labeled=False)[source]

Creates a new ReSTTable-object