From 932e2cd41668d239ca249dd534b665c69ed14b29 Mon Sep 17 00:00:00 2001 From: Florent Date: Sun, 12 Feb 2012 00:51:53 +0100 Subject: [PATCH] Add a new capabilitie to display information about a gauge Signed-off-by: Florent Signed-off-by: Romain Bignon --- weboob/capabilities/gauge.py | 63 ++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 weboob/capabilities/gauge.py diff --git a/weboob/capabilities/gauge.py b/weboob/capabilities/gauge.py new file mode 100644 index 00000000..bb2f078d --- /dev/null +++ b/weboob/capabilities/gauge.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- + +# Copyright(C) 2010 Romain Bignon, Florent Fourcot +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +from datetime import datetime +from .base import IBaseCap, CapBaseObject + + +__all__ = ['ICapWaterLevel'] + + +class Gauge(CapBaseObject): + def __init__(self, id): + CapBaseObject.__init__(self, id) + + self.add_field('name', basestring) + self.add_field('river', basestring) + self.add_field('level', float) + self.add_field('flow', float) + self.add_field('lastdate', datetime) + self.add_field('forecast', basestring) + +class GaugeHistory(CapBaseObject): + def __init__(self): + CapBaseObject.__init__(self, None) + + self.add_field('level', float) + self.add_field('flow', float) + self.add_field('date', datetime) + + +class ICapWaterLevel(IBaseCap): + def get_lastlevel(self): + raise NotImplementedError() + + def get_list(self): + raise NotImplementedError() + + def get_history(self, id): + raise NotImplementedError() + + def last(self, id): + raise NotImplementedError() + + def search(self, pattern): + raise NotImplementedError() + + +