self.cmdIndex += 1
wx.CallAfter(self.SetTitle, "Building: [%d/%d]" % (self.sliceCmdList.index(action) + 1, len(self.sliceCmdList)))
- p = subprocess.Popen(action, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ p = sliceRun.startSliceCommandProcess(action)
line = p.stdout.readline()
maxValue = 1
while(len(line) > 0):
\r
def loadFile(self, filename):\r
if self.handle == None:\r
- self.handle = subprocess.Popen([sys.executable, sys.argv[0], '-r', filename], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)\r
+ self.handle = subprocess.Popen([sys.executable, sys.argv[0], '-r', filename], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\r
self.thread = threading.Thread(target=self.Monitor)\r
self.thread.start()\r
else:\r
for action in self.actionList:\r
wx.CallAfter(self.SetTitle, "Building: [%d/%d]" % (self.actionList.index(action) + 1, len(self.actionList)))\r
if not action.usePreviousSlice:\r
- p = subprocess.Popen(action.sliceCmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)\r
+ p = sliceRun.startSliceCommandProcess(action.sliceCmd)\r
line = p.stdout.readline()\r
\r
maxValue = 1\r
self.start()
def run(self):
- kwargs = {}
- if subprocess.mswindows:
- su = subprocess.STARTUPINFO()
- su.dwFlags |= subprocess.STARTF_USESHOWWINDOW
- su.wShowWindow = subprocess.SW_HIDE
- kwargs['startupinfo'] = su
- print self.cmdList[self.fileIdx]
- p = subprocess.Popen(self.cmdList[self.fileIdx], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs)
+ p = sliceRun.startSliceCommandProcess(self.cmdList[self.fileIdx])
line = p.stdout.readline()
self.progressLog = []
maxValue = 1
cmd.append(filename)
return cmd
+def startSliceCommandProcess(cmdList):
+ kwargs = {}
+ if subprocess.mswindows:
+ su = subprocess.STARTUPINFO()
+ su.dwFlags |= subprocess.STARTF_USESHOWWINDOW
+ su.wShowWindow = subprocess.SW_HIDE
+ kwargs['startupinfo'] = su
+ p = subprocess.Popen(cmdList, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs)