commit | dda86d3e445aebd6d00b0d309d9239a7dd343122 | [log] [tgz] |
---|---|---|
author | koder aka kdanilov <kdanilov@mirantis.com> | Mon Mar 16 11:20:04 2015 +0200 |
committer | koder aka kdanilov <kdanilov@mirantis.com> | Mon Mar 16 11:20:04 2015 +0200 |
tree | 605c1c77b34071c704d364c4ad1e92b754d8df0f | |
parent | ce5444fbe4582364658860ce17c79fc47b931f06 [diff] [blame] |
new sensor manage code
diff --git a/sensors/discover.py b/sensors/discover.py new file mode 100644 index 0000000..f227043 --- /dev/null +++ b/sensors/discover.py
@@ -0,0 +1,9 @@ +all_sensors = {} + + +def provides(sensor_class_name): + def closure(func): + assert sensor_class_name not in all_sensors + all_sensors[sensor_class_name] = func + return func + return closure