chore: prune boilerplate and refresh stale docs
- Remove 257 redundant per-definition comment stubs across the package - Drop dead nonlocal declarations in autoslicer_detection.py - Document the swapped flag and swap_left_right in architecture docs - Remove unsupported 'legacy override' claims from autotune/runtime docs
This commit is contained in:
parent
929c828438
commit
426a18f342
24 changed files with 5 additions and 264 deletions
|
|
@ -6,13 +6,11 @@ from time import monotonic
|
|||
from PySide6.QtWidgets import QApplication
|
||||
|
||||
|
||||
# ScanSlicerStatusMixin: class definition for ScanSlicer behavior.
|
||||
class ScanSlicerStatusMixin:
|
||||
STATUS_EVENT_PUMP_INTERVAL_SEC = 0.05
|
||||
STATUS_LOG_FLUSH_INTERVAL_SEC = 0.5
|
||||
STATUS_LOG_BATCH_SIZE = 24
|
||||
|
||||
# update_status_filename: function definition for ScanSlicer behavior.
|
||||
def update_status_filename(self, image_path=None):
|
||||
label = getattr(self, "status_filename_label", None)
|
||||
if label is None:
|
||||
|
|
@ -22,7 +20,6 @@ class ScanSlicerStatusMixin:
|
|||
else:
|
||||
label.setText("No file")
|
||||
|
||||
# resolve_status_log_path: function definition for ScanSlicer behavior.
|
||||
def resolve_status_log_path(self):
|
||||
override = os.environ.get("SCANSLICER_STATUS_LOG_PATH")
|
||||
if override:
|
||||
|
|
@ -36,7 +33,6 @@ class ScanSlicerStatusMixin:
|
|||
config_home = os.path.join(os.path.expanduser("~"), ".config")
|
||||
return os.path.join(config_home, "scanslicer", "status.log")
|
||||
|
||||
# initialize_status_log: function definition for ScanSlicer behavior.
|
||||
def initialize_status_log(self):
|
||||
self._status_log_buffer = []
|
||||
self._status_log_last_flush_ts = monotonic()
|
||||
|
|
@ -56,7 +52,6 @@ class ScanSlicerStatusMixin:
|
|||
self.status_logging_enabled = False
|
||||
self._status_log_file = None
|
||||
|
||||
# _flush_status_log_if_due: function definition for ScanSlicer behavior.
|
||||
def _flush_status_log_if_due(self, force=False):
|
||||
if not self.status_logging_enabled or not self.status_log_path:
|
||||
return
|
||||
|
|
@ -92,7 +87,6 @@ class ScanSlicerStatusMixin:
|
|||
self._status_log_buffer = []
|
||||
self._status_log_last_flush_ts = now
|
||||
|
||||
# _close_status_log: function definition for ScanSlicer behavior.
|
||||
def _close_status_log(self):
|
||||
self._flush_status_log_if_due(force=True)
|
||||
fh = getattr(self, "_status_log_file", None)
|
||||
|
|
@ -104,7 +98,6 @@ class ScanSlicerStatusMixin:
|
|||
pass
|
||||
self._status_log_file = None
|
||||
|
||||
# append_status_log: function definition for ScanSlicer behavior.
|
||||
def append_status_log(self, text):
|
||||
if not self.status_logging_enabled or not self.status_log_path:
|
||||
return
|
||||
|
|
@ -119,7 +112,6 @@ class ScanSlicerStatusMixin:
|
|||
buffer.append(line)
|
||||
self._flush_status_log_if_due(force=False)
|
||||
|
||||
# log_detection_config: function definition for ScanSlicer behavior.
|
||||
def log_detection_config(self):
|
||||
preset_name = self.preset_dropdown.currentText()
|
||||
values = self.params.to_dict()
|
||||
|
|
@ -127,7 +119,6 @@ class ScanSlicerStatusMixin:
|
|||
self.append_status_log(f"Detection config: preset={preset_name}")
|
||||
self.append_status_log(f"Detection params: {values_text}")
|
||||
|
||||
# _pump_ui_events_if_due: function definition for ScanSlicer behavior.
|
||||
def _pump_ui_events_if_due(self, force=False):
|
||||
now = monotonic()
|
||||
last_pump = getattr(self, "_status_last_event_pump_ts", 0.0)
|
||||
|
|
@ -135,13 +126,11 @@ class ScanSlicerStatusMixin:
|
|||
QApplication.processEvents()
|
||||
self._status_last_event_pump_ts = now
|
||||
|
||||
# update_statusbar: function definition for ScanSlicer behavior.
|
||||
def update_statusbar(self, text):
|
||||
self.status_message_label.setText(text)
|
||||
self.append_status_log(text)
|
||||
self._pump_ui_events_if_due()
|
||||
|
||||
# set_processing_busy: function definition for ScanSlicer behavior.
|
||||
def set_processing_busy(self, busy, status_text=None):
|
||||
busy = bool(busy)
|
||||
if self.processing_busy == busy:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue