pyweblight package

Submodules

pyweblight.configs module

All configurations for pyweblight

class pyweblight.configs.ConfigForce[source]

Bases: Config

Shared parameters for the start and stop commands

force = True

pyweblight.main module

main entry point to the program

pyweblight.main.main()[source]
pyweblight.main.start() → None[source]
pyweblight.main.stop() → None[source]

pyweblight.static module

version which can be consumed from within the module

pyweblight.webserver_start module

Web server for development purposes, light weight with some features.

Mark Veltzer

TODO: - call this project dws. - fix the logging of the web server to go to .dws_logs - fix it so the cwd of the web server will not change to /. - fix it so if there is a problem with the web server I will print the error

to the screen.

  • self.path has parameters in it. strip them.

  • /favicon.ico return 500 and should return 404.

  • make the search path much more elaborate so that I can easy searching for files inside

libraries. - make the transport of requests be UTF-8 so that the browser will shut up about the fact that all my documents do not have ending in them.

class pyweblight.webserver_start.MyHandler(*args)[source]

Bases: StoppableHttpRequestHandler

do_GET()[source]

Serve a GET request.

do_POST()[source]
get()[source]
handle_dir(real_path)[source]
handle_esp()[source]
handle_static(resolved, mimetype)[source]
log_message(format, *args)[source]

override the log method and call the parent

resolve(name)[source]
to_path()[source]
write(message)[source]
class pyweblight.webserver_start.StoppableHttpRequestHandler(*args, directory=None, **kwargs)[source]

Bases: SimpleHTTPRequestHandler

http request handler with QUIT stopping the server

do_QUIT()[source]

send 200 OK response, and set server.stop to True

class pyweblight.webserver_start.StoppableHttpServer(*args, **kwargs)[source]

Bases: HTTPServer

http server that reacts to self.stop flag

serve_forever(poll_interval=0.5)[source]

Handle one request at a time until stopped.

pyweblight.webserver_start.main()[source]

pyweblight.webserver_stop module

Stop the webserver

pyweblight.webserver_stop.main()[source]

Module contents

Initialize the module