From 6e0729e6f017c6741cf5c5d6ae5dac2a3c376f7d Mon Sep 17 00:00:00 2001 From: JayPiKay Date: Thu, 3 Oct 2019 10:46:13 +0200 Subject: [PATCH] Updated documentation --- source/conf.py | 4 ++-- source/index.rst | 13 +++++++++++++ src/SuperBeam/RequestHandlers.py | 11 ++++------- src/SuperBeam/__init__.py | 3 +++ src/sbeam.py | 2 +- 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/source/conf.py b/source/conf.py index 4be96ad..48e60b6 100644 --- a/source/conf.py +++ b/source/conf.py @@ -22,10 +22,10 @@ copyright = '2019, Julian Knauer' author = 'Julian Knauer' # The short X.Y version -version = '0.3' +version = '0.5' # The full version, including alpha/beta/rc tags -release = '0.3' +release = 'alpha' # -- General configuration --------------------------------------------------- diff --git a/source/index.rst b/source/index.rst index 00a1c90..1f2f430 100644 --- a/source/index.rst +++ b/source/index.rst @@ -6,11 +6,24 @@ Welcome to SuperBeam documentation! =================================== + +Command line tool +----------------- + .. toctree:: :maxdepth: 2 :caption: Contents: sbeam + + +SuperBeam Development +--------------------- + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + SuperBeam SuperBeam.RequestHandlers diff --git a/src/SuperBeam/RequestHandlers.py b/src/SuperBeam/RequestHandlers.py index b33fb76..05f90a8 100644 --- a/src/SuperBeam/RequestHandlers.py +++ b/src/SuperBeam/RequestHandlers.py @@ -1,15 +1,12 @@ # -*- coding: utf-8 -*- """SuperBeam Handlers -SuperBeam Handlers define how to handle certain requests to the -`SuperBeamServer`. Each handler needs to be registered in ThumbHandler -`SuperBeamServer.do_GET()` function within the ``paths`` variable and imported -in the top of the :mod:`SuperBeam` module. - -The handlers itself are defined in this module. +The handlers are automatically registered during the creation of the +:class:`SuperBeamServer` instance. Each class handler method needs to be a ``staticmethod``. The callee will call -the `handle()` with the ``httpd`` instance of the :class:`SuperBeamServer`. +the `handle()` with the ``httpd`` instance of the :class:`SuperBeamServer` as +required argument. """ import os diff --git a/src/SuperBeam/__init__.py b/src/SuperBeam/__init__.py index cbb9ed1..4c31245 100644 --- a/src/SuperBeam/__init__.py +++ b/src/SuperBeam/__init__.py @@ -20,6 +20,9 @@ class SuperBeamServer(BaseHTTPRequestHandler): Class is built on top of :mod:`http.server.BaseHTTPRequestHandler` as simple http server. + During initialization, the RequestHandlers are registered as routable + paths. + Call :func:`serve_forever()` to start the HTTP server. The mainloop will serve a list of files given as argument to :func:`serve_forever()`. diff --git a/src/sbeam.py b/src/sbeam.py index d4c7b2e..4c7a5fb 100755 --- a/src/sbeam.py +++ b/src/sbeam.py @@ -31,7 +31,7 @@ import requests import SuperBeam -__VERSION__ = '0.4' +__VERSION__ = '0.5' @click.group()