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

def Hellanzb::PostProcessorUtil::processPars (   postProcessor,
  needAssembly = None 
)

Verify (and repair) the integrity of the files in the specified directory via par2
(which supports both par1 and par2 files). If files need repair and there are not
enough recovery blocks, raise a fatal exception. Each different grouping of pars will
have their own explicit par2 process ran on the grouping's files 

Definition at line 690 of file PostProcessorUtil.py.

00690                                                    :
    """ Verify (and repair) the integrity of the files in the specified directory via par2
    (which supports both par1 and par2 files). If files need repair and there are not
    enough recovery blocks, raise a fatal exception. Each different grouping of pars will
    have their own explicit par2 process ran on the grouping's files """
    # Just incase we're running the program again, and we already successfully processed
    # the pars, don't bother doing it again
    dirName = postProcessor.dirName
    if not isFreshState(dirName, 'par'):
        info(archiveName(dirName) + ': Skipping par processing')
        return

    start = time.time()

    # Remove any par2 leftover files after succesful par2 that weren't previously there
    # (aren't in this list)
    dotOneFiles = [file for file in os.listdir(dirName) if PAR2_LEFTOVER_SUFFIX.search(file)]

    parGroups, parGroupOrder = findPar2Groups(os.listdir(dirName))
    for wildcard in parGroupOrder:
        parFiles = parGroups[wildcard]
        
        par2(postProcessor, parFiles, wildcard, needAssembly)
        
        # Successful par2, move them out of the way
        for parFile in parFiles:
            moveToProcessed(os.path.join(dirName, parFile))

    processComplete(dirName, 'par', lambda file : PAR2_LEFTOVER_SUFFIX.search(file) and \
                    file not in dotOneFiles)
    
    parTxt = 'par group'
    groupCount = len(parGroups)
    if groupCount > 1:
        parTxt += 's'
    e = time.time() - start
    info('%s: Finished par verify (%i %s, took: %s)' % (archiveName(dirName), groupCount,
                                                        parTxt, prettyElapsed(e)))

"""
## From par2cmdline-0.4

// Return type of par2cmdline
typedef enum Result
{
  eSuccess                     = 0,

  eRepairPossible              = 1,  // Data files are damaged and there is
                                     // enough recovery data available to
                                     // repair them.

  eRepairNotPossible           = 2,  // Data files are damaged and there is
                                     // insufficient recovery data available
                                     // to be able to repair them.

  eInvalidCommandLineArguments = 3,  // There was something wrong with the
                                     // command line arguments

  eInsufficientCriticalData    = 4,  // The PAR2 files did not contain sufficient
                                     // information about the data files to be able
                                     // to verify them.

  eRepairFailed                = 5,  // Repair completed but the data files
                                     // still appear to be damaged.


  eFileIOError                 = 6,  // An error occured when accessing files
  eLogicError                  = 7,  // In internal error occurred
  eMemoryError                 = 8,  // Out of memory

} Result;
"""
def par2(postProcessor, parFiles, wildcard, needAssembly = None):


Generated by  Doxygen 1.6.0   Back to index