Skip to content

Commit 250bb34

Browse files
committed
[doc/thgttg] Update create example file code
1 parent fb86363 commit 250bb34

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

doc/example_odMLs/thgttg.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,22 @@
77
@author: zehl
88
"""
99

10+
import datetime
11+
import os
12+
import odml
1013
import sys
14+
15+
1116
if len(sys.argv) != 2:
12-
print("You have to provide the absolute path to the odml-python module ",
13-
"your command line.")
14-
else:
15-
odml_pythonpath = sys.argv[-1]
16-
sys.path.append(odml_pythonpath)
17+
print("Please provide an existing directory for the example odml file.")
18+
quit()
1719

18-
import os
19-
import odml
20-
import datetime
20+
output_directory = sys.argv[-1]
21+
if not os.path.isdir(output_directory):
22+
print("Please provide an existing directory for the example odml file.")
23+
quit()
2124

25+
save_to = os.path.join(output_directory, "THGTTG.odml")
2226

2327
odmlrepo = 'http://portal.g-node.org/odml/terminologies/v1.0/terminologies.xml'
2428

@@ -304,7 +308,5 @@
304308
dtype=odml.DType.string,
305309
definition="Manufacturer of robots"))
306310

307-
save_to = os.path.join(odml_pythonpath, "doc", "example_odMLs", "THGTTG.odml")
308-
309311
odml.save(doc, save_to)
310312

0 commit comments

Comments
 (0)