Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
sebastianp 2016-08-10 10:06:48 +02:00
commit dd6bce89fb

View File

@ -345,6 +345,7 @@ class PDFstatistics(object):
''' '''
def __init__(self, directory): def __init__(self, directory):
self.directory = directory self.directory = directory
self.evtlist = list()
self.return_phase = None self.return_phase = None
def readTheta(self, arname, dir, fnpattern): def readTheta(self, arname, dir, fnpattern):
@ -358,10 +359,15 @@ class PDFstatistics(object):
exec('self.' + arname + ' += list') exec('self.' + arname + ' += list')
fid.close() fid.close()
def makeFileList(self, fn_pattern='*.xml'):
def makeFileList(self, fn_pattern='*'): evtlist = list()
self.evtlist = glob.glob1((os.path.join(self.directory)), '*.xml') evtlist = glob.glob1((os.path.join(self.directory)), fn_pattern)
if not evtlist:
for root, _, files in os.walk(self.directory):
for file in files:
if file.endswith(fn_pattern[1:]):
evtlist.append(os.path.join(root, file))
self.evtlist = evtlist
def __iter__(self): def __iter__(self):
assert isinstance(self.return_phase, str), 'phase has to be set before being able to iterate over items...' assert isinstance(self.return_phase, str), 'phase has to be set before being able to iterate over items...'