emhelp#
Help subsystem for EmPy.
- class emhelp.ConfigSection(topic, description, header, config)#
A section with a block that consists of each configuration variable.
- class emhelp.ControlEntry(raw, right, var=None, val=None, env=None, arg=None, ord=None, ex=None, fun=None)#
An entry tailored to a control (named escape).
- class emhelp.Entry(raw, right, var=None, val=None, env=None, arg=None, ord=None, ex=None, fun=None)#
An entry in one of the usage tables. This exists to allow optional annotations or processing for each entry.
- format(raw)#
Format the raw list. Override in subclasses.
- class emhelp.HelpSection(topic, description, header, usage)#
A section with a block that consists of the help topics.
- refresh()#
Refresh the list of topics. At creation time it won’t contain itself.
- class emhelp.MappingSection(topic, description, header, mapping, factory=<class 'emhelp.Entry'>)#
A section with a block that consists of a mapping type which is transformed into a table of entries.
- class emhelp.NameEntry(raw, right, var=None, val=None, env=None, arg=None, ord=None, ex=None, fun=None)#
An entry tailored to a name.
- class emhelp.OptionEntry(raw, right, var=None, val=None, env=None, arg=None, ord=None, ex=None, fun=None)#
An entry tailored to an option.
- format(raw)#
Format the raw list. Override in subclasses.
- class emhelp.Section(topic, description, header)#
A section in one of the usage tables.
- class emhelp.TableSection(topic, description, header, entries)#
A section with a block that consists of a flat table of entries.
- class emhelp.Usage(config=None, file=None)#
A utility class to print usage and extended help.
- add(section)#
Add a section to the payload.
- entry(entry, format)#
Print a table entry.
- fix()#
Fix the payload.
- flush()#
Flush the underlying stream.
- preview(ords)#
Return a preview of the (non-text) character ordinals, or None.
- scan(table)#
Scan a table to find the minimum column width.
- separator()#
Write a separator.
- show(topics=None, useSeparator=True)#
Show usage.
- table(table)#
Print a table at the current level with an optional header.
- transform(topics)#
Transform a list of possible topics into a list of valid topics.
- write(string)#
Write a string (with the correct prefix substitution).
- emhelp.prepare(usage, executable=None)#
Lazily initialize the usage data and tables only if they’re actually needed. This is a standalone function so there’s less misleading indentation. Idempotent.