kopitools 2.0.0__tar.gz → 2.1.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.

Potentially problematic release.


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

@@ -1,5 +1,5 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: kopitools
3
- Version: 2.0.0
3
+ Version: 2.1.0
4
4
  Summary: Logs, painted strings, system arguments...
5
5
  Requires-Python: >=3.9
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
6
6
 
7
7
  [project]
8
8
  name = "kopitools"
9
- version = "2.0.0"
9
+ version = "2.1.0"
10
10
  description = "Logs, painted strings, system arguments..."
11
11
  readme = "README.md"
12
12
  requires-python = ">=3.9"
@@ -84,5 +84,20 @@ class Log:
84
84
  paint(*self.args)
85
85
  ).show()
86
86
 
87
+ def info(self):
88
+ icon = "INFO" if Log.text else "^"
89
+
90
+ flag = paint(
91
+ paint("[").bold(),
92
+ paint(icon).bold().blue(),
93
+ paint("]").bold(),
94
+ sep=""
95
+ )
96
+
97
+ paint(
98
+ paint(flag).bold(),
99
+ paint(*self.args)
100
+ ).show()
101
+
87
102
  def log(*args: Any) -> Log:
88
103
  return Log(args)
@@ -0,0 +1,4 @@
1
+ from kopitools import log, Log
2
+
3
+ Log.text = True
4
+ log("HOLA").info()
@@ -1,67 +0,0 @@
1
- from kopitools.args import (
2
- Registry, Args,
3
- EntryPointNotFoundError, ArgError
4
- )
5
- import sys
6
-
7
- def get_voice_options() -> Args | None:
8
- try:
9
- voice = Registry(sys.argv, "voice")
10
- except EntryPointNotFoundError:
11
- return None
12
-
13
- return voice.collect()
14
-
15
- def get_chat_options() -> Args | None:
16
- try:
17
- chat = Registry(sys.argv, "chat")
18
- except EntryPointNotFoundError:
19
- return None
20
-
21
- chat.option(
22
- "--flush",
23
- receives=None,
24
- default=False,
25
- attribute="flush",
26
- )
27
-
28
- return chat.collect()
29
-
30
- def get_main_options() -> Args:
31
- main = Registry(sys.argv)
32
-
33
- main.option(
34
- "--llm-model",
35
- receives=str,
36
- default="gemma4",
37
- attribute="llm_model"
38
- )
39
- main.option(
40
- "--num-ctx",
41
- receives=int,
42
- default=8192,
43
- attribute="num_ctx",
44
- )
45
-
46
- return main.collect()
47
-
48
- main = get_main_options()
49
- chat, voice = get_chat_options(), get_voice_options()
50
- action = None
51
-
52
- if chat is not None and voice is not None:
53
- print("You can only choose one action!")
54
- sys.exit(1)
55
-
56
- elif chat is None and not voice is None:
57
- print("You gotta choose an action!")
58
- sys.exit(1)
59
-
60
- action = chat if chat is not None else voice
61
-
62
- if action is None:
63
- sys.exit(1)
64
-
65
- print(main._args)
66
- print("=" * 50)
67
- print(action._args)
File without changes