Fix support for slicing if running from pythonw.exe

master
daid303 2012-10-01 18:15:51 +02:00
parent 0dc413cd16
commit 9675968b27
5 changed files with 12 additions and 11 deletions

View File

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

View File

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

View File

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

View File

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

View File

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