diff --git a/src/python/dm/common/objects/experiment.py b/src/python/dm/common/objects/experiment.py new file mode 100755 index 0000000000000000000000000000000000000000..7c3578627146443ff66229be6db3dd93944c1225 --- /dev/null +++ b/src/python/dm/common/objects/experiment.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +import time +from dmObject import DmObject + +class Experiment(DmObject): + + DEFAULT_KEY_LIST = [ 'id', 'name', 'dataDirectory', 'startTime', 'stopTime' ] + + def __init__(self, dict={}): + DmObject.__init__(self, dict) + +#################################################################### +# Testing +if __name__ == '__main__': + pass + diff --git a/src/python/dm/common/objects/experimentType.py b/src/python/dm/common/objects/experimentType.py new file mode 100755 index 0000000000000000000000000000000000000000..20369b1790094b193bc7b8c4f6c1a0793478239d --- /dev/null +++ b/src/python/dm/common/objects/experimentType.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +import time +from dmObject import DmObject + +class ExperimentType(DmObject): + + DEFAULT_KEY_LIST = [ 'id', 'name', 'description`', 'rootDataPath' ] + + def __init__(self, dict={}): + DmObject.__init__(self, dict) + +#################################################################### +# Testing +if __name__ == '__main__': + pass + diff --git a/src/python/dm/common/objects/observedFile.py b/src/python/dm/common/objects/observedFile.py new file mode 100755 index 0000000000000000000000000000000000000000..2ffee2845e79cf612192a42b03dd9b256baef2f1 --- /dev/null +++ b/src/python/dm/common/objects/observedFile.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +import time +from dmObject import DmObject + +class ObservedFile(DmObject): + + DEFAULT_KEY_LIST = [ 'path', 'lastUpdatedTimestamp' ] + + def __init__(self, path=None, dict={}): + DmObject.__init__(self, dict) + if path: + self['path'] = path + + def setLastUpdatedTimestampToNow(self): + self['lastUpdateTimestamp'] = time.time() + + def getLastUpdatedTimestamp(self): + self.get('lastUpdateTimestamp') + + def getPath(self): + return self.get('path') + +#################################################################### +# Testing +if __name__ == '__main__': + of = ObservedFile(path='tmp/xyz') + print of + of.setLastUpdatedTimestampToNow() + print of +