framework Package

framework Package

Galaxy web application framework

base Module

A simple WSGI application/framework.

class galaxy.web.framework.base.DefaultWebTransaction(environ)[source]

Bases: object

Wraps the state of a single web transaction (request/response cycle).

TODO: Provide hooks to allow application specific state to be included
in here.
session[source]

Property that replaces itself with a calculated value the first time it is used.

class galaxy.web.framework.base.FieldStorage(fp=None, headers=None, outerboundary='', environ={'CELERY_LOG_REDIRECT_LEVEL': 'WARNING', 'NEW_RELIC_CONFIG_FILE': '/home/docs/newrelic.ini', 'CELERY_LOG_REDIRECT': '1', 'LOGNAME': 'docs', 'USER': 'docs', 'PATH': '/home/docs/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'HOME': '/home/docs', 'PS1': '(docs)', 'TERM': 'linux', 'SHELL': '/bin/bash', 'TZ': 'America/Chicago', '_MP_FORK_LOGFORMAT_': '[%(asctime)s: %(levelname)s/%(processName)s] %(message)s', 'SHLVL': '1', 'SUPERVISOR_ENABLED': '1', 'CELERY_LOG_FILE': '/home/docs/log/celery_proc.log', 'DJANGO_PROJECT_DIR': '/home/docs/checkouts/readthedocs.org/readthedocs', 'SUDO_USER': 'root', 'EDITOR': 'vim', 'USERNAME': 'docs', 'READTHEDOCS': 'True', 'SUDO_UID': '0', 'VIRTUAL_ENV': '/home/docs', 'CELERY_LOADER': 'djcelery.loaders.DjangoLoader', '_MP_FORK_LOGLEVEL_': '20', 'SUPERVISOR_SERVER_URL': 'unix:///home/docs/run/supervisord-docs.sock', '_': '/home/docs/bin/supervisord', 'SUDO_COMMAND': '/bin/bash -c /home/docs/bin/supervisord --nodaemon', 'SUDO_GID': '0', 'SUPERVISOR_PROCESS_NAME': 'celery', 'OLDPWD': '/home/docs', 'PWD': '/var/build/user_builds/jmchilton-galaxy/checkouts/latest/doc/source', '_MP_FORK_LOGFILE_': '/home/docs/log/celery_proc.log', 'MAIL': '/var/mail/docs', 'CELERY_LOG_LEVEL': '20', 'SUPERVISOR_GROUP_NAME': 'celery'}, keep_blank_values=0, strict_parsing=0)[source]

Bases: cgi.FieldStorage

make_file(binary=None)[source]
read_lines()[source]
class galaxy.web.framework.base.LazyProperty(func)[source]

Bases: object

Property that replaces itself with a calculated value the first time it is used.

class galaxy.web.framework.base.Request(environ)[source]

Bases: webob.Request

Encapsulates an HTTP request.

base[source]

Property that replaces itself with a calculated value the first time it is used.

browser_url[source]

Property that replaces itself with a calculated value the first time it is used.

cookies[source]

Property that replaces itself with a calculated value the first time it is used.

path[source]

Property that replaces itself with a calculated value the first time it is used.

protocol

Descriptor that delegates a property to a key in the environ member of the associated object (provides property style access to keys in the WSGI environment)

remote_host[source]

Property that replaces itself with a calculated value the first time it is used.

remote_hostname[source]

Property that replaces itself with a calculated value the first time it is used.

remote_port

Descriptor that delegates a property to a key in the environ member of the associated object (provides property style access to keys in the WSGI environment)

class galaxy.web.framework.base.Response[source]

Bases: object

Describes an HTTP response. Currently very simple since the actual body of the request is handled separately.

get_content_type()[source]
send_redirect(url)[source]

Send an HTTP redirect response to (target url)

set_content_type(type)[source]

Sets the Content-Type header

wsgi_headeritems()[source]

Return headers in format appropriate for WSGI start_response

wsgi_status()[source]

Return status line in format appropriate for WSGI start_response

class galaxy.web.framework.base.WSGIEnvironmentProperty(key, default='')[source]

Bases: object

Descriptor that delegates a property to a key in the environ member of the associated object (provides property style access to keys in the WSGI environment)

class galaxy.web.framework.base.WebApplication[source]

Bases: object

A simple web application which maps requests to objects using routes, and to methods on those objects in the CherryPy style. Thus simple argument mapping in the CherryPy style occurs automatically, but more complicated encoding of arguments in the PATH_INFO can be performed with routes.

add_api_controller(controller_name, controller)[source]
add_route(route, **kwargs)[source]

Add a route to match a URL with a method. Accepts all keyword arguments of routes.Mapper.connect. Every route should result in at least a controller value which corresponds to one of the objects added with add_controller. It optionally may yield an action argument which will be used to locate the method to call on the controller. Additional arguments will be passed to the method as keyword args.

add_ui_controller(controller_name, controller)[source]

Add a controller class to this application. A controller class has methods which handle web requests. To connect a URL to a controller’s method use add_route.

finalize_config()[source]

Call when application is completely configured and ready to serve requests

handle_controller_exception(e, trans, **kwargs)[source]

Allow handling of exceptions raised in controller methods.

handle_request(environ, start_response)[source]
make_body_iterable(trans, body)[source]
set_transaction_factory(transaction_factory)[source]

Use the callable transaction_factory to create the transaction which will be passed to requests.

trace(**fields)[source]
galaxy.web.framework.base.flatten(seq)[source]

Flatten a possible nested set of iterables

galaxy.web.framework.base.iterate_file(file)[source]

Progressively return chunks from file.

galaxy.web.framework.base.lazy_property

alias of LazyProperty

galaxy.web.framework.base.send_file(start_response, trans, body)[source]

openid_manager Module

Manage the OpenID consumer and related data stores.

class galaxy.web.framework.openid_manager.OpenIDManager(cache_path)[source]

Bases: object

CANCEL = 'cancel'
FAILURE = 'failure'
SETUP_NEEDED = 'setup_needed'
SUCCESS = 'success'
add_sreg(trans, request, required=None, optional=None)[source]
get_consumer(trans)[source]
get_session(trans)[source]
get_sreg(info)[source]
persist_session(trans, oidconsumer)[source]
galaxy.web.framework.openid_manager.oidlog(message, level=0)[source]