mewlo.mpacks.core.site.msitemanager module

msitemanager.py This file contains classes to handle Mewlo site manager class.

class mewlo.mpacks.core.site.msitemanager.MewloSiteManager(debugmode, siteclass=None, commandlineargs=None)[source]

Bases: object

The MewloManager class holds a collection of Mewlo “sites”, which can handle incoming requests. Typically, you would have only one single site running from your web server, but there may be times when you want to server multiple sites from a single instantiation running off a single port. When supporting multiple sites, the sites are completely independent of one another, and must have completely separate uri prefixes. They share nothing.

add_site(site)[source]

Add a site to our list of managed sites.

create_add_site_from_class(siteclass)[source]

Instatiate a site class and set it to be owned by use.

create_and_start_webserver_wsgiref(portnumber=8080)[source]

Create a wsgiref web server and begin serving requests.

debug_sites(indent=1)[source]

Debug helper; return string with recursive debug info from child sites.

debugmessage(astr)[source]

Display a simple debug message with date+time to stdout. ATTN: We probably want to remove this later.

do_main_commandline_early()[source]

Commandline early default processing.

do_main_commandline_late()[source]

Commandline late default processing.

classmethod do_main_commandline_startup(siteclass, parser=None)[source]

Shortcut helper function to create a sitemanager and site and parse main commandline options. :return: tuple (args, sitemanager)

dumps(indent=0)[source]

Return a string (with newlines and indents) that displays some debugging useful information about the object.

get_allpack_events()[source]

Get combined eventlist for all packs on all sites

has_preparationerrors()[source]

Return true if there were fatal preparation errors.

is_readytoserve()[source]

Check if there were any site prep errors, OR if any packs report they are not ready to run (need update, etc.).

preprocess_request(request)[source]

Pre-process and parse the request. Here we might add stuff to it before asking child sites to look at it.

process_request(request)[source]

Process a request by handing it off to all of our child sites in turn until we find one that will handle it.

shutdown()[source]

Ask all children sites to ‘shutdown’.

startup()[source]

Ask all children sites to ‘startup’.

test_submit_path(pathstr)[source]

Simulate the submission of a url.

updatecheck()[source]

Check all packs for updates. The packs themselves will store details about update check results. Note this covers not just web updates available, but database updates needed.

updaterun()[source]

Check all packs for updates. The packs themselves will store details about update check results. Note this covers not just web updates available, but database updates needed.

wsgiref_callback(environ, start_response)[source]

Receive a callback from wsgi web server. We process it and then send response.