def addFile(self, work, output): if len(self.report.workFiles) != len(self.report.outputFiles): raise Exception("Report's file list invalid") virtWork = VirtualPath.virtualize(work, self.local) virtOutput = VirtualPath.virtualize(output, self.local) self.report.workFiles.append(virtWork) self.report.outputFiles.append(virtOutput)
def init(self, context): sourceCtx = context.getSourceContext() self.setCurrentPath(sourceCtx.getInputPath()) self.report.local.loadFromLocal(context.local) virtInput = VirtualPath.virtualize(sourceCtx.getInputPath(), self.local) virtDone = VirtualPath.virtualize(sourceCtx.getDoneInputPath(), self.local) virtFailed = VirtualPath.virtualize(sourceCtx.getFailedInputPath(), self.local) self.report.source.inputPath = virtInput self.report.source.donePath = virtDone self.report.source.failedPath = virtFailed
def do_setup(self): try: localConfigPath = self._configPath configPath = VirtualPath.virtualize(localConfigPath, self._local) self.debug("Loading configuration from '%s'", localConfigPath) self._config = TranscodingConfig() loader = IniFile() loader.loadFromFile(self._config, localConfigPath) if self._inputPath: confInputFile = self._config.source.inputFile if not self._inputPath.endswith(confInputFile): raise Exception("The source file path " + "doesn't match the configuration " + "source input-file property") altInputDir = self._inputPath[:-len(confInputFile)] else: altInputDir=None #TODO add cue points in report self._report = TranscodingReport() self._report.init(self._config) self._report.configPath = configPath if not self._diagnoseMode: moveInputFile = self._moveInputFile else: self.info("Entering diagnose mode") moveInputFile = False self._job = job.TranscodingJob(self, self, self._pathAttr) self._job.setup(self._local, self._config, self._report, moveInputFile=moveInputFile, altInputDir=altInputDir, niceLevel=self._niceLevel) d = self._job.start() self._reportDefaultPath = self._job.getTempReportPath() self.__syncReport(self._report) d.addCallbacks(self.__cbJobDone, self.__ebJobFailed) return None except: self.__unexpectedError(task="component setup")
def _fireTranscodingReport(self, reportPath): virtPath = VirtualPath.virtualize(reportPath, self._local) self.uiState.setitem('job-data', "transcoding-report", virtPath)
def _getReportPath(self): if self._reportDefaultPath: virtPath = VirtualPath.virtualize(self._reportDefaultPath, self._local) return virtPath return None
def onSourceInfo(self, info): inputFile = info["input-file"] virtFile = VirtualPath.virtualize(inputFile, self._local) info["input-file"] = str(virtFile) for key, value in info.iteritems(): self.uiState.setitem('source-data', key, value)
def setCurrentPath(self, path): self.report.source.lastPath = VirtualPath.virtualize(path, self.local)