from pyon.agent.agent import ResourceAgentState from pyon.core.exception import InstStateError from pyon.public import OT from pyon.core.bootstrap import IonObject from pyon.util.containers import get_safe from pyon.ion.stream import StandaloneStreamPublisher from ion.agents.instrument.exceptions import InstrumentStateException from ion.agents.instrument.instrument_agent import InstrumentAgent from ion.core.includes.mi import DriverEvent from ion.services.dm.utility.granule.record_dictionary import RecordDictionaryTool from coverage_model import ParameterDictionary # TODO: make unique for multiple processes on same VM EGG_CACHE = EggCache('/tmp/eggs%d' % os.getpid()) class Poller(object): """ abstract class to show API needed for plugin poller objects """ def __init__(self, config, memento, data_callback, exception_callback): pass def start(self): pass def shutdown(self): pass class Parser(object):
from pyon.core.exception import InstStateError from pyon.public import OT from pyon.core.bootstrap import IonObject from pyon.util.containers import get_safe from pyon.ion.stream import StandaloneStreamPublisher from ion.agents.instrument.exceptions import InstrumentStateException from ion.agents.instrument.instrument_agent import InstrumentAgent from ion.core.includes.mi import DriverEvent from ion.services.dm.utility.granule.record_dictionary import RecordDictionaryTool from coverage_model import ParameterDictionary # TODO: make unique for multiple processes on same VM EGG_CACHE_DIR = '/tmp/eggs%d' % os.getpid() EGG_CACHE = EggCache(EGG_CACHE_DIR) DSA_STATE_KEY = 'dsa_state' class DataSetAgent(InstrumentAgent): """ this dataset agent has two states: autosampling and idle based on InstrumentAgent but override methods to simplify flow control generalized ion interface, specialization provided by the driver class. """ ORIGIN_TYPE = "Dataset" def __init__(self, *args, **kwargs): super(DataSetAgent, self).__init__(*args, **kwargs) log.debug("Agent: __init__")
def setUp(self): self.cache = '/tmp/test-cache-%d'%os.getpid() os.mkdir(self.cache) self.subject = EggCache(cache_dir=self.cache)