From 1581c12f8e72219754fcacd0df7fa676eebd9321 Mon Sep 17 00:00:00 2001 From: Guillaume Seguin Date: Tue, 7 Aug 2012 10:58:28 +0200 Subject: [PATCH] Only run final command if one is set --- pronterface.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pronterface.py b/pronterface.py index 85bbccb..780432e 100755 --- a/pronterface.py +++ b/pronterface.py @@ -192,8 +192,10 @@ class PronterWindow(wx.Frame,pronsole.pronsole): wx.CallAfter(self.pausebtn.Disable) wx.CallAfter(self.printbtn.SetLabel,_("Print")) - import shlex param = self.settings.final_command + if not param: + return + import shlex pararray=[i.replace("$s",str(self.filename)).replace("$t", format_time(int(time.time()-self.starttime+self.extra_print_time))).encode() for i in shlex.split(param.replace("\\","\\\\").encode())] self.finalp=subprocess.Popen(pararray,stderr=subprocess.STDOUT,stdout=subprocess.PIPE)