--- a/ProjectDjango/DjangoDialog.py Sun Oct 13 18:31:28 2013 +0200 +++ b/ProjectDjango/DjangoDialog.py Fri Oct 25 18:50:04 2013 +0200 @@ -96,7 +96,8 @@ def __finish(self): """ - Private slot called when the process finished or the user pressed the button. + Private slot called when the process finished or the user pressed the + button. """ if self.proc is not None and \ self.proc.state() != QProcess.NotRunning: @@ -114,7 +115,8 @@ if self.argsLists: args = self.argsLists[0][:] del self.argsLists[0] - self.startProcess(args, self.workingDir, mergedOutput=self.mergedOutput) + self.startProcess(args, self.workingDir, + mergedOutput=self.mergedOutput) def __procFinished(self, exitCode, exitStatus): """ @@ -140,8 +142,10 @@ @param args list of arguments for the process (list of strings) @param workingDir working directory for the process (string) - @param showCommand flag indicating to show the command executed (boolean) - @param mergedOutput flag indicating to merge the output of the process (boolean) + @param showCommand flag indicating to show the command executed + (boolean) + @param mergedOutput flag indicating to merge the output of the process + (boolean) @return flag indicating a successful start of the process (boolean) """ self.errorGroup.hide() @@ -172,7 +176,8 @@ procStarted = self.proc.waitForStarted() if not procStarted: self.buttonBox.setFocus() - E5MessageBox.critical(None, + E5MessageBox.critical( + self, self.trUtf8('Process Generation Error'), self.trUtf8( 'The process {0} could not be started. ' @@ -180,15 +185,18 @@ ).format(prog)) return procStarted - def startBatchProcesses(self, argsLists, workingDir=None, mergedOutput=False): + def startBatchProcesses(self, argsLists, workingDir=None, + mergedOutput=False): """ Public slot used to start a batch of processes. @param argsLists list of lists of arguments for the processes (list of lists of strings) @param workingDir working directory for the process (string) - @param mergedOutput flag indicating to merge the output of the process (boolean) - @return flag indicating a successful start of the first process (boolean) + @param mergedOutput flag indicating to merge the output of the process + (boolean) + @return flag indicating a successful start of the first process + (boolean) """ self.argsLists = argsLists[:] self.workingDir = workingDir @@ -197,7 +205,8 @@ # start the first process args = self.argsLists[0][:] del self.argsLists[0] - res = self.startProcess(args, self.workingDir, mergedOutput=self.mergedOutput) + res = self.startProcess(args, self.workingDir, + mergedOutput=self.mergedOutput) if not res: self.argsLists = [] @@ -228,7 +237,8 @@ the contents pane. """ if self.proc is not None: - s = str(self.proc.readAllStandardOutput(), self.ioEncoding, 'replace') + s = str(self.proc.readAllStandardOutput(), self.ioEncoding, + 'replace') self.resultbox.insertPlainText(s) self.resultbox.ensureCursorVisible() @@ -241,7 +251,8 @@ """ if self.proc is not None: self.errorGroup.show() - s = str(self.proc.readAllStandardError(), self.ioEncoding, 'replace') + s = str(self.proc.readAllStandardError(), self.ioEncoding, + 'replace') self.errors.insertPlainText(s) self.errors.ensureCursorVisible() @@ -270,8 +281,9 @@ f.write(txt) f.close() except IOError as err: - E5MessageBox.critical(self, + E5MessageBox.critical( + self, self.trUtf8("Error saving data"), self.trUtf8("""<p>The data could not be written""" - """ to <b>{0}</b></p><p>Reason: {1}</p>""")\ - .format(fname, str(err))) + """ to <b>{0}</b></p><p>Reason: {1}</p>""") + .format(fname, str(err)))