0

Add documentation for JSObserver

Adds documentation for JSObserver and updates documentation for the
observer option in general
This commit is contained in:
Thomas Lake
2012-04-18 20:48:49 +01:00
parent ed01a3cf07
commit c7fd50bd2d

View File

@@ -165,6 +165,8 @@ the form ``key = value``. Two items take a different form:, ``worlds`` and
**You must specify at least one render** **You must specify at least one render**
.. _outputdir:
``outputdir = "<output directory path>"`` ``outputdir = "<output directory path>"``
This is the path to the output directory where the rendered tiles will This is the path to the output directory where the rendered tiles will
be saved. be saved.
@@ -199,11 +201,38 @@ the form ``key = value``. Two items take a different form:, ``worlds`` and
observer to be used. The observer object is expected to have at least ``start``, observer to be used. The observer object is expected to have at least ``start``,
``add``, ``update``, and ``finish`` methods. ``add``, ``update``, and ``finish`` methods.
e.g.:: If you want to specify an observer manually, try something like:
::
from observer import ProgressBarObserver()
observer = ProgressBarObserver() observer = ProgressBarObserver()
.. _outputdir: There are currently three observers available: ``LoggingObserver``,
``ProgressBarObserver`` and ``JSObserver``.
``LoggingObserver``
This gives the normal/older style output and is the default when output
is redirected to a file or when running on Windows
``ProgressBarObserver``
This is used by default when the output is a terminal. Displays a text based
progress bar and some statistics.
``JSObserver``
This will display render progress on the output map in the bottom right
corner of the screen. ``JSObserver`` must be invoked with two parameters.
The first is output directory. For simplicity, specify this as ``outputdir``
and place this line after setting ``outputdir = "<output directory path>"``.
The second parameter is the minimum interval between progress updates in
seconds. Progress information won't be written to file or requested by
your web browser more frequently than this interval.
::
from observer import JSObserver
observer = JSObserver(outputdir, 10)
.. _renderdict: .. _renderdict: