mintterm 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.
mintterm/__init__.py ADDED
@@ -0,0 +1,3 @@
1
+ """mintterm: a block-based terminal for Linux."""
2
+
3
+ __version__ = "0.2.0"
mintterm/__main__.py ADDED
@@ -0,0 +1,38 @@
1
+ """Command-line entry point: `mintterm [--theme NAME] [--version]`."""
2
+
3
+ import os
4
+ import sys
5
+
6
+ from . import __version__
7
+ from . import storage
8
+ from .themes import THEMES
9
+
10
+
11
+ def main(argv=None):
12
+ argv = sys.argv[1:] if argv is None else argv
13
+
14
+ if "--version" in argv:
15
+ print(f"mintterm {__version__}")
16
+ return 0
17
+ if "--help" in argv or "-h" in argv:
18
+ print("usage: mintterm [--theme NAME] [--version]")
19
+ print("themes: " + ", ".join(THEMES))
20
+ print("settings are saved in " + storage.CONFIG_FILE + " (or use the set command inside mintterm)")
21
+ return 0
22
+
23
+ cfg = storage.load_config()
24
+ if "--theme" in argv:
25
+ i = argv.index("--theme")
26
+ if i + 1 < len(argv) and argv[i + 1] in THEMES:
27
+ cfg["theme"] = argv[i + 1] # for this run only; not saved
28
+
29
+ # Hide pygame's startup banner, and import pygame only when the window opens.
30
+ os.environ.setdefault("PYGAME_HIDE_SUPPORT_PROMPT", "1")
31
+ from .app import App
32
+
33
+ App(cfg).run()
34
+ return 0
35
+
36
+
37
+ if __name__ == "__main__":
38
+ raise SystemExit(main())