[bugfix] Metadata object did not find inventory for relative directory paths/unescaped backslashes
This commit is contained in:
parent
c765e7c66b
commit
5971508cab
@ -27,6 +27,10 @@ class Metadata(object):
|
|||||||
# saves which metadata files are from obspy dmt
|
# saves which metadata files are from obspy dmt
|
||||||
self.obspy_dmt_invs = []
|
self.obspy_dmt_invs = []
|
||||||
if inventory:
|
if inventory:
|
||||||
|
# make sure that no accidental backslashes mess up the path
|
||||||
|
if isinstance(inventory, str):
|
||||||
|
inventory = inventory.replace('\\', '/')
|
||||||
|
inventory = os.path.abspath(inventory)
|
||||||
if os.path.isdir(inventory):
|
if os.path.isdir(inventory):
|
||||||
self.add_inventory(inventory)
|
self.add_inventory(inventory)
|
||||||
if os.path.isfile(inventory):
|
if os.path.isfile(inventory):
|
||||||
|
Loading…
Reference in New Issue
Block a user