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.sample_tracking.sample

"""
Sample
"""
from galaxy.model import SampleState


[docs]class SampleStateFactory(object):
[docs] def new(self, request_type, name, description=None): """ Return new SampleState. """ assert name, 'SampleState requires a name' if description is None: description = '' return SampleState(name=name, desc=description, request_type=request_type)
[docs] def from_elem(self, request_type, elem): """ Return SampleState created from an xml string. """ name = elem.get('name', None) description = elem.get('description', None) return self.new(request_type, name, description=description)
sample_state_factory = SampleStateFactory()