util.errorReportingObject module¶
ErrorReportingObject: a mix-in for objects that check themselves. Problems found while validating are added to the object’s status report (with a severity, and optional actions to fix them), which can then be shown in an ActionDialog (see util.actionDialog).
Created on Sep 18, 2026
Code author: Rob Kremer <robkremer@me.com>
- class util.errorReportingObject.ErrorReportingObject(**kwargs)¶
Bases:
objectA mix-in for objects that check themselves: validate() fills the object’s status report (see assertToStatusReport()), whose entries can be listed (statusReport()) or shown, with their actions, in an ActionDialog.
- __init__(**kwargs)¶
- Parameters:
kwargs (Any) – Passed on to super().__init__(). ErrorReportingObject is meant to be combined with other classes via multiple inheritance (see sn.view.graphics.vobjects.VObject), so calling super().__init__(**kwargs) here – rather than simply returning – keeps this class from becoming a dead end in that cooperative chain if something is ever listed after it in some future class’s MRO.
- assertToStatusReport(cond: bool, msg: str, severity: str = 'E', actions: dict[str, Callable[[], None]] = {}) None¶
Conditionally logs an line in the status report for the object.
- Parameters:
cond (bool:) – A conditional expression that if False will cause an entry in the status report.
msg (str) – A message to print in the status report if cond is False.
severity (str) – A one-character severity code: F (fatal), E (error), W (warning), I (informational)
actions (dict[str:Callable[[],None]]) – A dict of str:Callable indicating actions such as fix:<function>, or “delete:<function>” for use in a ActionDialog later.
- Returns:
None
- validate() list[str]¶
- Returns:
- Return type:
list[str]
- statusReport() list[str]¶
- Returns:
- Return type:
list[str]
- clearStatusReport() None¶
- showErrorActionDialog(parentWidget: Wm)¶
- Parameters:
parentWidget (tk.Wm)
- status() str¶
- Returns:
- Return type:
str
- _STATUS: dict[str, int] = {'': 0, 'E': -1, 'F': -2, 'I': 1, 'W': 2}¶
- statsInt()¶
- Returns:
- Return type: