Closed aabadie closed 8 years ago
I'm doing it right now with code in cli-tools to prevent code duplication.
Do you plan to create cli-tools own exception and catch them in each main functions ? This seems a clean solution but maybe you have a better idea.
I just catch the exception with the same context manager which prints the error and exits:
In cli-tools: https://github.com/iot-lab/cli-tools/compare/2.1.0 Aggregation-tools: https://github.com/iot-lab/aggregation-tools/compare/1.5.0
If you have any suggestions.
Currently to run aggregation-tools tests using tox, this patch should also be applied
diff --git a/tox.ini b/tox.ini
index 548783d..5bc1c8f 100644
--- a/tox.ini
+++ b/tox.ini
@@ -16,7 +16,7 @@ commands=
[testenv]
deps=
- git+git://github.com/iot-lab/cli-tools.git#egg=iotlabcli
+ git+git://github.com/iot-lab/cli-tools.git@2.1.0#egg=iotlabcli
-rtests_utils/test-requirements.txt
py26,py32: -rtests_utils/pylint-python-2.6_3.2.txt
commands=
I'm using sys.exit
that breaks the execution, a cleaner exception management might be better for the organization.
Your changes are really nice. I'll close this PR.
The fix uses the same strategy used with the cli-tools.