sms & fax gefixt
authorSandro Knauß <knauss@netzguerilla.net>
Thu, 04 Nov 2010 21:57:51 +0100
changeset 57 97ef6ca145e6
parent 56 3718abbfffd6
child 58 fb161058bcab
sms & fax gefixt
iro/anbieter/content.py
iro/iro.py
iro/joblist.py
iro/user.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):
--- 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)
--- 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"):
--- 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)