librecoding 0.2.0__py3-none-any.whl → 0.3.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.
librecoding/__init__.py
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
"""librecoding
|
|
1
|
+
"""librecoding - модуль, который можно вызвать как функцию."""
|
|
2
2
|
|
|
3
3
|
import sys
|
|
4
4
|
from types import ModuleType
|
|
5
5
|
|
|
6
6
|
from .core import greet
|
|
7
7
|
|
|
8
|
-
__version__ = "0.
|
|
8
|
+
__version__ = "0.3.0"
|
|
9
9
|
|
|
10
10
|
BANNER = "Привет, мир! (из librecoding)"
|
|
11
|
+
PROMPT = "Нажми Enter, чтобы закрыть..."
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
def hello() -> str:
|
|
@@ -16,6 +17,16 @@ def hello() -> str:
|
|
|
16
17
|
return BANNER
|
|
17
18
|
|
|
18
19
|
|
|
20
|
+
def pause(prompt: str = PROMPT) -> None:
|
|
21
|
+
"""Ждёт Enter, чтобы терминал не закрылся сразу."""
|
|
22
|
+
if not sys.stdin.isatty():
|
|
23
|
+
return
|
|
24
|
+
try:
|
|
25
|
+
input(prompt)
|
|
26
|
+
except (EOFError, KeyboardInterrupt):
|
|
27
|
+
print()
|
|
28
|
+
|
|
29
|
+
|
|
19
30
|
class _LibreCodingModule(ModuleType):
|
|
20
31
|
"""Модуль, который ведёт себя как функция: librecoding()."""
|
|
21
32
|
|
|
@@ -23,9 +34,10 @@ class _LibreCodingModule(ModuleType):
|
|
|
23
34
|
print(BANNER)
|
|
24
35
|
if callable(obj) and not args and not kwargs:
|
|
25
36
|
return obj
|
|
37
|
+
pause()
|
|
26
38
|
return BANNER
|
|
27
39
|
|
|
28
40
|
|
|
29
41
|
sys.modules[__name__].__class__ = _LibreCodingModule
|
|
30
42
|
|
|
31
|
-
__all__ = ["greet", "hello", "BANNER"]
|
|
43
|
+
__all__ = ["greet", "hello", "pause", "BANNER"]
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
librecoding/__init__.py,sha256=AcfE0XB4s3mv7vZRq1ndw-i3JrV1ZYQycd5gZZ_dwLE,1129
|
|
2
|
+
librecoding/core.py,sha256=UO5R_K8a-XwaJAhwl3cybnCSbk2tkpcnqrT0d-PIdTA,180
|
|
3
|
+
librecoding-0.3.0.dist-info/METADATA,sha256=hD3JW0D4NfZ7IMIYzBsmIJLm3CzUYAcZyyjQVHPf6t4,331
|
|
4
|
+
librecoding-0.3.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
5
|
+
librecoding-0.3.0.dist-info/RECORD,,
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
librecoding/__init__.py,sha256=KuD4mR8Q-qzh6uK_LFPCDVvkx-PRQf88haQ1sc6T2IE,782
|
|
2
|
-
librecoding/core.py,sha256=UO5R_K8a-XwaJAhwl3cybnCSbk2tkpcnqrT0d-PIdTA,180
|
|
3
|
-
librecoding-0.2.0.dist-info/METADATA,sha256=BtlepHX34KPTTrNIU5tOCAFFd8LhyJzLFbFGfipPjX8,331
|
|
4
|
-
librecoding-0.2.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
5
|
-
librecoding-0.2.0.dist-info/RECORD,,
|
|
File without changes
|