added scaffold struct for the prj
This commit is contained in:
17
kg_ocr/ocr/extractor.py
Normal file
17
kg_ocr/ocr/extractor.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import platform
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
from .constants import def_paths, sc_pathpatterns
|
||||
|
||||
|
||||
def get_screenshots(path: Optional[str | Path] = 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))
|
||||
Reference in New Issue
Block a user