pyaota.util.collectors module

class pyaota.util.collectors.FileCollector(initial=None)[source]

Bases: UserList

A class for handling collections of files to be managed together as Paths

append(item)[source]

Appends a file path to the collection

Parameters:

item (str | Path) – the file path to append

archive(basepath, delete=False)[source]

Archives the files in the collection into a single compressed file. If OS is Windows, makes a zipfile; if Linux, makes a tarball of the files in the collection.

Parameters:
  • basepath (Path) – basename of the resulting tarball or zipfile

  • delete (bool) – if True, deletes the original files after archiving (default is False)

flush()[source]

Deletes all files in the collection from disk

get_filenames()[source]

Returns list of filenames in the collection as strings

Return type:

list[str]

pyaota.util.collectors.on_rm_error(func, path, exc)[source]