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

Cli

parent 9bd139d8
2 merge requests!25Merge v0.2 changes into v0.3,!23Cli
...@@ -13,7 +13,12 @@ def test(component, params, thickness, display=False, display3D=False): ...@@ -13,7 +13,12 @@ def test(component, params, thickness, display=False, display3D=False):
f = getComponent(component) f = getComponent(component)
if params is not None: if params is not None:
for p in params: 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: if thickness is None:
t = 0 t = 0
j = None j = None
...@@ -23,8 +28,7 @@ def test(component, params, thickness, display=False, display3D=False): ...@@ -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) f.makeOutput("output/" + component, display=display, display3D=display3D, thickness=t, joint=j)
def cli_argparse():
if __name__ == '__main__':
LOG_LEVELS = ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"] LOG_LEVELS = ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]
DEFAULT_LOG_LEVEL = "WARNING" DEFAULT_LOG_LEVEL = "WARNING"
...@@ -113,3 +117,6 @@ if __name__ == '__main__': ...@@ -113,3 +117,6 @@ if __name__ == '__main__':
if not acted: if not acted:
parser.print_help(sys.stderr) parser.print_help(sys.stderr)
sys.exit(1) sys.exit(1)
if __name__ == '__main__':
cli_argparse()
\ No newline at end of file
...@@ -52,4 +52,9 @@ setup( ...@@ -52,4 +52,9 @@ setup(
'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)', 'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)',
'Programming Language :: Python :: 3', '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