From 574c0b0f1dc4557babda7be2f5a0ed6265f6ffe8 Mon Sep 17 00:00:00 2001 From: Ean McLaughlin Date: Mon, 9 Dec 2013 23:18:19 -0700 Subject: [PATCH] Extend Observers Section Added sections for MultiplexingObserver and ServerAnnounceObserver. --- docs/config.rst | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/docs/config.rst b/docs/config.rst index a2f3f93..0071142 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -295,6 +295,7 @@ the form ``key = value``. Two items take a different form:, ``worlds`` and Path to overviewer output directory. For simplicity, specify this as ``outputdir=outputdir`` and place this line after setting ``outputdir = ""``. + **Required** * ``minrefresh=`` @@ -316,14 +317,55 @@ the form ``key = value``. Two items take a different form:, ``worlds`` and * ``renderProgress="Rendered %d of %d tiles (%d%% ETA:%s)""`` The four format strings will be replaced with the number of tiles completed, the total number of tiles, the percentage complete, and the ETA. + 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 - observer = JSObserver(outputdir, 10) + from observer import JSObserver + observer = JSObserver(outputdir, 10) + + + ``MultiplexingObserver(Observer[, Observer[, Observer ...]])`` + This observer will send the progress information to all Observers passed + to it. + + * All Observers passed must implement the full Observer interface. + + :: + + ## An example that updates both a LoggingObserver and a JSObserver + # Import the Observers + from Observer import MultiplexingObserver, LoggingObserver, JSObserver + + # Construct the LoggingObserver + loggingObserver = LoggingObserver() + + # Construct a basic JSObserver + jsObserver = JSObserver(outputdir) # This assumes you have set the outputdir previous to this line + + # Set the observer to a MultiplexingObserver + observer = MultiplexingObserver(loggingObserver, jsObserver) + + ``ServerAnnounceObserver(target, pct_interval)`` + This Observer will send its progress and status to a Minecraft server + via ``target`` with a Minecraft ``say`` command. + + * ``target=`` + Either a FIFO file or stdin. Progress and status messages will be written to this handle. + + **Required** + + * ``pct_interval=`` + Progress and status messages will not be written more often than this value. + E.g., a value of ``1`` will make the ServerAnnounceObserver write to its target + once for every 1% of progress. + + **Required** + + .. _customwebassets: