Skip to content
Snippets Groups Projects
Commit 64644e62 authored by mehtank's avatar mehtank
Browse files

Cli

parent 9bd139d8
No related merge requests found
......@@ -13,7 +13,12 @@ def test(component, params, thickness, display=False, display3D=False):
f = getComponent(component)
if params is not None:
for p in params:
f.setParameter(p[0], eval(str(p[1])))
try:
v = eval(str(p[1]))
except NameError:
# Using a string as a dimensions parameter
v = str(p[1])
f.setParameter(p[0], v)
if thickness is None:
t = 0
j = None
......@@ -23,8 +28,7 @@ def test(component, params, thickness, display=False, display3D=False):
f.makeOutput("output/" + component, display=display, display3D=display3D, thickness=t, joint=j)
if __name__ == '__main__':
def cli_argparse():
LOG_LEVELS = ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]
DEFAULT_LOG_LEVEL = "WARNING"
......@@ -113,3 +117,6 @@ if __name__ == '__main__':
if not acted:
parser.print_help(sys.stderr)
sys.exit(1)
if __name__ == '__main__':
cli_argparse()
\ No newline at end of file
......@@ -52,4 +52,9 @@ setup(
'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)',
'Programming Language :: Python :: 3',
],
entry_points={
'console_scripts': [
'roco = rocolib.__main__:cli_argparse',
]
},
)
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment