costoolsutil

costools.costoolsutil.createOutputDirectory(outdir)

Check whether outdir exists, and create it if necessary.

If outdir was specified but doesn’t exist, create it.

Parameters
outdir: str or None

Name of output directory.

costools.costoolsutil.expandFilename(filename)

Get the actual file name.

Parameters
filename: str

A file or directory name.

Returns
full_file_name: str

The real directory name.

costools.costoolsutil.splitInputString(input)

Split on comma and/or space.

Parameters
input: str

One or more values (e.g. file names), separated by a comma and/or a space.

Returns
words: list of strings
costools.costoolsutil.uniqueInput(infiles, unique=False)

Remove effective duplicates from the list of files.

This function also expands environment variables and wildcards. Aside from that, the order of the input file names will be preserved.

Parameters
infiles: list of strings

List of input file names.

unique: bool

If unique is True, drop duplicates and effective duplicates from the list of file names. “Effective duplicate” means that the root names are the same, but the segment might differ.

Returns
unique_files: list of strings

The list of input files but with duplicates removed.