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

def Hellanzb::PostProcessorUtil::flattenPar2Name (   file  ) 

Flatten a PAR2 filename for grouping (remove the unique characters distinguishing it
from other par files in its same group) via wildcards (and add wildcard values where
appropriate)

A list of par2 files containing multiple groups might look like:

download.part1.par2            download.part2.par2
download.part1.vol000+01.PAR2  download.part2.vol000+01.PAR2
download.part1.vol001+02.PAR2  download.part2.vol001+02.PAR2
download.part1.vol003+04.PAR2  download.part2.vol003+04.PAR2

Would have 2 wildcards: download.part1*.{par2,PAR2}
                        download.part2*.{par2,PAR2}
                        
or possibly even:

dataGroupA.vol007+08.PAR2  dataGroupA.vol053+48.PAR2 dataGroupB.vol28+25.PAR2
dataGroupA.vol015+13.PAR2  dataGroupB.vol07+08.PAR2  dataGroupC.vol12+10.PAR2
dataGroupA.vol028+25.PAR2  dataGroupB.vol15+13.PAR2  dataGroupC.vol22+19.PAR2

Would have 3 wildcards: dataGroupA*.{par2,PAR2}
                        dataGroupB*.{par2,PAR2}
                        dataGroupC*.{par2,PAR2}

From the PAR2 Specification: http://www.par2.net/par2spec.php (Note the specification
specifies '-' as the vol delimiter, however Usenet appears to use '+' for some unknown
reason)

PAR 2.0 files should always end in ".par2". For example, "file.par2". If a file
contains recovery slices, the ".par2" should be preceded by ".volXX-YY" where XX to YY
is the range of exponents for the recovery slices. For example,
"file.vol20-29.par2". More than 2 digits should be used if necessary. Any exponents
that contain fewer digits than the largest exponent should be preceded by zeros so
that all filenames have the same length. For example,
"file.vol075-149.par2". Exponents should start at 0 and go upwards.

If multiple PAR files are generated, they may either have a constant number of slices
per file (e.g. 20, 20, 20, ...) or exponentially increasing number of slices (e.g., 1,
2, 4, 8, ...). Note that to store 1023 slices takes 52 files if each has 20 slices,
but takes only 10 files with the exponential pattern.

When generating multiple PAR files, it is expected that one file be generated without
any slices and containing all main, file description, and input file checksum
packets. The other files should also include the main, file description and input file
checksum packets. This repeats data that cannot be recovered.

Definition at line 616 of file PostProcessorUtil.py.

00616                          :
    """ Flatten a PAR2 filename for grouping (remove the unique characters distinguishing it
    from other par files in its same group) via wildcards (and add wildcard values where
    appropriate)

    A list of par2 files containing multiple groups might look like:
    
    download.part1.par2            download.part2.par2
    download.part1.vol000+01.PAR2  download.part2.vol000+01.PAR2
    download.part1.vol001+02.PAR2  download.part2.vol001+02.PAR2
    download.part1.vol003+04.PAR2  download.part2.vol003+04.PAR2

    Would have 2 wildcards: download.part1*.{par2,PAR2}
                            download.part2*.{par2,PAR2}
                            
    or possibly even:
    
    dataGroupA.vol007+08.PAR2  dataGroupA.vol053+48.PAR2 dataGroupB.vol28+25.PAR2
    dataGroupA.vol015+13.PAR2  dataGroupB.vol07+08.PAR2  dataGroupC.vol12+10.PAR2
    dataGroupA.vol028+25.PAR2  dataGroupB.vol15+13.PAR2  dataGroupC.vol22+19.PAR2

    Would have 3 wildcards: dataGroupA*.{par2,PAR2}
                            dataGroupB*.{par2,PAR2}
                            dataGroupC*.{par2,PAR2}

    From the PAR2 Specification: http://www.par2.net/par2spec.php (Note the specification
    specifies '-' as the vol delimiter, however Usenet appears to use '+' for some unknown
    reason)

    PAR 2.0 files should always end in ".par2". For example, "file.par2". If a file
    contains recovery slices, the ".par2" should be preceded by ".volXX-YY" where XX to YY
    is the range of exponents for the recovery slices. For example,
    "file.vol20-29.par2". More than 2 digits should be used if necessary. Any exponents
    that contain fewer digits than the largest exponent should be preceded by zeros so
    that all filenames have the same length. For example,
    "file.vol075-149.par2". Exponents should start at 0 and go upwards.

    If multiple PAR files are generated, they may either have a constant number of slices
    per file (e.g. 20, 20, 20, ...) or exponentially increasing number of slices (e.g., 1,
    2, 4, 8, ...). Note that to store 1023 slices takes 52 files if each has 20 slices,
    but takes only 10 files with the exponential pattern.

    When generating multiple PAR files, it is expected that one file be generated without
    any slices and containing all main, file description, and input file checksum
    packets. The other files should also include the main, file description and input file
    checksum packets. This repeats data that cannot be recovered.
    
    """
    # Removing all the '.vol' cruft reveals the group
    file = par2RecoveryPacketRe.sub('.', file)
    return file[:-5] + '*.{par2,PAR2}'

def flattenPar1Name(file):


Generated by  Doxygen 1.6.0   Back to index