From c3e072e952984fedaca793fdb9a99b9bd3158fec Mon Sep 17 00:00:00 2001 From: Sebastian Wehling-Benatelli Date: Mon, 27 Oct 2014 12:11:35 +0100 Subject: [PATCH] trying to implement generic data structure import --- pylot/core/read/data.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pylot/core/read/data.py b/pylot/core/read/data.py index 4c3a0137..c2837408 100644 --- a/pylot/core/read/data.py +++ b/pylot/core/read/data.py @@ -82,11 +82,15 @@ class GenericDataStructure(object): base working on. ''' def __init__(self, stexp=None, folderdepth=4, **kwargs): - dbRegExp = {} structExpression = [] depth = 0 while stexp is not os.path.sep: - [stexp, tlexp] = os.path.split(stexp) + try: + [stexp, tlexp] = os.path.split(stexp) + except AttributeError: + rootExpression = None + structExpression = None + break structExpression.append(tlexp) depth += 1 if depth is folderdepth: @@ -95,7 +99,7 @@ class GenericDataStructure(object): structExpression.reverse() self.folderDepth = folderdepth - self.dataBaseDict = kwargs + self.dataBaseDict = {} class SeiscompDataStructure(object):