class documentation

class Publisher(object): (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 Set and return default settings (overrides in defaults dict).
Method process​_command​_line Pass an empty list to argv to avoid reading sys.argv (the default).
Method process​_programmatic​_settings Undocumented
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_​System​Message Undocumented
Method report_​Unicode​Error 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.
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)

Set and return default settings (overrides in defaults dict).

Set components first (self.set_reader & self.set_writer). Explicitly setting self.settings disables command line option processing from self.publish().

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

Pass an empty list to argv to avoid reading sys.argv (the default).

Set components first (self.set_reader & self.set_writer).

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

Undocumented

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).
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.
_stderr = (source)

Undocumented