librecoding 0.2.0__tar.gz → 0.3.0__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: librecoding
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: Free and open-source coding library
5
5
  Author: ar
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "librecoding"
7
- version = "0.2.0"
7
+ version = "0.3.0"
8
8
  description = "Free and open-source coding library"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -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.2.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"]
File without changes