def postProcess(self, _edObject=None): """ Post-Process: set the output of the plugin """ EDPluginExecProcessScript.postProcess(self) self.DEBUG("EDPluginExecCommandLinev10.postProcess") # Create some output data xsDataResult = XSDataResultExecCommandLine() if self.dataInput.getFireAndForget() is not None: if self.dataInput.getFireAndForget().value is True: self.setDataOutput(xsDataResult) return if self.dataInput.getOutfileFromStdout() is not None: #self.DEBUG("*** getOutfileFromStdout = %s" % self.dataInput.getOutfileFromStdout().value) if self.dataInput.getOutfileFromStdout( ).value: # this is not clean ... should be 1 or True ... or whatever if self.dataInput.getOutputPath() is not None: outputPath = self.dataInput.getOutputPath().path.value stdout = os.path.join(self.getWorkingDirectory(), self.getScriptLogFileName()) self.synchronizeOn() if os.path.isdir(outputPath): outfile = os.path.join( outputPath, os.path.split( self.dataInput.inputFileName.path.value)[1]) else: outfile = outputPath if os.path.isfile(outfile): takenNames = [] [mydir, myname] = os.path.split(outfile) for onefile in os.listdir(mydir): if onefile.find(myname) == 0: takenNames.append(onefile) for ext in string.digits + string.ascii_lowercase: if not (outfile + ext) in takenNames: outfile += ext break shutil.move(stdout, outfile) self.synchronizeOff() xsDataFile = XSDataFile() xsDataFile.setPath(XSDataString(outfile)) xsDataResult.setOutputFilename(xsDataFile) else: xsDataResult.setOutputFilename(self.getScriptLogFileName()) self.setDataOutput(xsDataResult)