Permalink
Browse files

Renamed SmsDriver.send() to SmsDriver.sendOne()

  • Loading branch information...
1 parent 7c94d3e commit 794982a43d2be474401ab499fa99f5fcbd41962d @mludvig committed Feb 17, 2012
Showing with 6 additions and 7 deletions.
  1. +2 −2 Sms/Engines/Clickatell.py
  2. +2 −1 Sms/Engines/GenericHttp.py
  3. +0 −3 Sms/GenericSmsDriver.py
  4. +2 −1 Sms/Sender.py
@@ -9,8 +9,8 @@
class SmsDriver(GenericHttp.SmsDriver):
url_pattern = "https://api.clickatell.com/http/sendmsg?api_id=%(api_id)s&user=%(user)s&password=%(password)s&to=%(recipient)s&text=%(message)s"
- def send(self, message, recipient):
- ret = GenericHttp.SmsDriver.send(self, message, recipient)
+ def sendOne(self, message, recipient):
+ ret = GenericHttp.SmsDriver.sendOne(self, message, recipient)
arr = ret.split("\n")[0].split(" ", 1)
if arr[0].startswith("ID"):
info("SMS(Clickatell) sent to %s with ID: %s" % (recipient, arr[1]))
@@ -20,7 +20,7 @@ def __init__(self, options):
except KeyError, e:
raise SmsConfigError("GenericHttp driver requires 'url_pattern' option")
- def send(self, message, recipient):
+ def sendOne(self, message, recipient):
all_options = { 'message' : urllib.quote(message), 'recipient' : recipient }
all_options.update(self.options)
url = self.url_pattern % all_options
@@ -31,6 +31,7 @@ def send(self, message, recipient):
raise SmsError("HTTP Return code = %d" % u.code)
ret_data = u.read()
debug("GenericHttp: ret_data: %s" % ret_data)
+ raise
return ret_data
# vim: et:sw=4:sts=4:sta:ai:
View
@@ -13,7 +13,4 @@ def set_options(self, options):
debug("Setting options to: %r" % options)
self.options = options
- def send(self, message, recipient):
- raise SmsConfigError("GenericSmsDriver is not intended for direct use")
-
# vim:et:ts=4:sts=4:ai
View
@@ -41,8 +41,9 @@ def send(self, message = None, recipients = []):
try:
self._driver.sendMulti(message, recipients)
except AttributeError:
+ raise
for recipient in recipients:
- self._driver.send(message, recipient)
+ self._driver.sendOne(message, recipient)
except SmsError, e:
error(str(e))
return False

0 comments on commit 794982a

Please sign in to comment.