Commit c1c63adb authored by Javier Quinteros's avatar Javier Quinteros

Iterate through files also if only metadata is requested

parent ad885016
......@@ -373,9 +373,18 @@ class TDMS(object):
def __iter_metadata__(self):
# Metadata
logs = logging.getLogger('Iterate Metadata')
for ch in self.metadata:
yield self.metadata[ch]
# logs = logging.getLogger('Iterate Metadata')
while (self.__twend is None) or (self.__twstart < self.__twend):
for ch in self.metadata:
yield self.metadata[ch]
# No more data in this file. Skip to the next one.
self.__currentfile += 1
try:
self.__select_file()
except IndexError:
break
def __readstring(self):
# logs = logging.getLogger('readstring')
......@@ -524,7 +533,10 @@ def main():
help='Experiment to read and process. It is usually the first part of the filenames.')
args = parser.parse_args()
logging.basicConfig(level=args.loglevel)
if args.metadata:
logging.basicConfig(level=args.loglevel, stream=sys.stdout)
else:
logging.basicConfig(level=args.loglevel)
logs = logging.getLogger('OpenFile')
logs.setLevel(args.loglevel)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment