Warning
This document is for an old release of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.
galaxy.work package¶
Submodules¶
galaxy.work.context module¶
- class galaxy.work.context.WorkRequestContext(app, user=None, history=None, workflow_building_mode=False, url_builder=None, galaxy_session: Optional[GalaxySession] = None)[source]¶
Bases:
ProvidesHistoryContext
Stripped down implementation of Galaxy web transaction god object for work request handling outside of web threads - uses mix-ins shared with GalaxyWebTransaction to provide app, user, and history context convenience methods - but nothing related to HTTP handling, mako views, etc….
Things that only need app shouldn’t be consuming trans - but there is a need for actions potentially tied to users and histories and hopefully this can define that stripped down interface providing access to user and history information - but not dealing with web request and response objects.
- __init__(app, user=None, history=None, workflow_building_mode=False, url_builder=None, galaxy_session: Optional[GalaxySession] = None)[source]¶
- property app¶
Provide access to the Galaxy
app
object.
- property url_builder¶
Provide access to Galaxy URLs (if available).
- Parameters:
qualified (bool) – if True, the fully qualified URL is returned, else a relative URL is returned (default False).
- property history¶
Provide access to the user’s current history model object.
- Return type:
Optional[galaxy.model.History]
- property user¶
Return the current user if logged in or None.
- class galaxy.work.context.GalaxyAbstractRequest[source]¶
Bases:
object
Abstract interface to provide access to some request properties.
- class galaxy.work.context.GalaxyAbstractResponse[source]¶
Bases:
object
Abstract interface to provide access to some response utilities.
- abstract set_cookie(key: str, value: str = '', max_age: Optional[int] = None, expires: Optional[int] = None, path: str = '/', domain: Optional[str] = None, secure: bool = False, httponly: bool = False, samesite: Optional[typing_extensions.Literal[lax, strict, none]] = 'lax') None [source]¶
Set a cookie.
- class galaxy.work.context.SessionRequestContext(**kwargs)[source]¶
Bases:
WorkRequestContext
Like WorkRequestContext, but provides access to request.
- property host¶
- property request: GalaxyAbstractRequest¶
- property response: GalaxyAbstractResponse¶
- galaxy.work.context.proxy_work_context_for_history(trans: ProvidesHistoryContext, history: Optional[History] = None, workflow_building_mode=False)[source]¶
Create a WorkContext for supplied context with potentially different history.
This provides semi-structured access to a transaction/work context with a supplied target history that is different from the user’s current history (which also might change during the request).