Some checks failed
tests / core (macos-latest, py3.11) (push) Has been cancelled
tests / core (macos-latest, py3.12) (push) Has been cancelled
tests / core (macos-latest, py3.13) (push) Has been cancelled
tests / core (ubuntu-latest, py3.11) (push) Has been cancelled
tests / core (ubuntu-latest, py3.12) (push) Has been cancelled
tests / core (ubuntu-latest, py3.13) (push) Has been cancelled
tests / doctor CLI smoke test (push) Has been cancelled
17 lines
532 B
Python
17 lines
532 B
Python
import platform
|
|
from pathlib import Path
|
|
|
|
from .constants import def_paths, sc_pathpatterns
|
|
|
|
|
|
def get_screenshots(path: str | Path | None = None) -> list[str]:
|
|
"""Find screenshot files for the current OS."""
|
|
if path is None:
|
|
path = def_paths.get(platform.system(), Path.home())
|
|
path = Path(path)
|
|
patterns = sc_pathpatterns.get(platform.system(), ["SCR*.png"])
|
|
results = []
|
|
for pattern in patterns:
|
|
results.extend(str(f.absolute()) for f in path.glob(pattern))
|
|
return sorted(set(results))
|