From 42d38f42f1ca52ceb50f21f0de6ba66d8450aeb9 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Sat, 11 Feb 2012 12:47:16 +0100 Subject: [PATCH] add capability CapHousing --- weboob/capabilities/housing.py | 64 ++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 weboob/capabilities/housing.py diff --git a/weboob/capabilities/housing.py b/weboob/capabilities/housing.py new file mode 100644 index 00000000..f1e3f981 --- /dev/null +++ b/weboob/capabilities/housing.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- + +# Copyright(C) 2012 Romain Bignon +# +# This file is part of weboob. +# +# weboob is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# weboob 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with weboob. If not, see . + + +from datetime import date + +from .base import IBaseCap, CapBaseObject + + +__all__ = ['ICapHousing'] + + +class Housing(CapBaseObject): + def __init__(self, id): + CapBaseObject.__init__(self, id) + self.add_field('title', basestring) + self.add_field('area', int) + self.add_field('cost', int) + self.add_field('currency', basestring) + self.add_field('date', date) + self.add_field('location', basestring) + self.add_field('station', basestring) + self.add_field('text', basestring) + self.add_field('phone', basestring) + +class Query(CapBaseObject): + def __init__(self): + CapBaseObject.__init__(self, '') + self.add_field('cities', (list,tuple)) + self.add_field('area_min', int) + self.add_field('area_max', int) + self.add_field('cost_min', int) + self.add_field('cost_max', int) + +class City(CapBaseObject): + def __init__(self, id): + CapBaseObject.__init__(self, id) + self.add_field('name', basestring) + +class ICapHousing(IBaseCap): + def search_housings(self, query): + raise NotImplementedError() + + def get_housing(self, housing): + raise NotImplementedError() + + def search_city(self, pattern): + raise NotImplementedError()