dispatch#

Add docs here.

Module documentation#

Dispatching facilities.

This module contains the facilities to dispatch all the relevant files from the dump of the indico attachments to the folder structure in use by the slideshow.

easely.dispatch.populate_file_dict(friendly_ids: List[int], input_dir: str | Path, file_types: List[str]) Dict[int, List[Path]][source]#

Populate a dictionary mapping friendly IDs to lists of file paths in a given directory.

Arguments#

friendly_idsList[int]

The list of friendly IDs for which to populate file paths.

input_dirPathLike

The path to the directory containing the files.

file_typesList[str]

The list of file extensions to consider.

Returns#

Dict[int, List[pathlib.Path]]

A dictionary mapping each friendly ID to a list of matching file paths.

easely.dispatch.dispatch_file(src: Path, dest: Path) bool[source]#

Copy a file from the source to the destination path.

Arguments#

srcpathlib.Path

The path to the source file.

destpathlib.Path

The path to the destination file.

Returns#

bool

True if the file was copied, False if the destination file already exists.

easely.dispatch.dispatch_posters(friendly_ids: List[int], attachments_dir: str | Path, posters_dir: str | Path, pattern: str = 'poster') int[source]#

Dispatch the candidate poster files from the indico attachment folder to the target folder holding the poster originals.

Arguments#

attachments_dirPathLike

The path to the folder containing the indico attachments.

posters_dirPathLike

The path to the folder where the poster files should be copied to.

patternstr

The pattern to look for in the file names to identify the poster files.

Returns#

int

The number of files successfully copied.

easely.dispatch.dispatch_headshots(friendly_ids: List[int], attachments_dir: str | Path, headshots_dir: str | Path, pattern: str = 'picture') int[source]#

Dispatch the candidate headshot files from the indico attachment folder to the target folder holding the headshot originals.

Arguments#

attachments_dirPathLike

The path to the folder containing the indico attachments.

headshots_dirPathLike

The path to the folder where the headshot files should be copied to.

patternstr

The pattern to look for in the file names to identify the headshot files.

Returns#

int

The number of files successfully copied.