From 173d4a16d8323d00f340973e9354aaff978b9314 Mon Sep 17 00:00:00 2001 From: neingeist Date: Sun, 4 Nov 2007 23:58:14 +0000 Subject: [PATCH] Fix for gnokii --- smstool.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/smstool.py b/smstool.py index 67555cf..c57e3ae 100644 --- a/smstool.py +++ b/smstool.py @@ -79,19 +79,25 @@ class SimserFrame(wxFrame): self.foodialog.Show(true) return + # Remove funny characters + nr = re.sub("\(", "", nr) + nr = re.sub("\)", "", nr) + nr = re.sub(" ", "", nr) + # Quote text text = re.sub("'", "''", text) nr = re.sub("'", "''", nr) # Send SMS and report back - rc = os.system("echo '" + text + "' | gsmsendsms '" + nr + "'") + #rc = os.system("echo '" + text + "' | gsmsendsms '" + nr + "'") + rc = os.system("echo '" + text + "' | gnokii --sendsms '" + nr + "'") if(rc == 0): self.foodialog = wxMessageDialog(self.panel, "Message sent to " + nr, "Success", wxOK, wxPoint(100, 100)) else: self.foodialog = wxMessageDialog(self.panel, - "gsmsendsms returned error code: " + str(rc >> 8), + "returned error code: " + str(rc >> 8), "Error", wxOK, wxPoint(100, 100)) self.foodialog.Show(true)