class documentation

A class for handling interactions with scan directories.

Method __init__ Initialise the scan directory.
Method all_files Return a list of all files in the scan dir relative to the dir.
Method get_final_stitch_name Return the filename for the final stitch (in the images dir).
Method get_modified_time Return the modified time of the directory.
Method get_scan_files Return a list of the files in the images dir.
Method save_scan_data Save the scan data for this scan to disk.
Method scan_info Return the information for the scan directory as a ScanInfo object.
Method zip_files Zips any images from the scan not yet zipped, return full path to zip.
Property created_time The time the directory was created on disk.
Property dir_path The full path to the scan directory.
Property images_dir The path to the images directory.
Property name The name of the scan.
Property scan_data_path The path to the scan data json file for this directory.
Method _extract_dzi_files Extract files which match the naming convention for dzi_files.
Method _extract_final_stitches Extract files which match the naming convention for final stitches.
Method _extract_scan_images Extract files which match the naming convention for scan images.
Instance Variable _base_scan_dir Undocumented
Instance Variable _name Undocumented
def __init__(self, name: str, base_scan_dir: str): (source)

Initialise the scan directory.

Parameters
name:strthe name of the scan (the scan directory basename).
base_scan_dir:strPath of the directory that holds all scans.
def all_files(self, skip_dirs: list[str] | None = None) -> list[str]: (source)

Return a list of all files in the scan dir relative to the dir.

Parameters
skip_dirs:list[str] | NoneSkip any file in a directory that is on this list. The list should be the basename of the directory. e.g. "scan_0001_files" not "images/scan_0001_files"
Returns
list[str]Undocumented
def get_final_stitch_name(self) -> str | None: (source)

Return the filename for the final stitch (in the images dir).

If no final stitch is found, return None

def get_modified_time(self) -> float: (source)

Return the modified time of the directory.

def get_scan_files(self): (source)

Return a list of the files in the images dir.

def save_scan_data(self, scan_data: ScanData): (source)

Save the scan data for this scan to disk.

def scan_info(self) -> ScanInfo: (source)

Return the information for the scan directory as a ScanInfo object.

def zip_files(self, final_version: bool = False) -> str: (source)

Zips any images from the scan not yet zipped, return full path to zip.

final_version Set true to stitch all files not just the scan images this should only be done at the end as it is not possible to update a file in a zip.

@property
created_time: float = (source)

The time the directory was created on disk.

@property
dir_path: str = (source)

The full path to the scan directory.

@property
images_dir: str | None = (source)

The path to the images directory.

None is returned if no images directory was created.

@property
name: str = (source)

The name of the scan.

@property
scan_data_path: str | None = (source)

The path to the scan data json file for this directory.

Returns None if there is no images dir to write to.

def _extract_dzi_files(self, file_list: list[str]): (source)

Extract files which match the naming convention for dzi_files.

Parameters
file_list:list[str]The list of files to search.
Returns
The list of files that match the naming convention for dzi_files
def _extract_final_stitches(self, file_list: list[str]): (source)

Extract files which match the naming convention for final stitches.

Parameters
file_list:list[str]The list of files to search.
Returns
The list of files that match the naming convention for final stitches
def _extract_scan_images(self, file_list: list[str]): (source)

Extract files which match the naming convention for scan images.

Parameters
file_list:list[str]The list of files to search. Normally this would be self.get_scan_files()
Returns
The list of files that match the naming convention for scan images
_base_scan_dir: str = (source)

Undocumented

_name: str = (source)

Undocumented