[bugfix] try and error reading did not work for StationXML files
This commit is contained in:
parent
c1cb0e4a37
commit
2963be5bba
@ -301,9 +301,15 @@ class Metadata(object):
|
|||||||
return file_ending, robj
|
return file_ending, robj
|
||||||
# in case file endings did not match the above keys, try and error
|
# in case file endings did not match the above keys, try and error
|
||||||
for file_type in ['dless', 'xml']:
|
for file_type in ['dless', 'xml']:
|
||||||
robj, exc = read_functions[file_type](path_to_inventory_filename)
|
try:
|
||||||
if exc is None:
|
robj, exc = read_functions[file_type](path_to_inventory_filename)
|
||||||
return file_type, robj
|
if exc is None:
|
||||||
|
if self.verbosity:
|
||||||
|
print('Read file {} as {}'.format(path_to_inventory_filename, file_type))
|
||||||
|
return file_type, robj
|
||||||
|
except Exception as e:
|
||||||
|
if self.verbosity:
|
||||||
|
print('Could not read file {} as {}'.format(path_to_inventory_filename, file_type))
|
||||||
return None, None
|
return None, None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
Loading…
Reference in New Issue
Block a user