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.
-
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
-
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.
-
browser_url
[source]¶ Property that replaces itself with a calculated value the first time it is used.
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.
-
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_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.
-
-
galaxy.web.framework.base.
lazy_property
¶ alias of
LazyProperty