mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
debug windows paths
This commit is contained in:
1 parent
af30fde81a
commit
3cd6d31731
4 files changed
+36
-14
No files matched your search
+16
-9
@@ -619,14 +619,15 @@ class AdisTSwc(AdisTS):
|
||||
@timer
|
||||
def read_bin(self, study, repertory, results, qlog=None, name="0"):
|
||||
|
||||
repertory_results = os.path.join(repertory, "resultats")
|
||||
filelist = [f for f in os.listdir(repertory_results) if os.path.isfile(os.path.join(repertory_results, f))]
|
||||
filelist = [f for f in os.listdir(repertory)
|
||||
if os.path.isfile(os.path.join(repertory, f))
|
||||
]
|
||||
files_bin_names = [f for f in filelist if f[-4:] == ".bin"]
|
||||
files_bin_names.insert(0, files_bin_names.pop(
|
||||
files_bin_names.index("total_sediment.bin"))
|
||||
)
|
||||
|
||||
ifilename = os.path.join(repertory_results, files_bin_names[0])
|
||||
ifilename = os.path.join(repertory, files_bin_names[0])
|
||||
|
||||
logger.info(f"read_bin: Start reading '{ifilename}' ...")
|
||||
|
||||
@@ -723,7 +724,7 @@ class AdisTSwc(AdisTS):
|
||||
def ip_to_ri(r, i): return i - reach_offset[r]
|
||||
|
||||
path_files = map(lambda file: os.path.join(
|
||||
repertory_results, file), files_bin_names)
|
||||
repertory, file), files_bin_names)
|
||||
|
||||
data_tmp = {}
|
||||
|
||||
@@ -831,8 +832,6 @@ class AdisTSwc(AdisTS):
|
||||
if name is None:
|
||||
name = study.name.replace(" ", "_")
|
||||
|
||||
print("adist ts results repertory: ", repertory)
|
||||
|
||||
results = super(AdisTSwc, self).results(study,
|
||||
repertory,
|
||||
qlog,
|
||||
@@ -850,12 +849,20 @@ class AdisTSwc(AdisTS):
|
||||
|
||||
def rm_previous_results(self, study, repertory, qlog):
|
||||
|
||||
if "resultats" not in os.listdir(repertory):
|
||||
if "resultats" in os.listdir(repertory):
|
||||
repertory_results = os.path.join(repertory, "resultats")
|
||||
else:
|
||||
repertory_results = os.path.normpath(repertory)
|
||||
|
||||
if not os.path.isdir(repertory_results):
|
||||
return
|
||||
|
||||
repertory_results = os.path.join(repertory, "resultats")
|
||||
filelist = [f for f in os.listdir(repertory_results) if os.path.isfile(os.path.join(repertory_results, f))]
|
||||
filelist = [f for f in os.listdir(repertory_results)
|
||||
if os.path.isfile(os.path.join(repertory_results, f))
|
||||
]
|
||||
files_bin_names = [f for f in filelist if f[-4:] == ".bin"]
|
||||
if len(files_bin_names) < 1:
|
||||
return
|
||||
|
||||
for el in files_bin_names:
|
||||
os.remove(os.path.join(repertory_results, el))
|
||||
|
||||
Reference in new issue
Block a user