# HG changeset patch # User Sandro Knauß # Date 1288904271 -3600 # Node ID 97ef6ca145e632a9c0248f6f003f113abd54e8e4 # Parent 3718abbfffd632a25be0a9c3c326ba53636bcaaf sms & fax gefixt diff -r 3718abbfffd6 -r 97ef6ca145e6 iro/anbieter/content.py --- a/iro/anbieter/content.py Wed Nov 03 01:19:26 2010 +0100 +++ b/iro/anbieter/content.py Thu Nov 04 21:57:51 2010 +0100 @@ -25,20 +25,24 @@ return self.content class SMS(content): - def __init__(self,cont): - content.__init__(self,cont) - - def sendto(self,anbieter,recipients): - anbieter.sendSMS(self,recipients) + def __init__(self, cont): + content.__init__(self,cont) + + def sendto(self,anbieter,recipients): + anbieter.sendSMS(self,recipients) class FAX(content): - def __init__(self,header,cont,attachments): - content.__init__(self,cont) - self.header=header - self.attachments=attachments - - def sendto(self,anbieter,recipients): - anbieter.sendFAX(self,recipients) + def __init__(self,header,cont,attachments): + content.__init__(self,cont) + self.header=header + self.attachments=attachments + + def sendto(self,anbieter,recipients): + anbieter.sendFAX(self,recipients) + + def getAttachment(self,i): + print self.attachments + return self.attachments[i] class Mail(content): def __init__(self, subject, body): diff -r 3718abbfffd6 -r 97ef6ca145e6 iro/iro.py --- a/iro/iro.py Wed Nov 03 01:19:26 2010 +0100 +++ b/iro/iro.py Thu Nov 04 21:57:51 2010 +0100 @@ -95,7 +95,7 @@ pass MyManager.register('SMSJob', SMSJob) - MyManager.register('FAXob', FAXJob) + MyManager.register('FaxJob', FAXJob) MyManager.register('MailJob',MailJob) MyManager.register('Providerlist',Providerlist) MyManager.register('Acounting',Acounting) diff -r 3718abbfffd6 -r 97ef6ca145e6 iro/joblist.py --- a/iro/joblist.py Wed Nov 03 01:19:26 2010 +0100 +++ b/iro/joblist.py Thu Nov 04 21:57:51 2010 +0100 @@ -40,7 +40,7 @@ self.queue.put(job) return id - def newSMS(self,message,recipients,provider="default"): + def newSMS(self, message, recipients, provider="default"): ''' creates a new SMS ''' @@ -51,7 +51,7 @@ ''' creates a new Fax ''' - job=self.manager.FaxJob(self.providerlist, provider,subject, content.FAX(subject, fax),recipients) + job=self.manager.FaxJob(self.providerlist, provider,subject, content.FAX(subject,'' ,fax),recipients) return self.__registerJob__(job) def newMail(self,subject, body,recipients,provider="default"): diff -r 3718abbfffd6 -r 97ef6ca145e6 iro/user.py --- a/iro/user.py Wed Nov 03 01:19:26 2010 +0100 +++ b/iro/user.py Thu Nov 04 21:57:51 2010 +0100 @@ -76,7 +76,7 @@ job.stop() - def startSMS(self,message,recipients,provider="default"): + def startSMS(self, message, recipients, provider="default"): ''' starts the SMS with message to recipients ''' @@ -87,10 +87,11 @@ return id - def startFAX(self,subject, fax,provider="default"): + def startFAX(self, subject, fax, recipients, provider="default"): ''' starts the FAX with the pdf file fax and the subject ''' + logger.debug("startFAX(%s,%s,%s,%s)"%(subject, fax, recipients, provider)) if not "fax" in self.features: raise NotSupportedFeature("fax") id = self.jobqueue.newFAX(subject, fax,recipients,provider)