Skip to content

Commit 3f7c1c8

Browse files
committed
Merge branch 'development' into feat-use-jnml-from-pyneuroml
2 parents 12f6457 + 064de65 commit 3f7c1c8

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-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: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,22 @@ 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
10+
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+
all_paths = []
20+
21+
for g in glob.glob(path_s):
22+
print('Found path:', g)
23+
all_paths.append(g)
24+
path_s = all_paths
1125

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)
2026

2127
return path_s

0 commit comments

Comments
 (0)