~ubuntu-branches/ubuntu/dapper/python-docutils/dapper

« back to all changes in this revision

Viewing changes to docs/api/runtime-settings.txt

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2005-12-13 13:47:41 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051213134741-fhuh5tq3n346q1oj
Tags: 0.3.9-0.1ubuntu1
Synchronize with Debian unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
:Author: David Goodger
6
6
:Contact: goodger@python.org
7
 
:Date: $Date: 2004/06/27 21:18:22 $
8
 
:Revision: $Revision: 1.6 $
 
7
:Date: $Date: 2005-02-25 03:36:17 +0100 (Fri, 25 Feb 2005) $
 
8
:Revision: $Revision: 2982 $
9
9
:Copyright: This document has been placed in the public domain.
10
10
 
11
11
.. contents::
37
37
(described in the ``docutils.core.publish_programmatically`` function
38
38
docstring):
39
39
 
40
 
* ``settings``, if present, is assumed to be complete and no further
41
 
  runtime settings processing is done.
 
40
* The ``settings`` parameter is a runtime settings
 
41
  (``docutils.frontend.Values``) object which, if present, is assumed
 
42
  to be complete (it must include all runtime settings).  Also, if the
 
43
  ``settings`` parameter is present, no further runtime settings
 
44
  processing is done.  In other words, the other parameters, described
 
45
  below, will have no effect.
42
46
 
43
 
* ``settings_spec`` is treated as a fourth component (after the
44
 
  Parser, Reader, and Writer).
 
47
* ``settings_spec``, a `docutils.SettingsSpec` subclass or object, is
 
48
  treated like a fourth component (after the Parser, Reader, and
 
49
  Writer).  In other words, it's the settings specification for the
 
50
  "Application" itself.
45
51
 
46
52
* ``settings_overrides`` is a dictionary which will override the
47
 
  defaults of the components.
 
53
  defaults of the components (from their settings specs).
48
54
 
49
 
* ``config_section`` sets or overrides an application-specific
 
55
* ``config_section`` specifies the name of an application-specific
50
56
  configuration file section.
51
57
 
52
58
 
57
63
 
58
64
Following along with the actual code is recommended.  The
59
65
``docutils/__init__.py``, ``docutils/core.py``, and
60
 
``docutils.frontend`` modules are described.
 
66
``docutils.frontend.py`` modules are described.
61
67
 
62
68
1. A command-line front-end tool imports and calls
63
69
   ``docutils.core.publish_cmdline``.  The relevant `convenience
163
169
Runtime Settings Processing From Applications
164
170
=============================================
165
171
 
166
 
Applications process runtime settings in a significantly different way
167
 
than `command-line tools`_ do.  Instead of calling
168
 
``publish_cmdline``, the application calls one of ``publish_file``,
169
 
``publish_string``, or ``publish_parts``.  These in turn call
170
 
``publish_programmatically``, which implements a generic programmatic
171
 
interface.  Although an application may also call
172
 
``publish_programmatically`` directly, it is not recommended (if it
173
 
does seem to be necessary, please write to the `Docutils-Develop
174
 
mailing list`_).
 
172
Applications process runtime settings in a different way than
 
173
`command-line tools`_ do.  Instead of calling ``publish_cmdline``, the
 
174
application calls one of ``publish_file``, ``publish_string``, or
 
175
``publish_parts``.  These in turn call ``publish_programmatically``,
 
176
which implements a generic programmatic interface.  Although an
 
177
application may also call ``publish_programmatically`` directly, it is
 
178
not recommended (if it does seem to be necessary, please write to the
 
179
`Docutils-Develop mailing list`_).
175
180
 
176
181
``publish_programmatically`` accepts the same `convenience function
177
182
parameters`_ as ``publish_cmdline``.  Where things differ is that
178
 
programmatic use does not
179
 
 
180
 
TO BE COMPLETED.
 
183
programmatic use does no command-line processing.  Instead of calling
 
184
``docutils.Publisher.process_command_line`` (as ``publish_cmdline``
 
185
does, via ``docutils.Publisher.publish``),
 
186
``docutils.Publisher.process_programmatic_settings`` is called to set
 
187
up the runtime settings.
181
188
 
182
189
.. copy & modify the list from command-line tools?
183
190