Web Framework

modelr.web

This module contains the Web specific parts of modelr.

modelr.web.server

Main program to strat a web server.

Created on Apr 30, 2012

@author: sean

class modelr.web.server.MyHandler(request, client_address, server)

Handles a single request.

do_GET()

handle a get request.

eval_script(script)

Evaluate a script in the scripts directory.

run_script(script, script_main, add_arguments, short_description, parameters)

Run a script

Parameters:
  • script_main – the main method of the script
  • add_arguments – poplate an argument parser
  • short_description – a short description of the script
  • parameters – the parameters from the get request
send_script_error(msg)

Send an error related to the script.

terminate()

shut down the application

modelr.web.server.main()

Main method starts a server and exits on

modelr.web.server

class modelr.web.urlargparse.Argument(name, required=False, default=None, type=<type 'str'>, action='store', help='')

An place holder for an url argument.

exception modelr.web.urlargparse.ArgumentError

Exception to be called when arguments are not as expected by the parser.

exception modelr.web.urlargparse.SendHelp(html)

Exception to be called when the help argument is found.

class modelr.web.urlargparse.URLArgumentParser(description)

Parse a key=value arguments in a url string.

Modeled after http://docs.python.org/dev/library/argparse.html

add_argument(name, required=False, default=None, type=<type 'str'>, action='store', help='')

add an argument

parse_params(params)

parse the arguments gotten by urlparse.parse_qs

parse_ulr(path)

parse a url into its argument.

Table Of Contents

Previous topic

Getting Started

Next topic

Reflectivity

This Page