pyani.scripts package

Modules to support use of pyani as a script.

exception pyani.scripts.PyaniScriptException(msg='Error in pyani.py script')[source]

Bases: Exception

General exception for pyani.py script.

pyani.scripts.make_outdir(outdir: pathlib.Path, force: bool, noclobber: bool) → None[source]

Create output directory (allows for force and noclobber).

Parameters:
  • outdir – Path, path to output directory
  • force – bool, True if an existing directory will be reused
  • noclobber – bool, True if existing files are not overwritten

The intended outcomes are: outdir doesn’t exist: create outdir outdir exists: raise exception outdir exists, –force only: remove the directory tree outdir exists, –force –noclobber: continue with existing directory tree

So long as the outdir is created with this function, we need only check for args.noclobber elsewhere to see how to proceed when a file exists.