Fix support for slicing if running from pythonw.exe
parent
0dc413cd16
commit
9675968b27
|
@ -187,7 +187,7 @@ class BatchSliceProgressWindow(wx.Frame):
|
|||
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):
|
||||
|
|
|
@ -38,7 +38,7 @@ class printProcessMonitor():
|
|||
|
||||
def loadFile(self, filename):
|
||||
if self.handle == None:
|
||||
self.handle = subprocess.Popen([sys.executable, sys.argv[0], '-r', filename], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
self.handle = subprocess.Popen([sys.executable, sys.argv[0], '-r', filename], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
self.thread = threading.Thread(target=self.Monitor)
|
||||
self.thread.start()
|
||||
else:
|
||||
|
|
|
@ -939,7 +939,7 @@ class ProjectSliceProgressWindow(wx.Frame):
|
|||
for action in self.actionList:
|
||||
wx.CallAfter(self.SetTitle, "Building: [%d/%d]" % (self.actionList.index(action) + 1, len(self.actionList)))
|
||||
if not action.usePreviousSlice:
|
||||
p = subprocess.Popen(action.sliceCmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
p = sliceRun.startSliceCommandProcess(action.sliceCmd)
|
||||
line = p.stdout.readline()
|
||||
|
||||
maxValue = 1
|
||||
|
|
|
@ -135,14 +135,7 @@ class WorkerThread(threading.Thread):
|
|||
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
|
||||
|
|
|
@ -178,3 +178,11 @@ def getSliceCommand(filename):
|
|||
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)
|
||||
|
|
Loading…
Reference in New Issue