diff -r e6af45edff5a -r 07ee5543751b iro/offer/smstrade.py --- a/iro/offer/smstrade.py Thu Feb 23 16:56:25 2012 +0100 +++ b/iro/offer/smstrade.py Thu Feb 23 16:57:57 2012 +0100 @@ -16,7 +16,7 @@ import copy from functools import partial -from ..error import UnknownOption, NeededOption +from ..config import Option from ..model.status import Status from .provider import Provider, providers @@ -82,25 +82,10 @@ def __init__(self, name, config): self.url = "https://gateway.smstrade.de" Provider.__init__(self,name,config,{"sms":["basic","economy","gold","direct"]}) - - def loadConfig(self): - """Read options from config""" - needed=["key"] - - for n in needed: - setattr(self,n,None) - - for (n, v) in self.config: - if n in needed: - setattr(self,n,v) - else: - raise UnknownOption(self.name, n) - - for n in needed: - if getattr(self,n) is None: - raise NeededOption(self.name, n) - - + self.options.update({ + "key":Option(lambda x,y:x,long="smstrade Gateway Key https://login.smstrade.de/index.php?gateway", must=True) + }) + self.loadConfig() def send(self, route, sms, recipient): """send SMS with $sms to $recipients"""