A class for handling interactions with scan directories.
| Method | __init__ |
Initialise the scan directory. |
| Method | all |
Return a list of all files in the scan dir relative to the dir. |
| Method | get |
Return the filename for the final stitch (in the images dir). |
| Method | get |
Return the modified time of the directory. |
| Method | get |
Return the scan data from the json file as a HistoricScanData model. |
| Method | get |
Return a list of the files in the images dir. |
| Method | save |
Save the scan data for this scan to disk. |
| Method | scan |
Return the information to be used in the UI for the scan. |
| Method | zip |
Zips any images from the scan not yet zipped, return full path to zip. |
| Property | created |
The time the directory was created on disk. |
| Property | dir |
The full path to the scan directory. |
| Property | images |
The path to the images directory. |
| Property | name |
The name of the scan. |
| Property | scan |
The path to the scan data json file for this directory. |
| Method | _extract |
Extract files which match the naming convention for dzi_files. |
| Method | _extract |
Extract files which match the naming convention for final stitches. |
| Method | _extract |
Extract files which match the naming convention for scan images. |
| Method | _get |
Return the scan data from the json file as a dictionary. |
| Instance Variable | _base |
Undocumented |
| Instance Variable | _name |
Undocumented |
Initialise the scan directory.
| Parameters | |
name:str | the name of the scan (the scan directory basename). |
basestr | Path of the directory that holds all scans. |
Return a list of all files in the scan dir relative to the dir.
| Parameters | |
skiplist[ | Skip 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[ | Undocumented |
Return the filename for the final stitch (in the images dir).
If no final stitch is found, return None
Return the scan data from the json file as a HistoricScanData model.
| Returns | |
HistoricScanData | None | The data as a HistoricScanData model or None if it couldn't be loaded or valdiated. |
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.
The path to the scan data json file for this directory.
Returns None if there is no images dir to write to.
Extract files which match the naming convention for dzi_files.
| Parameters | |
filelist[ | The list of files to search. |
| Returns | |
list[ | The list of files that match the naming convention for dzi_files |
Extract files which match the naming convention for final stitches.
| Parameters | |
filelist[ | The list of files to search. |
| Returns | |
list[ | The list of files that match the naming convention for final stitches |
Extract files which match the naming convention for scan images.
| Parameters | |
filelist[ | The list of files to search. Normally this would be self.get_scan_files() |
| Returns | |
list[ | The list of files that match the naming convention for scan images |