Package docutils :: Module core :: Class Publisher
[show private | hide private]
[frames | no frames]

Class Publisher


A facade encapsulating the high-level logic of a Docutils system.
Method Summary
  __init__(self, reader, parser, writer, source, source_class, destination, destination_class, settings)
Initial setup.
  apply_transforms(self, document)
  get_settings(self, usage, description, settings_spec, **defaults)
Set and return default settings (overrides in defaults keyword argument).
  process_command_line(self, argv, usage, description, settings_spec, **defaults)
Pass an empty list to argv to avoid reading sys.argv (the default).
  publish(self, argv, usage, description, settings_spec, settings_overrides, enable_exit)
Process command line options and arguments (if self.settings not already set), run self.reader and then self.writer.
  set_components(self, reader_name, parser_name, writer_name)
  set_destination(self, destination, destination_path)
  set_io(self, source_path, destination_path)
  set_reader(self, reader_name, parser, parser_name)
Set self.reader by name.
  set_source(self, source, source_path)
  set_writer(self, writer_name)
Set self.writer by name.
  setup_option_parser(self, usage, description, settings_spec, **defaults)

Method Details

__init__(self, reader=None, parser=None, writer=None, source=None, source_class=<class docutils.io.FileInput at 0x82681bc>, destination=None, destination_class=<class docutils.io.FileOutput at 0x8248554>, settings=None)
(Constructor)

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).

get_settings(self, usage=None, description=None, settings_spec=None, **defaults)

Set and return default settings (overrides in defaults keyword argument).

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

process_command_line(self, argv=None, usage=None, description=None, settings_spec=None, **defaults)

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

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

publish(self, argv=None, usage=None, description=None, settings_spec=None, settings_overrides=None, enable_exit=None)

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

set_reader(self, reader_name, parser, parser_name)

Set self.reader by name.

set_writer(self, writer_name)

Set self.writer by name.

Generated by Epydoc 2.0 on Tue Jul 22 05:31:07 2003 http://epydoc.sf.net