argenta 0.2.0__py3-none-any.whl → 0.2.1__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.
argenta/app/entity.py CHANGED
@@ -14,23 +14,29 @@ from .exceptions import (InvalidRouterInstanceException,
14
14
  class App:
15
15
  def __init__(self,
16
16
  prompt: str = 'Enter a command',
17
- exit_command: str = 'q',
18
- ignore_exit_command_register: bool = True,
19
17
  initial_greeting: str = '\nHello, I am Argenta\n',
20
18
  farewell_message: str = '\nGoodBye\n',
19
+ exit_command: str = 'Q',
20
+ exit_command_description: str = 'Exit command',
21
+ exit_command_title: str = 'System points:',
22
+ ignore_exit_command_register: bool = True,
23
+ ignore_command_register: bool = False,
21
24
  line_separate: str = '',
22
25
  command_group_description_separate: str = '',
23
- ignore_command_register: bool = False,
26
+ repeat_command_groups: bool = True,
24
27
  print_func: Callable[[str], None] = print) -> None:
25
28
  self.prompt = prompt
26
29
  self.print_func = print_func
27
30
  self.exit_command = exit_command
31
+ self.exit_command_description = exit_command_description
32
+ self.exit_command_title = exit_command_title
28
33
  self.ignore_exit_command_register = ignore_exit_command_register
29
34
  self.farewell_message = farewell_message
30
35
  self.initial_greeting = initial_greeting
31
36
  self.line_separate = line_separate
32
37
  self.command_group_description_separate = command_group_description_separate
33
38
  self.ignore_command_register = ignore_command_register
39
+ self.repeat_command_groups = repeat_command_groups
34
40
 
35
41
  self._routers: list[Router] = []
36
42
  self._registered_router_entities: list[dict[str, str | list[dict[str, Callable[[], None] | str]] | Router]] = []
@@ -46,8 +52,14 @@ class App:
46
52
 
47
53
  self.print_func(self.initial_greeting)
48
54
 
49
- while True:
55
+ if not self.repeat_command_groups:
50
56
  self._print_command_group_description()
57
+ if self.repeat_command_groups:
58
+ self.print_func(self.prompt)
59
+
60
+ while True:
61
+ if self.repeat_command_groups:
62
+ self._print_command_group_description()
51
63
  self.print_func(self.prompt)
52
64
 
53
65
  command: str = input()
@@ -177,6 +189,14 @@ class App:
177
189
  )
178
190
  self.print_func(self.command_group_description_separate)
179
191
 
192
+ self.print_func(self.exit_command_title)
193
+ self.print_func(self._description_message_pattern.format(
194
+ command=self.exit_command,
195
+ description=self.exit_command_description
196
+ )
197
+ )
198
+ self.print_func(self.command_group_description_separate)
199
+
180
200
 
181
201
  def include_router(self, router: Router, is_main: True | False = False) -> None:
182
202
  if not isinstance(router, Router):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: argenta
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: python library for creating cli apps
5
5
  License: MIT
6
6
  Author: kolo
@@ -1,11 +1,11 @@
1
1
  argenta/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  argenta/app/__init__.py,sha256=WGPNy7LzkE6vjgRIITFYuJIB96vgDMFPRLOh4SV3R3E,443
3
- argenta/app/entity.py,sha256=5-qTMxxWRpN5AkfJDCTzaZ7yvZf1PWW_S17ShIzdr9s,8569
3
+ argenta/app/entity.py,sha256=6EufZeJBctdsID5lExFvxUKw-lf8Nd8N0vW3dqRQucU,9474
4
4
  argenta/app/exceptions.py,sha256=krz4CEeh7GorhV9rrv3mUmjYPYK16oYN6I-LJ1-Bz4k,2058
5
5
  argenta/router/__init__.py,sha256=gjneUFVbKVgwil8TbHRvCN89wT_U9CaakSbFmMC_fxk,227
6
6
  argenta/router/entity.py,sha256=1cI8I2ps6ZaiDZJ8Vt2PDAsVjaWPPdSVHfZk11KAPdY,4266
7
7
  argenta/router/exceptions.py,sha256=fgJEsMfdN6sjbfie8Ea9jbopF7HKQi-6vKCCRQrVlTA,543
8
- argenta-0.2.0.dist-info/LICENSE,sha256=zmqoGh2n5rReBv4s8wPxF_gZEZDgauJYSPMuPczgOiU,1082
9
- argenta-0.2.0.dist-info/METADATA,sha256=eTlehhqe2yXacQeaQWqPq7cDVm9y9Ag-lws6fjvkvg8,525
10
- argenta-0.2.0.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
11
- argenta-0.2.0.dist-info/RECORD,,
8
+ argenta-0.2.1.dist-info/LICENSE,sha256=zmqoGh2n5rReBv4s8wPxF_gZEZDgauJYSPMuPczgOiU,1082
9
+ argenta-0.2.1.dist-info/METADATA,sha256=ShrLAkL-AeIygQ4qCqmPgb1FBYSzhx7u-U0elRNExRQ,525
10
+ argenta-0.2.1.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
11
+ argenta-0.2.1.dist-info/RECORD,,