Logo Search packages:      
Sourcecode: hellanzb version File versions  Download package

def Hellanzb::PostProcessor::PostProcessor::run (   self  ) 

do the work 

Definition at line 190 of file PostProcessor.py.

00190                  :
        """ do the work """
        if not self.isSubDir:
            Hellanzb.postProcessorLock.acquire()
            # FIXME: could block if there are too many processors going
            Hellanzb.postProcessors.append(self)
            Hellanzb.postProcessorLock.release()

            if not self.isSubDir and self.background:
                Hellanzb.writeStateXML()
        
        try:
            self.postProcess()
            
        except SystemExit, se:
            # REACTOR STOPPED IF NOT BACKGROUND/SUBIDR
            self.stop()
            
            if self.isSubDir:
                # Propagate up to the original Post Processor
                raise

            return
        
        except FatalError, fe:
            # REACTOR STOPPED IF NOT BACKGROUND/SUBIDR
            if self.background:
                logStateXML(debug)
            self.stop()

            # Propagate up to the original Post Processor
            if self.isSubDir:
                raise

            pe = prettyException(fe)
            lines = pe.split('\n')
            archive = archiveName(self.dirName)
            if self.background and Hellanzb.LOG_FILE and len(lines) > 13:
                # Show only the first 4 and last 4 lines of the error
                begin = ''.join([line + '\n' for line in lines[:3]])
                end = ''.join([line + '\n' for line in lines[-9:]])
                msg = begin + \
                    '\n <hellanzb truncated the error\'s output, see the log file for full output>\n' + \
                    end
                
                noLogFile(archive + ': A problem occurred: ' + msg)
                logFile(archive + ': A problem occurred', fe)
            else:
                error(archive + ': A problem occurred: ' + pe)

            e = time.time() - self.startTime 
            dispatchExternalHandler(ERROR, archiveName=archive,
                                    destDir=os.path.join(Hellanzb.DEST_DIR, archive),
                                    elapsedTime=prettyElapsed(e),
                                    parMessage='A problem occurred: %s' % pe)

            return
        
        except Exception, e:
            # REACTOR STOPPED IF NOT BACKGROUND/SUBIDR
            if self.background:
                logStateXML(debug)
            self.stop()
            
            # Propagate up to the original Post Processor
            if self.isSubDir:
                raise
            
            error(archiveName(self.dirName) + ': An unexpected problem occurred', e)
            return

        # REACTOR STOPPED IF NOT BACKGROUND/SUBIDR
        self.stop() # successful post process
    
    def processMusic(self):


Generated by  Doxygen 1.6.0   Back to index