Rename foo* to send*
This commit is contained in:
parent
9ab7c24082
commit
29118f1de1
1 changed files with 6 additions and 5 deletions
11
smstool.py
11
smstool.py
|
@ -8,6 +8,8 @@ SMSLEN = 160
|
||||||
|
|
||||||
class SimserFrame(wxFrame):
|
class SimserFrame(wxFrame):
|
||||||
def __init__(self, parent, id, title):
|
def __init__(self, parent, id, title):
|
||||||
|
|
||||||
|
# Create GUI
|
||||||
wxFrame.__init__(self, parent, id, title,
|
wxFrame.__init__(self, parent, id, title,
|
||||||
wxPoint(100, 100), wxSize(450, 70))
|
wxPoint(100, 100), wxSize(450, 70))
|
||||||
|
|
||||||
|
@ -29,10 +31,10 @@ class SimserFrame(wxFrame):
|
||||||
wxDLG_PNT(panel, wxPoint(30, 20)),
|
wxDLG_PNT(panel, wxPoint(30, 20)),
|
||||||
wxDLG_SZE(panel, wxSize(60, -1)))
|
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_PNT(panel, wxPoint(100, 20)),
|
||||||
wxDLG_SZE(panel, wxSize(30, -1)))
|
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),
|
self.zaehler = wxStaticText(panel, -1, str(SMSLEN),
|
||||||
wxDLG_PNT(panel, wxPoint(150, 20)), wxDefaultSize)
|
wxDLG_PNT(panel, wxPoint(150, 20)), wxDefaultSize)
|
||||||
|
@ -42,7 +44,7 @@ class SimserFrame(wxFrame):
|
||||||
def OnCloseWindow(self, event):
|
def OnCloseWindow(self, event):
|
||||||
self.Destroy()
|
self.Destroy()
|
||||||
|
|
||||||
def OnFooClick(self, event):
|
def OnSendClick(self, event):
|
||||||
text = self.textCtrl.GetValue()
|
text = self.textCtrl.GetValue()
|
||||||
nr = self.nrCtrl.GetValue()
|
nr = self.nrCtrl.GetValue()
|
||||||
|
|
||||||
|
@ -50,6 +52,7 @@ class SimserFrame(wxFrame):
|
||||||
text = sub("'", "''", text)
|
text = sub("'", "''", text)
|
||||||
nr = sub("'", "''", nr)
|
nr = sub("'", "''", nr)
|
||||||
|
|
||||||
|
# Send SMS and report back
|
||||||
rc = system("echo '" + text + "' | gsmsendsms '" + nr + "'")
|
rc = system("echo '" + text + "' | gsmsendsms '" + nr + "'")
|
||||||
if(rc == 0):
|
if(rc == 0):
|
||||||
self.foodialog = wxMessageDialog(self.panel,
|
self.foodialog = wxMessageDialog(self.panel,
|
||||||
|
@ -60,8 +63,6 @@ class SimserFrame(wxFrame):
|
||||||
"gsmsendsms returned error code: " + str(rc >> 8),
|
"gsmsendsms returned error code: " + str(rc >> 8),
|
||||||
"Error", wxOK, wxPoint(100, 100))
|
"Error", wxOK, wxPoint(100, 100))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
self.foodialog.Show(true)
|
self.foodialog.Show(true)
|
||||||
|
|
||||||
def OnChange(self, event):
|
def OnChange(self, event):
|
||||||
|
|
Reference in a new issue