korvoice 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.

Potentially problematic release.


This version of korvoice might be problematic. Click here for more details.

korvoice/__init__.py ADDED
@@ -0,0 +1,49 @@
1
+ """korvoice — push-to-talk / toggle Russian voice input for Linux.
2
+
3
+ PySide6 tray application: records from the microphone on a global hotkey,
4
+ transcribes with the local GigaAM speech model (no cloud), delivers the
5
+ text to the clipboard, autotype and/or a small history window.
6
+ """
7
+
8
+ from importlib.metadata import PackageNotFoundError, metadata, version
9
+
10
+
11
+ def _project_url(all_urls: list[str], name: str) -> str:
12
+ """Picks one entry out of importlib.metadata's "Project-URL" list
13
+ (each formatted "Name, https://..."), matching pyproject.toml's
14
+ [project.urls] table by key."""
15
+ return next(
16
+ (
17
+ url.split(",", 1)[1].strip()
18
+ for url in all_urls
19
+ if url.split(",", 1)[0].strip() == name
20
+ ),
21
+ "",
22
+ )
23
+
24
+
25
+ try:
26
+ # Single source of truth: pyproject.toml's [project] table, read back
27
+ # from the installed package's metadata (populated from it at build
28
+ # time) — hardcoding copies of these here would drift the moment
29
+ # pyproject.toml changes and this file doesn't.
30
+ __version__ = version("korvoice")
31
+ _metadata = metadata("korvoice")
32
+ __description__ = _metadata.get("Summary", "")
33
+ __author__ = _metadata.get("Author", "")
34
+ __license__ = _metadata.get("License", "")
35
+ _urls = _metadata.get_all("Project-URL", [])
36
+ __homepage__ = _project_url(_urls, "Homepage")
37
+ __repository__ = _project_url(_urls, "Repository")
38
+ __telegram__ = _project_url(_urls, "Telegram")
39
+ __chat__ = _project_url(_urls, "Chat")
40
+ except PackageNotFoundError:
41
+ # Running from a source checkout, not installed.
42
+ __version__ = "0.0.0+unknown"
43
+ __description__ = ""
44
+ __author__ = ""
45
+ __license__ = ""
46
+ __homepage__ = ""
47
+ __repository__ = ""
48
+ __telegram__ = ""
49
+ __chat__ = ""
korvoice/__main__.py ADDED
@@ -0,0 +1,4 @@
1
+ from .app import main
2
+
3
+ if __name__ == "__main__":
4
+ raise SystemExit(main())