Skip to content
Snippets Groups Projects
Commit c258a7ab authored by sveseli's avatar sveseli
Browse files

added experiment/experiment type classes that match db entities

parent 469ea017
No related branches found
No related tags found
No related merge requests found
#!/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
#!/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
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment