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/channel.py | |
parent | 69fbdff8e8ba69034111038ce01184ef5472728a (diff) | |
download | ebus-alt-934d642b410d75dae1966c993fc61c371959876e.tar.gz ebus-alt-934d642b410d75dae1966c993fc61c371959876e.zip |
datastore
Diffstat (limited to 'datastore/store/channel.py')
-rw-r--r-- | datastore/store/channel.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/datastore/store/channel.py b/datastore/store/channel.py new file mode 100644 index 0000000..2a5d5f4 --- /dev/null +++ b/datastore/store/channel.py @@ -0,0 +1,25 @@ +class IChannel: + def __init__(self): raise NotImplementedError() + def add(self,timestamp,data,controller): pass + def get(self,query): pass + +class PrinterChannel(IChannel): + def __init__(self,name): + self.name = name + def add(self,timestamp,data,controller): + print "{0}: {1},{2}".format(self.name, timestamp, data) + +class SimpleMemoryChannel(IChannel): + def __init__(self): + self.data = "" + def add(self,timestamp,data,controller): + self.data = data + def get(self,query): + return str(self.data) + +class IntervalStoreChannel(IChannel): + SECONDS=1000 + MINUTES=60*1000 + HOURS=60*60*1000 + DAYS=24*60*60*1000 + def __init__(self): pass |