webcam-micro 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- webcam_micro/README.md +254 -0
- webcam_micro/VERSION +1 -0
- webcam_micro/__init__.py +16 -0
- webcam_micro/__main__.py +6 -0
- webcam_micro/app.py +77 -0
- webcam_micro/camera.py +6992 -0
- webcam_micro/error_reporting.py +31 -0
- webcam_micro/launcher.py +28 -0
- webcam_micro/licenses/PySide6-6.11.3.txt +1198 -0
- webcam_micro/licenses/README.md +28 -0
- webcam_micro/licenses/THIRD_PARTY_LICENSES.md +13 -0
- webcam_micro/licenses/rubicon-objc-0.5.7.txt +71 -0
- webcam_micro/macos_permission.py +18 -0
- webcam_micro/runtime-requirements.lock +29 -0
- webcam_micro/runtime_bootstrap.py +232 -0
- webcam_micro/ui.py +4052 -0
- webcam_micro/webcam-micro.png +0 -0
- webcam_micro-0.2.0.dist-info/METADATA +264 -0
- webcam_micro-0.2.0.dist-info/RECORD +22 -0
- webcam_micro-0.2.0.dist-info/WHEEL +5 -0
- webcam_micro-0.2.0.dist-info/entry_points.txt +2 -0
- webcam_micro-0.2.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""Structured error-reporting helpers for webcam-micro."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class WebcamMicroError(Exception):
|
|
9
|
+
"""Base class for typed, user-facing webcam-micro failures."""
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@dataclass(frozen=True)
|
|
13
|
+
class ErrorReport:
|
|
14
|
+
"""Describe one user-facing error and its diagnostic text."""
|
|
15
|
+
|
|
16
|
+
error_type: str
|
|
17
|
+
display_message: str
|
|
18
|
+
diagnostic_message: str
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def build_error_report(error: BaseException) -> ErrorReport:
|
|
22
|
+
"""Return structured notice and diagnostic text for one error."""
|
|
23
|
+
|
|
24
|
+
error_type = error.__class__.__name__
|
|
25
|
+
display_message = str(error).strip() or error_type
|
|
26
|
+
diagnostic_message = f"{error_type}: {display_message}"
|
|
27
|
+
return ErrorReport(
|
|
28
|
+
error_type=error_type,
|
|
29
|
+
display_message=display_message,
|
|
30
|
+
diagnostic_message=diagnostic_message,
|
|
31
|
+
)
|
webcam_micro/launcher.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""Public launcher that prepares the runtime before starting the app."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import sys
|
|
6
|
+
from typing import Sequence
|
|
7
|
+
|
|
8
|
+
from webcam_micro.error_reporting import WebcamMicroError, build_error_report
|
|
9
|
+
from webcam_micro.runtime_bootstrap import bootstrap_runtime
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _run_app(argv: Sequence[str]) -> int:
|
|
13
|
+
"""Import the GUI entrypoint lazily after the runtime is ready."""
|
|
14
|
+
|
|
15
|
+
from webcam_micro.app import main as app_main
|
|
16
|
+
|
|
17
|
+
return app_main(argv)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def main(argv: Sequence[str] | None = None) -> int:
|
|
21
|
+
"""Bootstrap the runtime interpreter and then start the application."""
|
|
22
|
+
|
|
23
|
+
argv_list = list(sys.argv[1:] if argv is None else argv)
|
|
24
|
+
try:
|
|
25
|
+
bootstrap_runtime(argv_list)
|
|
26
|
+
except WebcamMicroError as exc:
|
|
27
|
+
raise SystemExit(build_error_report(exc).display_message) from exc
|
|
28
|
+
return _run_app(argv_list)
|