moved ICapDating.get_status() and ICapMessagesPost.get_status() into ICapAccount.get_account_status()

This commit is contained in:
Romain Bignon 2010-11-20 20:42:50 +01:00
commit c83c923e3d
8 changed files with 72 additions and 64 deletions

View file

@ -32,8 +32,21 @@ class Account(CapBaseObject):
self.add_field('password', basestring)
self.add_field('properties', dict)
class StatusField(object):
FIELD_TEXT = 0x001 # the value is a long text
FIELD_HTML = 0x002 # the value is HTML formated
def __init__(self, key, label, value, flags=0):
self.key = key
self.label = label
self.value = value
self.flags = flags
class ICapAccount(IBaseCap):
ACCOUNT_REGISTER_PROPERTIES = []
# This class constant may be a list of Value* objects. If the value remains
# None, weboob considers that register_account() isn't supported.
ACCOUNT_REGISTER_PROPERTIES = None
@staticmethod
def register_account(account):
@ -64,3 +77,11 @@ class ICapAccount(IBaseCap):
Update the current account.
"""
raise NotImplementedError()
def get_account_status(self):
"""
Get status of the current account.
@return a list of fields
"""
raise NotImplementedError()

View file

@ -45,24 +45,7 @@ class Optimization(object):
def set_config(self, params):
raise NotImplementedError()
class StatusField(object):
FIELD_TEXT = 0x001 # the value is a long text
FIELD_HTML = 0x002 # the value is HTML formated
def __init__(self, key, label, value, flags=0):
self.key = key
self.label = label
self.value = value
self.flags = flags
class ICapDating(IBaseCap):
def get_status(self):
"""
Get a list of fields
"""
raise NotImplementedError()
def init_optimizations(self):
raise NotImplementedError()

View file

@ -117,13 +117,6 @@ class Thread(CapBaseObject):
yield m
class StatusField(object):
def __init__(self, key, label, value):
self.key = key
self.label = label
self.value = value
class ICapMessages(IBaseCap):
def iter_threads(self):
"""
@ -162,12 +155,6 @@ class CantSendMessage(Exception):
pass
class ICapMessagesPost(IBaseCap):
def get_status(self):
"""
Get a list of fields
"""
raise NotImplementedError()
def post_message(self, message):
"""
Post a message.