diff options
author | Yves Fischer <yvesf-git@xapek.org> | 2013-01-11 20:01:09 +0100 |
---|---|---|
committer | Yves Fischer <yvesf-git@xapek.org> | 2013-01-11 20:01:09 +0100 |
commit | 934d642b410d75dae1966c993fc61c371959876e (patch) | |
tree | ca9bcd22d98d88424be0d21d6387ddba779a9daa /datastore/store/processor.py | |
parent | 69fbdff8e8ba69034111038ce01184ef5472728a (diff) | |
download | ebus-alt-934d642b410d75dae1966c993fc61c371959876e.tar.gz ebus-alt-934d642b410d75dae1966c993fc61c371959876e.zip |
datastore
Diffstat (limited to 'datastore/store/processor.py')
-rw-r--r-- | datastore/store/processor.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/datastore/store/processor.py b/datastore/store/processor.py new file mode 100644 index 0000000..9d39d9a --- /dev/null +++ b/datastore/store/processor.py @@ -0,0 +1,16 @@ +class IProcessor: + def __init__(self): raise NotImplementedError() + def process(self, name, timestamp, data, controller): pass + +class CountingProcessor(IProcessor): + def __init__(self, destination): + self.destination = destination + + def process(self,name,timestamp,data,controller): + current = controller.get(self.destination,None) + if not current: + current = 0 + current = int(current) + + controller.put(self.destination, timestamp, current + 1) + |