Type narrowing for mypy
This commit is contained in:
parent
cae5a03922
commit
26a2e1a582
1 changed files with 8 additions and 6 deletions
|
|
@ -363,9 +363,10 @@ class SmartScanThing(OFMThing):
|
||||||
self._preview_stitcher = None
|
self._preview_stitcher = None
|
||||||
|
|
||||||
# Set the final details so they persist until the next scan
|
# Set the final details so they persist until the next scan
|
||||||
self._latest_scan_live_details.image_count = final_image_count
|
if self._latest_scan_live_details is not None:
|
||||||
self._latest_scan_live_details.stitch_timestamp = last_timestamp
|
self._latest_scan_live_details.image_count = final_image_count
|
||||||
self._latest_scan_live_details.scan_phase = "Complete"
|
self._latest_scan_live_details.stitch_timestamp = last_timestamp
|
||||||
|
self._latest_scan_live_details.scan_phase = "Complete"
|
||||||
|
|
||||||
# Remove any scan folders containing zero images.
|
# Remove any scan folders containing zero images.
|
||||||
self.purge_empty_scans()
|
self.purge_empty_scans()
|
||||||
|
|
@ -480,8 +481,8 @@ class SmartScanThing(OFMThing):
|
||||||
overlap=stitching_settings.overlap,
|
overlap=stitching_settings.overlap,
|
||||||
correlation_resize=stitching_settings.correlation_resize,
|
correlation_resize=stitching_settings.correlation_resize,
|
||||||
)
|
)
|
||||||
|
if self._latest_scan_live_details is not None:
|
||||||
self._latest_scan_live_details.scan_phase = "Scanning"
|
self._latest_scan_live_details.scan_phase = "Scanning"
|
||||||
# This is the main loop of the scan!
|
# This is the main loop of the scan!
|
||||||
self._main_scan_loop(workflow)
|
self._main_scan_loop(workflow)
|
||||||
self._save_final_scan_data(scan_result="success")
|
self._save_final_scan_data(scan_result="success")
|
||||||
|
|
@ -586,7 +587,8 @@ class SmartScanThing(OFMThing):
|
||||||
@_scan_running
|
@_scan_running
|
||||||
def _perform_final_stitch(self) -> None:
|
def _perform_final_stitch(self) -> None:
|
||||||
"""Update the scan zip and perform final stitch of the data."""
|
"""Update the scan zip and perform final stitch of the data."""
|
||||||
self._latest_scan_live_details.scan_phase = "Stitching"
|
if self._latest_scan_live_details is not None:
|
||||||
|
self._latest_scan_live_details.scan_phase = "Stitching"
|
||||||
if self.scan_data.image_count <= 1:
|
if self.scan_data.image_count <= 1:
|
||||||
self.logger.info("Not performing a stitch as not enough images captured")
|
self.logger.info("Not performing a stitch as not enough images captured")
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue