modified the GenericDataStructure class in order to fit into the concept of different data structures (work in progress)

This commit is contained in:
Sebastian Wehling-Benatelli 2015-01-29 08:50:39 +01:00
parent f5eda74730
commit eab0ea5a7e

View File

@ -108,6 +108,10 @@ class Data(object):
def filter(self, kwargs): def filter(self, kwargs):
self.getWFData().filter(**kwargs) self.getWFData().filter(**kwargs)
def setWFData(self, fnames):
for fname in fnames:
self.wfdata += read(fname)
def getWFData(self): def getWFData(self):
return self.wfdata return self.wfdata
@ -121,12 +125,13 @@ class GenericDataStructure(object):
base working on. base working on.
''' '''
def __init__(self, stexp=None, folderdepth=4, **kwargs): def __init__(self, structexp='$R/$D/$E', folderdepth=2, **kwargs):
structureOptions = ('$R', '$D', '$E')
structExpression = [] structExpression = []
depth = 0 depth = 0
while stexp is not os.path.sep: while structexp is not os.path.sep:
try: try:
[stexp, tlexp] = os.path.split(stexp) [structexp, tlexp] = os.path.split(structexp)
except AttributeError: except AttributeError:
rootExpression = None rootExpression = None
structExpression = None structExpression = None
@ -139,8 +144,16 @@ class GenericDataStructure(object):
structExpression.reverse() structExpression.reverse()
self.folderDepth = folderdepth self.folderDepth = folderdepth
self.dataBaseDict = {} self.__gdsFields = {'ROOT':rootExpression}
self.modifyFields(**kwargs)
def modifyFields(self, **kwargs):
for key, value in kwargs.iteritems():
key = str(key).upper()
self.__gdsFields[key] = value
def getFields(self):
return self.__gdsFields
class PilotDataStructure(object): class PilotDataStructure(object):
''' '''