class documentation

class Publisher: (source)

View In Hierarchy

A facade encapsulating the high-level logic of a Docutils system.

Method __init__ Initial setup. If any of `reader`, `parser`, or `writer` are not specified, the corresponding ``set_...`` method should be called with a component name (`set_reader` sets the parser as well).
Method apply_transforms Undocumented
Method debugging_dumps Undocumented
Method get_settings Return settings from components and config files.
Method process_command_line Parse command line arguments and set ``self.settings``.
Method process_programmatic_settings Undocumented
Method prompt Print info and prompt when waiting for input from a terminal.
Method publish Process command line options and arguments (if `self.settings` not already set), run `self.reader` and then `self.writer`. Return `self.writer`'s output.
Method report_Exception Undocumented
Method report_SystemMessage Undocumented
Method report_UnicodeError Undocumented
Method set_components Undocumented
Method set_destination Undocumented
Method set_io Undocumented
Method set_reader Set `self.reader` by name.
Method set_source Undocumented
Method set_writer Set `self.writer` by name.
Method setup_option_parser Undocumented
Instance Variable destination The destination for docutils output, a `docutils.io.Output` instance.
Instance Variable destination_class The class for dynamically created destination objects.
Instance Variable document The document tree (`docutils.nodes` objects).
Instance Variable parser A `docutils.parsers.Parser` instance.
Instance Variable reader A `docutils.readers.Reader` instance.
Instance Variable settings An object containing Docutils settings as instance attributes. Set by `self.process_command_line()` or `self.get_settings()`.
Instance Variable source The source of input data, a `docutils.io.Input` instance.
Instance Variable source_class The class for dynamically created source objects.
Instance Variable writer A `docutils.writers.Writer` instance.
Method _setup_settings_parser Undocumented
Instance Variable _stderr Undocumented
def __init__(self, reader=None, parser=None, writer=None, source=None, source_class=io.FileInput, destination=None, destination_class=io.FileOutput, settings=None): (source)

Initial setup. If any of `reader`, `parser`, or `writer` are not specified, the corresponding ``set_...`` method should be called with a component name (`set_reader` sets the parser as well).

def apply_transforms(self): (source)

Undocumented

def debugging_dumps(self): (source)

Undocumented

def get_settings(self, usage=None, description=None, settings_spec=None, config_section=None, **defaults): (source)

Return settings from components and config files. Please set components first (`self.set_reader` & `self.set_writer`). Use keyword arguments to override component defaults (before updating from configuration files). Calling this function also sets `self.settings` which makes `self.publish()` skip parsing command line options.

def process_command_line(self, argv=None, usage=None, description=None, settings_spec=None, config_section=None, **defaults): (source)

Parse command line arguments and set ``self.settings``. Pass an empty sequence to `argv` to avoid reading `sys.argv` (the default behaviour). Set components first (`self.set_reader` & `self.set_writer`).

def process_programmatic_settings(self, settings_spec, settings_overrides, config_section): (source)

Undocumented

def prompt(self): (source)

Print info and prompt when waiting for input from a terminal.

def publish(self, argv=None, usage=None, description=None, settings_spec=None, settings_overrides=None, config_section=None, enable_exit_status=False): (source)

Process command line options and arguments (if `self.settings` not already set), run `self.reader` and then `self.writer`. Return `self.writer`'s output.

def report_Exception(self, error): (source)

Undocumented

def report_SystemMessage(self, error): (source)

Undocumented

def report_UnicodeError(self, error): (source)

Undocumented

def set_components(self, reader_name, parser_name, writer_name): (source)

Undocumented

def set_destination(self, destination=None, destination_path=None): (source)

Undocumented

def set_io(self, source_path=None, destination_path=None): (source)

Undocumented

def set_reader(self, reader_name, parser, parser_name): (source)

Set `self.reader` by name.

def set_source(self, source=None, source_path=None): (source)

Undocumented

def set_writer(self, writer_name): (source)

Set `self.writer` by name.

def setup_option_parser(self, usage=None, description=None, settings_spec=None, config_section=None, **defaults): (source)

Undocumented

destination = (source)

The destination for docutils output, a `docutils.io.Output` instance.

destination_class = (source)

The class for dynamically created destination objects.

document = (source)

The document tree (`docutils.nodes` objects).

parser = (source)

A `docutils.parsers.Parser` instance.

reader = (source)

A `docutils.readers.Reader` instance.

settings = (source)

An object containing Docutils settings as instance attributes. Set by `self.process_command_line()` or `self.get_settings()`.

source = (source)

The source of input data, a `docutils.io.Input` instance.

source_class = (source)

The class for dynamically created source objects.

writer = (source)

A `docutils.writers.Writer` instance.

def _setup_settings_parser(self, *args, **kwargs): (source)

Undocumented

_stderr = (source)

Undocumented