From 430ef6cb25559aa31ba24730b659e84d0639074a Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Mon, 15 Nov 2010 13:21:58 +0100 Subject: [PATCH] new method 'send_query' in ICapContact --- weboob/capabilities/contact.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/weboob/capabilities/contact.py b/weboob/capabilities/contact.py index 60e8395c..0775fc82 100644 --- a/weboob/capabilities/contact.py +++ b/weboob/capabilities/contact.py @@ -76,6 +76,14 @@ class Contact(CapBaseObject): for key, value in kwargs.iteritems(): setattr(photo, key, value) +class QueryError(Exception): + pass + +class Query(CapBaseObject): + def __init__(self, id, message): + CapBaseObject.__init__(self, id) + self.add_field('message', basestring, message) + class ICapContact(IBaseCap): def iter_contacts(self, status=Contact.STATUS_ALL, ids=None): """ @@ -104,3 +112,13 @@ class ICapContact(IBaseCap): return l[0] except IndexError: return None + + def send_query(self, id): + """ + Send a query to a contact + + @param id the ID of contact + @return a Query object + @except QueryError + """ + raise NotImplementedError()