Adapt import functions to use logical paths

This commit is contained in:
D. Berge
2023-08-30 14:56:09 +02:00
parent ccf4bbf547
commit 53f2108e37
6 changed files with 60 additions and 45 deletions

View File

@@ -4,9 +4,10 @@ import sps
Preplot importing functions.
"""
def from_file (file):
def from_file (file, realpath = None):
filepath = realpath or file["path"]
if not "type" in file or file["type"] == "sps":
records = sps.from_file(file["path"], file["format"] if "format" in file else None )
records = sps.from_file(filepath, file["format"] if "format" in file else None )
else:
return "Not an SPS file"