From 347124df572bc875b6790c2fc99f59bc567ef1bc Mon Sep 17 00:00:00 2001 From: kliment Date: Sat, 11 Jun 2011 23:03:01 +0200 Subject: [PATCH] Safer string handling. --- pronsole.py | 2 +- pronterface.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pronsole.py b/pronsole.py index bf98970..01f742e 100644 --- a/pronsole.py +++ b/pronsole.py @@ -858,5 +858,5 @@ if __name__=="__main__": interp.cmdloop() except: interp.p.disconnect() - raise + #raise diff --git a/pronterface.py b/pronterface.py index 0ffb7ed..5979e5c 100644 --- a/pronterface.py +++ b/pronterface.py @@ -118,7 +118,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): def do_settemp(self,l=""): try: if not (l.__class__=="".__class__ or l.__class__==u"".__class__) or (not len(l)): - l=self.htemp.GetValue().split()[0] + l=str(self.htemp.GetValue().split()[0]) l=l.lower().replace(",",".") for i in self.temps.keys(): l=l.replace(i,self.temps[i]) @@ -138,7 +138,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): def do_bedtemp(self,l=""): try: if not (l.__class__=="".__class__ or l.__class__==u"".__class__) or (not len(l)): - l=self.btemp.GetValue().split()[0] + l=str(self.btemp.GetValue().split()[0]) l=l.lower().replace(",",".") for i in self.bedtemps.keys(): l=l.replace(i,self.bedtemps[i]) @@ -323,7 +323,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): if not len(command): return wx.CallAfter(self.logbox.AppendText,">>>"+command+"\n") - self.onecmd(command) + self.onecmd(str(command)) def statuschecker(self): try: @@ -543,7 +543,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): return dlg=wx.TextEntryDialog(self,"Enter a target filename in 8.3 format:","Pick SD filename",dosify(self.filename)) if dlg.ShowModal()==wx.ID_OK: - self.p.send_now("M28 "+dlg.GetValue()) + self.p.send_now("M28 "+str(dlg.GetValue())) self.recvlisteners+=[self.uploadtrigger] pass @@ -578,7 +578,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): except: pass if self.serialport.GetValue()!="": - port=self.serialport.GetValue() + port=str(self.serialport.GetValue()) baud=115200 try: baud=int(self.baud.GetValue())