Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
eokyere committed Jun 23, 2011
1 parent fef3680 commit 99e98d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions gsm/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ def __init__(self, devices_dict):
def add_handler(self, handler):
self.handlers.append(handler)

def send(self, number=None, text=None, ussd=None, modem=DEFAULT):
def send(self, number=None, text=None, ussd=None, modem_id=DEFAULT):
if number and text:
self.get_modem(modem).send(number, text)
self.get_modem(modem_id).send(number, text)
elif ussd:
self.get_modem(modem).send(ussd=ussd)
self.get_modem(modem_id).send(ussd=ussd)
else:
raise 'Invalid'

Expand Down
3 changes: 1 addition & 2 deletions smsapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ def main():

p = optparse.OptionParser()
p.add_option('--port', '-p', default=None)
p.add_option('--clear_messages', '-c', default=None)
options, arguments = p.parse_args()

modems, gateway = bootstrap(options)
gateway.start()
app = Application(gateway)
app.send(ussd='*133#')
app.send(modem_id='Airtel', ussd='*133#')
# scheduler = setup_random_messages(app)
# scheduler.start()
# app.send('432', '2u 0263119161 0.5 1234')
Expand Down

0 comments on commit 99e98d2

Please sign in to comment.