From 221daf0363ca1af7c93cdc6bd17e5635443d44c2 Mon Sep 17 00:00:00 2001 From: neingeist Date: Sat, 11 Jun 2005 14:06:13 +0000 Subject: [PATCH] Rename foo* to send* --- smstool.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/smstool.py b/smstool.py index 4176d0e..e1a16b2 100644 --- a/smstool.py +++ b/smstool.py @@ -8,6 +8,8 @@ SMSLEN = 160 class SimserFrame(wxFrame): def __init__(self, parent, id, title): + + # Create GUI wxFrame.__init__(self, parent, id, title, wxPoint(100, 100), wxSize(450, 70)) @@ -29,10 +31,10 @@ class SimserFrame(wxFrame): wxDLG_PNT(panel, wxPoint(30, 20)), wxDLG_SZE(panel, wxSize(60, -1))) - self.fooCtrl = wxButton(panel, 10, "Senden", + self.sendCtrl = wxButton(panel, 10, "Senden", wxDLG_PNT(panel, wxPoint(100, 20)), wxDLG_SZE(panel, wxSize(30, -1))) - EVT_BUTTON(self, 10, self.OnFooClick) + EVT_BUTTON(self, 10, self.OnSendClick) self.zaehler = wxStaticText(panel, -1, str(SMSLEN), wxDLG_PNT(panel, wxPoint(150, 20)), wxDefaultSize) @@ -42,7 +44,7 @@ class SimserFrame(wxFrame): def OnCloseWindow(self, event): self.Destroy() - def OnFooClick(self, event): + def OnSendClick(self, event): text = self.textCtrl.GetValue() nr = self.nrCtrl.GetValue() @@ -50,6 +52,7 @@ class SimserFrame(wxFrame): text = sub("'", "''", text) nr = sub("'", "''", nr) + # Send SMS and report back rc = system("echo '" + text + "' | gsmsendsms '" + nr + "'") if(rc == 0): self.foodialog = wxMessageDialog(self.panel, @@ -59,8 +62,6 @@ class SimserFrame(wxFrame): self.foodialog = wxMessageDialog(self.panel, "gsmsendsms returned error code: " + str(rc >> 8), "Error", wxOK, wxPoint(100, 100)) - - self.foodialog.Show(true)