chore: archive tools/ui_inspector snapshot before migration removal.
Keep the last in-template copy on main so history can restore it; product continues in jiangchang-ui-recorder. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
29
tools/ui_inspector/drivers/__init__.py
Normal file
29
tools/ui_inspector/drivers/__init__.py
Normal file
@@ -0,0 +1,29 @@
|
||||
"""Surface drivers for UI Inspector (windows / browser / mobile stub)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from .base import DumpResult, SurfaceDriver
|
||||
from .browser_pw import BrowserPlaywrightDriver
|
||||
from .mobile import MobileDriver
|
||||
from .windows_uia import WindowsUiaDriver
|
||||
import target as _target
|
||||
|
||||
|
||||
def get_driver(surface: str) -> SurfaceDriver:
|
||||
if surface == _target.SURFACE_WINDOWS:
|
||||
return WindowsUiaDriver()
|
||||
if surface == _target.SURFACE_BROWSER:
|
||||
return BrowserPlaywrightDriver()
|
||||
if surface in {_target.SURFACE_ANDROID, _target.SURFACE_IOS}:
|
||||
return MobileDriver(surface=surface)
|
||||
raise RuntimeError(f"ERROR:SURFACE_UNSUPPORTED unknown surface={surface!r}")
|
||||
|
||||
|
||||
__all__ = [
|
||||
"DumpResult",
|
||||
"SurfaceDriver",
|
||||
"WindowsUiaDriver",
|
||||
"BrowserPlaywrightDriver",
|
||||
"MobileDriver",
|
||||
"get_driver",
|
||||
]
|
||||
Reference in New Issue
Block a user