Only run final command if one is set

master
Guillaume Seguin 2012-08-07 10:58:28 +02:00
parent 17e8436436
commit 1581c12f8e
1 changed files with 3 additions and 1 deletions

View File

@ -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)