mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 14:50:25 +01:00
fix: handling for exceptional cases in sfcf_read improved
This commit is contained in:
parent
75111b07ff
commit
b0e98de083
1 changed files with 2 additions and 2 deletions
|
@ -112,12 +112,12 @@ def read_sfcf(path, prefix, name, quarks='.*', noffset=0, wf=0, wf2=0,
|
|||
else:
|
||||
ls.extend(filenames)
|
||||
break
|
||||
if not ls:
|
||||
raise Exception('Error, directory not found')
|
||||
# Exclude folders with different names
|
||||
for exc in ls:
|
||||
if not fnmatch.fnmatch(exc, prefix + '*'):
|
||||
ls = list(set(ls) - set([exc]))
|
||||
if not ls:
|
||||
raise Exception('No matching directories found.')
|
||||
if len(ls) > 1:
|
||||
ls.sort(key=lambda x: int(re.findall(r'\d+', x[len(prefix):])[0]))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue