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.
Source code for galaxy.web.params
"""
Mixins for parsing web form and API parameters
"""
from galaxy import util
[docs]class BaseParamParser:
[docs] def get_params(self, kwargs):
params = util.Params(kwargs)
# set defaults if unset
updates = dict(webapp=params.get('webapp', 'galaxy'),
message=util.restore_text(params.get('message', '')),
status=util.restore_text(params.get('status', 'done')))
params.update(updates)
return params
[docs]class QuotaParamParser(BaseParamParser):
[docs] def get_quota_params(self, kwargs):
params = self.get_params(kwargs)
updates = dict(name=util.restore_text(params.get('name', '')),
description=util.restore_text(params.get('description', '')),
amount=util.restore_text(params.get('amount', '').strip()),
operation=params.get('operation', ''),
default=params.get('default', ''),
in_users=util.listify(params.get('in_users', [])),
out_users=util.listify(params.get('out_users', [])),
in_groups=util.listify(params.get('in_groups', [])),
out_groups=util.listify(params.get('out_groups', [])))
params.update(updates)
return params