From beaa2a9f09db9a99c594bf821ebef557b1db429a Mon Sep 17 00:00:00 2001 From: Thomas Lake Date: Fri, 25 May 2012 21:44:23 +0100 Subject: [PATCH] JSObserver documentation --- docs/config.rst | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/docs/config.rst b/docs/config.rst index c41d995..3e79340 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -269,16 +269,39 @@ the form ``key = value``. Two items take a different form:, ``worlds`` and This is used by default when the output is a terminal. Displays a text based progress bar and some statistics. - ``JSObserver`` + ``JSObserver(outputdir[, minrefresh][, messages])`` This will display render progress on the output map in the bottom right - corner of the screen. ``JSObserver`` must be invoked with two parameters. + corner of the screen. ``JSObserver``. - The first is output directory. For simplicity, specify this as ``outputdir`` - and place this line after setting ``outputdir = ""``. + * ``outputdir="`` + Progress information won't be written to file or requested by your + web browser more frequently than this interval. + + * ``messages=dict(totalTiles=, renderCompleted=, renderProgress=)`` + Customises messages displayed in browser. All three messages must be + defined as follows: + + * ``totalTiles="Rendering %d tiles"`` + The ``%d`` format string will be replaced with the total number of + tiles to be rendered. + + * ``renderCompleted="Render completed in %02d:%02d:%02d"`` + The three format strings will be replaced with the number of hours. + minutes and seconds taken to complete this render. + + * ``renderProgress="Rendered %d of %d tiles (%d%%)"`` + The three format strings will be replaced with the number of tiles + completed, the total number of tiles and the percentage complete + + Format strings are explained here: http://docs.python.org/library/stdtypes.html#string-formatting + All format strings must be present in your custom messages. + :: from observer import JSObserver