From 1362031d8a2f73f5b045f2fca202f680a3484a0d Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Tue, 15 Mar 2011 09:45:29 +0200 Subject: [PATCH] Re-added my documentation which got lost somewhere along the line. --- openlp/plugins/remotes/lib/httpserver.py | 68 ++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/openlp/plugins/remotes/lib/httpserver.py b/openlp/plugins/remotes/lib/httpserver.py index cf32e2dbb..158b9afd6 100644 --- a/openlp/plugins/remotes/lib/httpserver.py +++ b/openlp/plugins/remotes/lib/httpserver.py @@ -24,6 +24,74 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### +""" +The :mod:`http` module contains the API web server. This is a lightweight web +server used by remotes to interact with OpenLP. It uses JSON to communicate with +the remotes. + +*Routes:* + +``/`` + Go to the web interface. + +``/files/{filename}`` + Serve a static file. + +``/api/poll`` + Poll to see if there are any changes. Returns a JSON-encoded dict of + any changes that occurred:: + + {"results": {"type": "controller"}} + + Or, if there were no results, False:: + + {"results": False} + +``/api/controller/{live|preview}/{action}`` + Perform ``{action}`` on the live or preview controller. Valid actions + are: + + ``next`` + Load the next slide. + + ``previous`` + Load the previous slide. + + ``jump`` + Jump to a specific slide. Requires an id return in a JSON-encoded + dict like so:: + + {"request": {"id": 1}} + + ``first`` + Load the first slide. + + ``last`` + Load the last slide. + + ``text`` + Request the text of the current slide. + +``/api/service/{action}`` + Perform ``{action}`` on the service manager (e.g. go live). Data is + passed as a json-encoded ``data`` parameter. Valid actions are: + + ``next`` + Load the next item in the service. + + ``previous`` + Load the previews item in the service. + + ``jump`` + Jump to a specific item in the service. Requires an id returned in + a JSON-encoded dict like so:: + + {"request": {"id": 1}} + + ``list`` + Request a list of items in the service. +""" + import logging import os import urlparse