See also

@split

@split ( tasks_or_file_names, output_files, [extra_parameters,...] )

Purpose:
Splits a single set of input files into multiple output file names, where the number of output files may not be known beforehand.
Only out of date tasks (comparing input and output files) will be run

Example:

@split("big_file", '*.little_files')
def split_big_to_small(input_file, output_files):
    print "input_file = %s" % input_file
    print "output_file = %s" % output_file

.

will produce:

input_file = big_file
output_file = *.little_files

Parameters:

  • tasks_or_file_names

    can be a:

    1. (Nested) list of file name strings (as in the example above).

      File names containing *[]? will be expanded as a glob.
      E.g.:"a.*" => "a.1", "a.2"
    2. Task / list of tasks.

      File names are taken from the output of the specified task(s)

  • output_files

    Specifies the resulting output file name(s).

    These are used only to check if the task is up to date.
    Normally you would use either a glob (e.g. *.little_files as above) or a “sentinel file” to indicate that the task has completed successfully.
    You can of course do both:
    @split("big_file", ["sentinel.file", "*.little_files"])
    def split_big_to_small(input_file, output_files):
        pass
    
  • [extra_parameters, ...]

    Any extra parameters are passed verbatim to the task function

@split with regex(...), add_inputs and inputs

This deprecated syntax is a synonym for @subdivide.