Skip to content

Commit 6d0f58a

Browse files
committed
Fix to finding multiple files to validate in omv files
1 parent 75fd39b commit 6d0f58a

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

omv/engines/jneuromlvalidate.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ def run(self):
2828
path_s = resolve_paths(self.modelpath)
2929

3030
inform(
31-
"Path [%s] expanded to: %s" % (self.modelpath, path_s),
31+
"Path [%s] expanded to: \n %s" % (self.modelpath, '\n '.join(path_s)),
3232
indent=1,
3333
verbosity=1,
3434
)
35+
if len(path_s) == 0:
36+
raise EngineExecutionError(
37+
"Could not determine list of files for validation from string: %s" % self.modelpath
38+
)
3539

3640
from omv.engines.jneuroml import JNeuroMLEngine
3741

omv/engines/utils/__init__.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ def resolve_paths(path_s):
66
Make explicit list from: '*.nml myfile.xml' etc.
77
"""
88

9-
if "*" in path_s:
10-
import glob
9+
import glob
1110

12-
if PATH_DELIMITER in path_s:
13-
all_paths = []
14-
for p in path_s.split(PATH_DELIMITER):
15-
for g in glob.glob(p):
16-
all_paths.append(g)
17-
path_s = all_paths
18-
else:
19-
path_s = glob.glob(path_s)
11+
if PATH_DELIMITER in path_s:
12+
all_paths = []
13+
for p in path_s.split(PATH_DELIMITER):
14+
for g in glob.glob(p):
15+
print('Found path:', g)
16+
all_paths.append(g)
17+
path_s = all_paths
18+
else:
19+
path_s = resolve_paths(glob.glob(path_s))
2020

2121
return path_s

0 commit comments

Comments
 (0)