argenta 0.5.0b2__py3-none-any.whl → 1.0.0a0__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/autocompleter/entity.py +32 -7
- argenta/app/defaults.py +4 -1
- argenta/app/dividing_line/models.py +55 -11
- argenta/app/exceptions.py +4 -6
- argenta/app/models.py +231 -105
- argenta/app/registered_routers/entity.py +21 -2
- argenta/command/exceptions.py +12 -0
- argenta/command/flag/defaults.py +4 -1
- argenta/command/flag/models.py +84 -6
- argenta/command/models.py +59 -7
- argenta/orchestrator/__init__.py +4 -0
- argenta/orchestrator/argparser/__init__.py +4 -0
- argenta/orchestrator/argparser/arguments/__init__.py +6 -0
- argenta/orchestrator/argparser/arguments/models.py +55 -0
- argenta/orchestrator/argparser/entity.py +49 -0
- argenta/orchestrator/entity.py +36 -0
- argenta/router/command_handler/entity.py +63 -5
- argenta/router/defaults.py +1 -2
- argenta/router/entity.py +99 -39
- argenta/router/exceptions.py +16 -1
- argenta-1.0.0a0.dist-info/METADATA +1438 -0
- argenta-1.0.0a0.dist-info/RECORD +33 -0
- {argenta-0.5.0b2.dist-info → argenta-1.0.0a0.dist-info}/WHEEL +1 -1
- argenta/router/command_handlers/__init__.py +0 -0
- argenta/router/command_handlers/entity.py +0 -21
- argenta-0.5.0b2.dist-info/METADATA +0 -601
- argenta-0.5.0b2.dist-info/RECORD +0 -29
- {argenta-0.5.0b2.dist-info → argenta-1.0.0a0.dist-info/licenses}/LICENSE +0 -0
@@ -0,0 +1,1438 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: argenta
|
3
|
+
Version: 1.0.0a0
|
4
|
+
Summary: Python library for creating TUI
|
5
|
+
Author-email: kolo <kolo.is.main@gmail.com>
|
6
|
+
License: MIT
|
7
|
+
License-File: LICENSE
|
8
|
+
Requires-Python: <4.0,>=3.11
|
9
|
+
Requires-Dist: art<7.0,>=6.4
|
10
|
+
Requires-Dist: pyreadline3<4.0.0,>=3.5.4
|
11
|
+
Requires-Dist: rich<15.0.0,>=14.0.0
|
12
|
+
Description-Content-Type: text/markdown
|
13
|
+
|
14
|
+
# Argenta
|
15
|
+
|
16
|
+
### Python library for creating TUI
|
17
|
+
|
18
|
+
---
|
19
|
+
|
20
|
+
<details>
|
21
|
+
|
22
|
+
<summary>Contents</summary>
|
23
|
+
|
24
|
+
- [**Installing**](#installing)
|
25
|
+
- [**Quick Start**](#quick-start)
|
26
|
+
- [**Documentation**](#documentation)
|
27
|
+
- [**App** Objects](#app-objects)
|
28
|
+
- [set\_description\_message\_pattern](#set\_description\_message\_pattern)
|
29
|
+
- [set\_invalid\_input\_flags\_handler](#set\_invalid\_input\_flags\_handler)
|
30
|
+
- [set\_repeated\_input\_flags\_handler](#set\_repeated\_input\_flags\_handler)
|
31
|
+
- [set\_unknown\_command\_handler](#set\_unknown\_command\_handler)
|
32
|
+
- [set\_empty\_command\_handler](#set\_empty\_command\_handler)
|
33
|
+
- [set\_exit\_command\_handler](#set\_exit\_command\_handler)
|
34
|
+
- [run\_polling](#run\_polling)
|
35
|
+
- [include\_router](#include\_router)
|
36
|
+
- [include\_routers](#include\_routers)
|
37
|
+
- [add\_message\_on\_startup](#add\_message\_on\_startup)
|
38
|
+
- [**AutoCompleter** Objects](#autocompleter-objects)
|
39
|
+
- [**PredefinedMessages** Objects](#predefinedmessages-objects)
|
40
|
+
- [**StaticDividingLine** Objects](#staticdividingline-objects)
|
41
|
+
- [get\_full\_static\_line](#get\_full\_static\_line)
|
42
|
+
- [**DynamicDividingLine** Objects](#dynamicdividingline-objects)
|
43
|
+
- [get\_full\_dynamic\_line](#get\_full\_dynamic\_line)
|
44
|
+
- [**NoRegisteredHandlersException** Objects](#noregisteredhandlersexception-objects)
|
45
|
+
- [**UnprocessedInputFlagException** Objects](#unprocessedinputflagexception-objects)
|
46
|
+
- [**RepeatedInputFlagsException** Objects](#repeatedinputflagsexception-objects)
|
47
|
+
- [**EmptyInputCommandException** Objects](#emptyinputcommandexception-objects)
|
48
|
+
- [**PredefinedFlags** Objects](#predefinedflags-objects)
|
49
|
+
- [**InputFlag** Objects](#inputflag-objects)
|
50
|
+
- [get\_value](#get\_value)
|
51
|
+
- [**Flag** Objects](#flag-objects)
|
52
|
+
- [**Flags** Objects](#flags-objects)
|
53
|
+
- [get\_flags](#get\_flags)
|
54
|
+
- [add\_flag](#add\_flag)
|
55
|
+
- [add\_flags](#add\_flags)
|
56
|
+
- [get\_flag](#get\_flag)
|
57
|
+
- [**InputFlags** Objects](#inputflags-objects)
|
58
|
+
- [get\_flags](#get\_flags)
|
59
|
+
- [add\_flag](#add\_flag)
|
60
|
+
- [add\_flags](#add\_flags)
|
61
|
+
- [get\_flag](#get\_flag)
|
62
|
+
- [**Command** Objects](#command-objects)
|
63
|
+
- [**PositionalArgument** Objects](#positionalargument-objects)
|
64
|
+
- [**OptionalArgument** Objects](#optionalargument-objects)
|
65
|
+
- [**BooleanArgument** Objects](#booleanargument-objects)
|
66
|
+
- [**ArgParse** Objects](#argparse-objects)
|
67
|
+
- [set\_args](#set\_args)
|
68
|
+
- [**Orchestrator** Objects](#orchestrator-objects)
|
69
|
+
- [start\_polling](#start\_polling)
|
70
|
+
- [get\_input\_args](#get\_input\_args)
|
71
|
+
- [**Router** Objects](#router-objects)
|
72
|
+
- [@command](#@command)
|
73
|
+
- [set\_invalid\_input\_flag\_handler](#set\_invalid\_input\_flag\_handler)
|
74
|
+
- [input\_command\_handler](#input\_command\_handler)
|
75
|
+
- [set\_command\_register\_ignore](#set\_command\_register\_ignore)
|
76
|
+
- [get\_triggers](#get\_triggers)
|
77
|
+
- [get\_aliases](#get\_aliases)
|
78
|
+
- [get\_title](#get\_title)
|
79
|
+
- [set\_title](#set\_title)
|
80
|
+
- [**RepeatedFlagNameException** Objects](#repeatedflagnameexception-objects)
|
81
|
+
- [**TooManyTransferredArgsException** Objects](#toomanytransferredargsexception-objects)
|
82
|
+
- [**RequiredArgumentNotPassedException** Objects](#requiredargumentnotpassedexception-objects)
|
83
|
+
- [**IncorrectNumberOfHandlerArgsException** Objects](#incorrectnumberofhandlerargsexception-objects)
|
84
|
+
- [**TriggerContainSpacesException** Objects](#triggercontainspacesexception-objects)
|
85
|
+
- [**Tests**](#tests)
|
86
|
+
</details>
|
87
|
+
|
88
|
+
---
|
89
|
+
|
90
|
+

|
91
|
+
An example of the TUI appearance
|
92
|
+
|
93
|
+
---
|
94
|
+
|
95
|
+
# Installing
|
96
|
+
```bash
|
97
|
+
pip install argenta
|
98
|
+
```
|
99
|
+
or
|
100
|
+
```bash
|
101
|
+
poetry add argenta
|
102
|
+
```
|
103
|
+
|
104
|
+
---
|
105
|
+
|
106
|
+
# Quick start
|
107
|
+
|
108
|
+
Example of the simplest TUI with a single command
|
109
|
+
```python
|
110
|
+
# routers.py
|
111
|
+
from argenta.router import Router
|
112
|
+
from argenta.command import Command
|
113
|
+
|
114
|
+
|
115
|
+
router = Router()
|
116
|
+
|
117
|
+
@router.command(Command("hello"))
|
118
|
+
def handler():
|
119
|
+
print("Hello, world!")
|
120
|
+
```
|
121
|
+
|
122
|
+
```python
|
123
|
+
# main.py
|
124
|
+
from argenta.app import App
|
125
|
+
from argenta.orchestrator import Orchestrator
|
126
|
+
from routers import router
|
127
|
+
|
128
|
+
app: App = App()
|
129
|
+
orchestrator: Orchestrator = Orchestrator()
|
130
|
+
|
131
|
+
|
132
|
+
def main() -> None:
|
133
|
+
app.include_router(router)
|
134
|
+
orchestrator.start_polling(app)
|
135
|
+
|
136
|
+
|
137
|
+
if __name__ == '__main__':
|
138
|
+
main()
|
139
|
+
```
|
140
|
+
Example TUI with a command that has processed flags
|
141
|
+
|
142
|
+
```python
|
143
|
+
# routers.py
|
144
|
+
import re
|
145
|
+
from argenta.router import Router
|
146
|
+
from argenta.command import Command
|
147
|
+
from argenta.orchestrator import Orchestrator
|
148
|
+
from argenta.command.flag.defaults import PredefinedFlags
|
149
|
+
from argenta.command.flag import Flags, Flag, InputFlags
|
150
|
+
|
151
|
+
router = Router()
|
152
|
+
|
153
|
+
registered_flags = Flags(PredefinedFlags.HOST,
|
154
|
+
Flag('port', '--', re.compile(r'^[0-9]{1,4}$')))
|
155
|
+
|
156
|
+
|
157
|
+
@router.command(Command("hello"))
|
158
|
+
def handler():
|
159
|
+
print("Hello, world!")
|
160
|
+
|
161
|
+
|
162
|
+
@router.command(Command(trigger="ssh",
|
163
|
+
description='connect via ssh',
|
164
|
+
flags=registered_flags))
|
165
|
+
def handler_with_flags(flags: InputFlags):
|
166
|
+
for flag in flags:
|
167
|
+
print(f'Flag name: {flag.get_name()}\n'
|
168
|
+
f'Flag value: {flag.get_value()}')
|
169
|
+
```
|
170
|
+
|
171
|
+
---
|
172
|
+
|
173
|
+
# Documentation
|
174
|
+
|
175
|
+
<a id="argenta.app.models"></a>
|
176
|
+
|
177
|
+
# `.app`
|
178
|
+
|
179
|
+
<a id="argenta.app.models.App"></a>
|
180
|
+
|
181
|
+
## App Objects
|
182
|
+
|
183
|
+
```python
|
184
|
+
class App(BaseApp)
|
185
|
+
```
|
186
|
+
|
187
|
+
<a id="argenta.app.models.App.__init__"></a>
|
188
|
+
|
189
|
+
#### \_\_init\_\_
|
190
|
+
|
191
|
+
```python
|
192
|
+
def __init__(prompt: str = '[italic dim bold]What do you want to do?\n',
|
193
|
+
initial_message: str = '\nArgenta\n',
|
194
|
+
farewell_message: str = '\nSee you\n',
|
195
|
+
exit_command: Command = Command('Q', 'Exit command'),
|
196
|
+
system_router_title: str | None = 'System points:',
|
197
|
+
ignore_command_register: bool = True,
|
198
|
+
dividing_line: StaticDividingLine | DynamicDividingLine = StaticDividingLine(),
|
199
|
+
repeat_command_groups: bool = True,
|
200
|
+
override_system_messages: bool = False,
|
201
|
+
autocompleter: AutoCompleter = AutoCompleter(),
|
202
|
+
print_func: Callable[[str], None] = Console().print) -> None
|
203
|
+
```
|
204
|
+
|
205
|
+
Public. The essence of the application itself.
|
206
|
+
|
207
|
+
Configures and manages all aspects of the behavior and presentation of the user interacting with the user
|
208
|
+
|
209
|
+
**Arguments**:
|
210
|
+
|
211
|
+
- `prompt`: displayed before entering the command
|
212
|
+
- `initial_message`: displayed at the start of the app
|
213
|
+
- `farewell_message`: displayed at the end of the app
|
214
|
+
- `exit_command`: the entity of the command that will be terminated when entered
|
215
|
+
- `system_router_title`: system router title
|
216
|
+
- `ignore_command_register`: whether to ignore the case of the entered commands
|
217
|
+
- `dividing_line`: the entity of the dividing line
|
218
|
+
- `repeat_command_groups`: whether to repeat the available commands and their description
|
219
|
+
- `override_system_messages`: whether to redefine the default formatting of system messages
|
220
|
+
- `autocompleter`: the entity of the autocompleter
|
221
|
+
- `print_func`: system messages text output function
|
222
|
+
|
223
|
+
**Returns**:
|
224
|
+
|
225
|
+
`None`
|
226
|
+
|
227
|
+
---
|
228
|
+
|
229
|
+
<a id="argenta.app.models.BaseApp.set_description_message_pattern"></a>
|
230
|
+
|
231
|
+
#### set\_description\_message\_pattern
|
232
|
+
|
233
|
+
```python
|
234
|
+
def set_description_message_pattern(
|
235
|
+
pattern: Callable[[str, str], str]) -> None
|
236
|
+
```
|
237
|
+
|
238
|
+
Public. Sets the output pattern of the available commands
|
239
|
+
|
240
|
+
**Arguments**:
|
241
|
+
|
242
|
+
- `pattern`: output pattern of the available commands
|
243
|
+
|
244
|
+
**Returns**:
|
245
|
+
|
246
|
+
`None`
|
247
|
+
|
248
|
+
---
|
249
|
+
|
250
|
+
<a id="argenta.app.models.BaseApp.set_invalid_input_flags_handler"></a>
|
251
|
+
|
252
|
+
#### set\_invalid\_input\_flags\_handler
|
253
|
+
|
254
|
+
```python
|
255
|
+
def set_invalid_input_flags_handler(handler: Callable[[str], None]) -> None
|
256
|
+
```
|
257
|
+
|
258
|
+
Public. Sets the handler for incorrect flags when entering a command
|
259
|
+
|
260
|
+
**Arguments**:
|
261
|
+
|
262
|
+
- `handler`: handler for incorrect flags when entering a command
|
263
|
+
|
264
|
+
**Returns**:
|
265
|
+
|
266
|
+
`None`
|
267
|
+
|
268
|
+
---
|
269
|
+
|
270
|
+
<a id="argenta.app.models.BaseApp.set_repeated_input_flags_handler"></a>
|
271
|
+
|
272
|
+
#### set\_repeated\_input\_flags\_handler
|
273
|
+
|
274
|
+
```python
|
275
|
+
def set_repeated_input_flags_handler(handler: Callable[[str], None]) -> None
|
276
|
+
```
|
277
|
+
|
278
|
+
Public. Sets the handler for repeated flags when entering a command
|
279
|
+
|
280
|
+
**Arguments**:
|
281
|
+
|
282
|
+
- `handler`: handler for repeated flags when entering a command
|
283
|
+
|
284
|
+
**Returns**:
|
285
|
+
|
286
|
+
`None`
|
287
|
+
|
288
|
+
---
|
289
|
+
|
290
|
+
<a id="argenta.app.models.BaseApp.set_unknown_command_handler"></a>
|
291
|
+
|
292
|
+
#### set\_unknown\_command\_handler
|
293
|
+
|
294
|
+
```python
|
295
|
+
def set_unknown_command_handler(handler: Callable[[str], None]) -> None
|
296
|
+
```
|
297
|
+
|
298
|
+
Public. Sets the handler for unknown commands when entering a command
|
299
|
+
|
300
|
+
**Arguments**:
|
301
|
+
|
302
|
+
- `handler`: handler for unknown commands when entering a command
|
303
|
+
|
304
|
+
**Returns**:
|
305
|
+
|
306
|
+
`None`
|
307
|
+
|
308
|
+
---
|
309
|
+
|
310
|
+
<a id="argenta.app.models.BaseApp.set_empty_command_handler"></a>
|
311
|
+
|
312
|
+
#### set\_empty\_command\_handler
|
313
|
+
|
314
|
+
```python
|
315
|
+
def set_empty_command_handler(handler: Callable[[], None]) -> None
|
316
|
+
```
|
317
|
+
|
318
|
+
Public. Sets the handler for empty commands when entering a command
|
319
|
+
|
320
|
+
**Arguments**:
|
321
|
+
|
322
|
+
- `handler`: handler for empty commands when entering a command
|
323
|
+
|
324
|
+
**Returns**:
|
325
|
+
|
326
|
+
`None`
|
327
|
+
|
328
|
+
---
|
329
|
+
|
330
|
+
<a id="argenta.app.models.BaseApp.set_exit_command_handler"></a>
|
331
|
+
|
332
|
+
#### set\_exit\_command\_handler
|
333
|
+
|
334
|
+
```python
|
335
|
+
def set_exit_command_handler(handler: Callable[[], None]) -> None
|
336
|
+
```
|
337
|
+
|
338
|
+
Public. Sets the handler for exit command when entering a command
|
339
|
+
|
340
|
+
**Arguments**:
|
341
|
+
|
342
|
+
- `handler`: handler for exit command when entering a command
|
343
|
+
|
344
|
+
**Returns**:
|
345
|
+
|
346
|
+
`None`
|
347
|
+
|
348
|
+
---
|
349
|
+
|
350
|
+
<a id="argenta.app.models.App.run_polling"></a>
|
351
|
+
|
352
|
+
#### run\_polling
|
353
|
+
|
354
|
+
```python
|
355
|
+
def run_polling() -> None
|
356
|
+
```
|
357
|
+
|
358
|
+
Private. Starts the user input processing cycle
|
359
|
+
|
360
|
+
**Returns**:
|
361
|
+
|
362
|
+
`None`
|
363
|
+
|
364
|
+
---
|
365
|
+
|
366
|
+
<a id="argenta.app.models.App.include_router"></a>
|
367
|
+
|
368
|
+
#### include\_router
|
369
|
+
|
370
|
+
```python
|
371
|
+
def include_router(router: Router) -> None
|
372
|
+
```
|
373
|
+
|
374
|
+
Public. Registers the router in the application
|
375
|
+
|
376
|
+
**Arguments**:
|
377
|
+
|
378
|
+
- `router`: registered router
|
379
|
+
|
380
|
+
**Returns**:
|
381
|
+
|
382
|
+
`None`
|
383
|
+
|
384
|
+
---
|
385
|
+
|
386
|
+
<a id="argenta.app.models.App.include_routers"></a>
|
387
|
+
|
388
|
+
#### include\_routers
|
389
|
+
|
390
|
+
```python
|
391
|
+
def include_routers(*routers: Router) -> None
|
392
|
+
```
|
393
|
+
|
394
|
+
Public. Registers the routers in the application
|
395
|
+
|
396
|
+
**Arguments**:
|
397
|
+
|
398
|
+
- `routers`: registered routers
|
399
|
+
|
400
|
+
**Returns**:
|
401
|
+
|
402
|
+
`None`
|
403
|
+
|
404
|
+
---
|
405
|
+
|
406
|
+
<a id="argenta.app.models.App.add_message_on_startup"></a>
|
407
|
+
|
408
|
+
#### add\_message\_on\_startup
|
409
|
+
|
410
|
+
```python
|
411
|
+
def add_message_on_startup(message: str) -> None
|
412
|
+
```
|
413
|
+
|
414
|
+
Public. Adds a message that will be displayed when the application is launched
|
415
|
+
|
416
|
+
**Arguments**:
|
417
|
+
|
418
|
+
- `message`: the message being added
|
419
|
+
|
420
|
+
**Returns**:
|
421
|
+
|
422
|
+
`None`
|
423
|
+
|
424
|
+
---
|
425
|
+
|
426
|
+
<a id="argenta.app.autocompleter.entity"></a>
|
427
|
+
|
428
|
+
# `.app.autocompleter`
|
429
|
+
|
430
|
+
<a id="argenta.app.autocompleter.entity.AutoCompleter"></a>
|
431
|
+
|
432
|
+
## AutoCompleter Objects
|
433
|
+
|
434
|
+
```python
|
435
|
+
class AutoCompleter()
|
436
|
+
```
|
437
|
+
|
438
|
+
<a id="argenta.app.autocompleter.entity.AutoCompleter.__init__"></a>
|
439
|
+
|
440
|
+
#### \_\_init\_\_
|
441
|
+
|
442
|
+
```python
|
443
|
+
def __init__(history_filename: str = False,
|
444
|
+
autocomplete_button: str = 'tab') -> None
|
445
|
+
```
|
446
|
+
|
447
|
+
Public. Configures and implements auto-completion of input command
|
448
|
+
|
449
|
+
**Arguments**:
|
450
|
+
|
451
|
+
- `history_filename`: the name of the file for saving the history of the autocompleter
|
452
|
+
- `autocomplete_button`: the button for auto-completion
|
453
|
+
|
454
|
+
**Returns**:
|
455
|
+
|
456
|
+
`None`
|
457
|
+
|
458
|
+
---
|
459
|
+
|
460
|
+
<a id="argenta.app.defaults"></a>
|
461
|
+
|
462
|
+
# `.app.defaults`
|
463
|
+
|
464
|
+
<a id="argenta.app.defaults.PredefinedMessages"></a>
|
465
|
+
|
466
|
+
## PredefinedMessages Objects
|
467
|
+
|
468
|
+
```python
|
469
|
+
@dataclass
|
470
|
+
class PredefinedMessages()
|
471
|
+
```
|
472
|
+
|
473
|
+
Public. A dataclass with predetermined messages for quick use
|
474
|
+
|
475
|
+
---
|
476
|
+
|
477
|
+
<a id="argenta.app.dividing_line.models"></a>
|
478
|
+
|
479
|
+
# `.app.dividing_line`
|
480
|
+
|
481
|
+
<a id="argenta.app.dividing_line.models.StaticDividingLine"></a>
|
482
|
+
|
483
|
+
## StaticDividingLine Objects
|
484
|
+
|
485
|
+
```python
|
486
|
+
class StaticDividingLine(BaseDividingLine)
|
487
|
+
```
|
488
|
+
|
489
|
+
<a id="argenta.app.dividing_line.models.StaticDividingLine.__init__"></a>
|
490
|
+
|
491
|
+
#### \_\_init\_\_
|
492
|
+
|
493
|
+
```python
|
494
|
+
def __init__(unit_part: str = '-', length: int = 25) -> None
|
495
|
+
```
|
496
|
+
|
497
|
+
Public. The static dividing line
|
498
|
+
|
499
|
+
**Arguments**:
|
500
|
+
|
501
|
+
- `unit_part`: the single part of the dividing line
|
502
|
+
- `length`: the length of the dividing line
|
503
|
+
|
504
|
+
**Returns**:
|
505
|
+
|
506
|
+
`None`
|
507
|
+
|
508
|
+
---
|
509
|
+
|
510
|
+
<a id="argenta.app.dividing_line.models.StaticDividingLine.get_full_static_line"></a>
|
511
|
+
|
512
|
+
#### get\_full\_static\_line
|
513
|
+
|
514
|
+
```python
|
515
|
+
def get_full_static_line(is_override: bool) -> str
|
516
|
+
```
|
517
|
+
|
518
|
+
Private. Returns the full line of the dividing line
|
519
|
+
|
520
|
+
**Arguments**:
|
521
|
+
|
522
|
+
- `is_override`: has the default text layout been redefined
|
523
|
+
|
524
|
+
**Returns**:
|
525
|
+
|
526
|
+
full line of dividing line as str
|
527
|
+
|
528
|
+
---
|
529
|
+
|
530
|
+
<a id="argenta.app.dividing_line.models.DynamicDividingLine"></a>
|
531
|
+
|
532
|
+
## DynamicDividingLine Objects
|
533
|
+
|
534
|
+
```python
|
535
|
+
class DynamicDividingLine(BaseDividingLine)
|
536
|
+
```
|
537
|
+
|
538
|
+
<a id="argenta.app.dividing_line.models.DynamicDividingLine.__init__"></a>
|
539
|
+
|
540
|
+
#### \_\_init\_\_
|
541
|
+
|
542
|
+
```python
|
543
|
+
def __init__(unit_part: str = '-') -> None
|
544
|
+
```
|
545
|
+
|
546
|
+
Public. The dynamic dividing line
|
547
|
+
|
548
|
+
**Arguments**:
|
549
|
+
|
550
|
+
- `unit_part`: the single part of the dividing line
|
551
|
+
|
552
|
+
**Returns**:
|
553
|
+
|
554
|
+
`None`
|
555
|
+
|
556
|
+
---
|
557
|
+
|
558
|
+
<a id="argenta.app.dividing_line.models.DynamicDividingLine.get_full_dynamic_line"></a>
|
559
|
+
|
560
|
+
#### get\_full\_dynamic\_line
|
561
|
+
|
562
|
+
```python
|
563
|
+
def get_full_dynamic_line(length: int, is_override: bool) -> str
|
564
|
+
```
|
565
|
+
|
566
|
+
Private. Returns the full line of the dividing line
|
567
|
+
|
568
|
+
**Arguments**:
|
569
|
+
|
570
|
+
- `length`: the length of the dividing line
|
571
|
+
- `is_override`: has the default text layout been redefined
|
572
|
+
|
573
|
+
**Returns**:
|
574
|
+
|
575
|
+
full line of dividing line as str
|
576
|
+
|
577
|
+
---
|
578
|
+
|
579
|
+
<a id="argenta.app.exceptions"></a>
|
580
|
+
|
581
|
+
# `.app.exceptions`
|
582
|
+
|
583
|
+
<a id="argenta.app.exceptions.NoRegisteredHandlersException"></a>
|
584
|
+
|
585
|
+
## NoRegisteredHandlersException Objects
|
586
|
+
|
587
|
+
```python
|
588
|
+
class NoRegisteredHandlersException(Exception)
|
589
|
+
```
|
590
|
+
|
591
|
+
The router has no registered handlers
|
592
|
+
|
593
|
+
---
|
594
|
+
|
595
|
+
<a id="argenta.command.exceptions"></a>
|
596
|
+
|
597
|
+
# `.command.exceptions`
|
598
|
+
|
599
|
+
<a id="argenta.command.exceptions.BaseInputCommandException"></a>
|
600
|
+
|
601
|
+
## UnprocessedInputFlagException Objects
|
602
|
+
|
603
|
+
```python
|
604
|
+
class UnprocessedInputFlagException(BaseInputCommandException)
|
605
|
+
```
|
606
|
+
|
607
|
+
Private. Raised when an unprocessed input flag is detected
|
608
|
+
|
609
|
+
---
|
610
|
+
|
611
|
+
<a id="argenta.command.exceptions.RepeatedInputFlagsException"></a>
|
612
|
+
|
613
|
+
## RepeatedInputFlagsException Objects
|
614
|
+
|
615
|
+
```python
|
616
|
+
class RepeatedInputFlagsException(BaseInputCommandException)
|
617
|
+
```
|
618
|
+
|
619
|
+
Private. Raised when repeated input flags are detected
|
620
|
+
|
621
|
+
---
|
622
|
+
|
623
|
+
<a id="argenta.command.exceptions.EmptyInputCommandException"></a>
|
624
|
+
|
625
|
+
## EmptyInputCommandException Objects
|
626
|
+
|
627
|
+
```python
|
628
|
+
class EmptyInputCommandException(BaseInputCommandException)
|
629
|
+
```
|
630
|
+
|
631
|
+
Private. Raised when an empty input command is detected
|
632
|
+
|
633
|
+
---
|
634
|
+
|
635
|
+
<a id="argenta.command.flag.defaults"></a>
|
636
|
+
|
637
|
+
# `.command.flag.defaults`
|
638
|
+
|
639
|
+
<a id="argenta.command.flag.defaults.PredefinedFlags"></a>
|
640
|
+
|
641
|
+
## PredefinedFlags Objects
|
642
|
+
|
643
|
+
```python
|
644
|
+
@dataclass
|
645
|
+
class PredefinedFlags()
|
646
|
+
```
|
647
|
+
|
648
|
+
Public. A dataclass with predefined flags and most frequently used flags for quick use
|
649
|
+
|
650
|
+
---
|
651
|
+
|
652
|
+
<a id="argenta.command.flag.models"></a>
|
653
|
+
|
654
|
+
# `.command.flag`
|
655
|
+
|
656
|
+
<a id="argenta.command.flag.models.InputFlag"></a>
|
657
|
+
|
658
|
+
## InputFlag Objects
|
659
|
+
|
660
|
+
```python
|
661
|
+
class InputFlag(BaseFlag)
|
662
|
+
```
|
663
|
+
|
664
|
+
<a id="argenta.command.flag.models.InputFlag.__init__"></a>
|
665
|
+
|
666
|
+
#### \_\_init\_\_
|
667
|
+
|
668
|
+
```python
|
669
|
+
def __init__(name: str,
|
670
|
+
prefix: Literal['-', '--', '---'] = '--',
|
671
|
+
value: str = None)
|
672
|
+
```
|
673
|
+
|
674
|
+
Public. The entity of the flag of the entered command
|
675
|
+
|
676
|
+
**Arguments**:
|
677
|
+
|
678
|
+
- `name`: the name of the input flag
|
679
|
+
- `prefix`: the prefix of the input flag
|
680
|
+
- `value`: the value of the input flag
|
681
|
+
|
682
|
+
**Returns**:
|
683
|
+
|
684
|
+
`None`
|
685
|
+
|
686
|
+
---
|
687
|
+
|
688
|
+
<a id="argenta.command.flag.models.InputFlag.get_value"></a>
|
689
|
+
|
690
|
+
#### get\_value
|
691
|
+
|
692
|
+
```python
|
693
|
+
def get_value() -> str | None
|
694
|
+
```
|
695
|
+
|
696
|
+
Public. Returns the value of the flag
|
697
|
+
|
698
|
+
**Returns**:
|
699
|
+
|
700
|
+
the value of the flag as str
|
701
|
+
|
702
|
+
---
|
703
|
+
|
704
|
+
<a id="argenta.command.flag.models.Flag"></a>
|
705
|
+
|
706
|
+
## Flag Objects
|
707
|
+
|
708
|
+
```python
|
709
|
+
class Flag(BaseFlag)
|
710
|
+
```
|
711
|
+
|
712
|
+
<a id="argenta.command.flag.models.Flag.__init__"></a>
|
713
|
+
|
714
|
+
#### \_\_init\_\_
|
715
|
+
|
716
|
+
```python
|
717
|
+
def __init__(name: str,
|
718
|
+
prefix: Literal['-', '--', '---'] = '--',
|
719
|
+
possible_values: list[str] | Pattern[str] | False = True) -> None
|
720
|
+
```
|
721
|
+
|
722
|
+
Public. The entity of the flag being registered for subsequent processing
|
723
|
+
|
724
|
+
**Arguments**:
|
725
|
+
|
726
|
+
- `name`: The name of the flag
|
727
|
+
- `prefix`: The prefix of the flag
|
728
|
+
- `possible_values`: The possible values of the flag, if False then the flag cannot have a value
|
729
|
+
|
730
|
+
**Returns**:
|
731
|
+
|
732
|
+
`None`
|
733
|
+
|
734
|
+
---
|
735
|
+
|
736
|
+
<a id="argenta/command/flag/models.Flags"></a>
|
737
|
+
|
738
|
+
## Flags Objects
|
739
|
+
|
740
|
+
```python
|
741
|
+
class Flags(BaseFlags)
|
742
|
+
```
|
743
|
+
|
744
|
+
<a id="argenta/command/flag/models.Flags.__init__"></a>
|
745
|
+
|
746
|
+
#### \_\_init\_\_
|
747
|
+
|
748
|
+
```python
|
749
|
+
def __init__(*flags: Flag)
|
750
|
+
```
|
751
|
+
|
752
|
+
Public. A model that combines the registered flags
|
753
|
+
|
754
|
+
**Arguments**:
|
755
|
+
|
756
|
+
- `flags`: the flags that will be registered
|
757
|
+
|
758
|
+
**Returns**:
|
759
|
+
|
760
|
+
`None`
|
761
|
+
|
762
|
+
---
|
763
|
+
<a id="argenta.command.flag.models.BaseFlags.get_flags"></a>
|
764
|
+
|
765
|
+
#### get\_flags
|
766
|
+
|
767
|
+
```python
|
768
|
+
def get_flags() -> list[Flag]
|
769
|
+
```
|
770
|
+
|
771
|
+
Public. Returns a list of flags
|
772
|
+
|
773
|
+
**Returns**:
|
774
|
+
|
775
|
+
list of flags as list[Flag]
|
776
|
+
|
777
|
+
---
|
778
|
+
|
779
|
+
<a id="argenta.command.flag.models.BaseFlags.add_flag"></a>
|
780
|
+
|
781
|
+
#### add\_flag
|
782
|
+
|
783
|
+
```python
|
784
|
+
def add_flag(flag: Flag) -> None
|
785
|
+
```
|
786
|
+
|
787
|
+
Public. Adds a flag to the list of flags
|
788
|
+
|
789
|
+
**Arguments**:
|
790
|
+
|
791
|
+
- `flag`: flag to add
|
792
|
+
|
793
|
+
**Returns**:
|
794
|
+
|
795
|
+
`None`
|
796
|
+
|
797
|
+
---
|
798
|
+
|
799
|
+
<a id="argenta.command.flag.models.BaseFlags.add_flags"></a>
|
800
|
+
|
801
|
+
#### add\_flags
|
802
|
+
|
803
|
+
```python
|
804
|
+
def add_flags(flags: list[Flag]) -> None
|
805
|
+
```
|
806
|
+
|
807
|
+
Public. Adds a list of flags to the list of flags
|
808
|
+
|
809
|
+
**Arguments**:
|
810
|
+
|
811
|
+
- `flags`: list of flags to add
|
812
|
+
|
813
|
+
**Returns**:
|
814
|
+
|
815
|
+
`None`
|
816
|
+
|
817
|
+
---
|
818
|
+
|
819
|
+
<a id="argenta.command.flag.models.BaseFlags.get_flag"></a>
|
820
|
+
|
821
|
+
#### get\_flag
|
822
|
+
|
823
|
+
```python
|
824
|
+
def get_flag(name: str) -> Flag | None
|
825
|
+
```
|
826
|
+
|
827
|
+
Public. Returns the flag entity by its name or None if not found
|
828
|
+
|
829
|
+
**Arguments**:
|
830
|
+
|
831
|
+
- `name`: the name of the flag to get
|
832
|
+
|
833
|
+
**Returns**:
|
834
|
+
|
835
|
+
entity of the flag or None
|
836
|
+
|
837
|
+
---
|
838
|
+
|
839
|
+
<a id="argenta/command/flag/models.InputFlags"></a>
|
840
|
+
|
841
|
+
## InputFlags Objects
|
842
|
+
|
843
|
+
```python
|
844
|
+
class InputFlags(BaseFlags)
|
845
|
+
```
|
846
|
+
|
847
|
+
<a id="argenta/command/flag/models.InputFlags.__init__"></a>
|
848
|
+
|
849
|
+
#### \_\_init\_\_
|
850
|
+
|
851
|
+
```python
|
852
|
+
def __init__(*flags: InputFlag)
|
853
|
+
```
|
854
|
+
|
855
|
+
Public. A model that combines the input flags of the input command
|
856
|
+
|
857
|
+
**Arguments**:
|
858
|
+
|
859
|
+
- `flags`: all input flags
|
860
|
+
|
861
|
+
**Returns**:
|
862
|
+
|
863
|
+
`None`
|
864
|
+
|
865
|
+
---
|
866
|
+
|
867
|
+
<a id="argenta.command.flag.models.BaseFlags.get_flags"></a>
|
868
|
+
|
869
|
+
#### get\_flags
|
870
|
+
|
871
|
+
```python
|
872
|
+
def get_flags() -> list[InputFlag]
|
873
|
+
```
|
874
|
+
|
875
|
+
Public. Returns a list of flags
|
876
|
+
|
877
|
+
**Returns**:
|
878
|
+
|
879
|
+
list of flags
|
880
|
+
|
881
|
+
---
|
882
|
+
|
883
|
+
<a id="argenta.command.flag.models.BaseFlags.add_flag"></a>
|
884
|
+
|
885
|
+
#### add\_flag
|
886
|
+
|
887
|
+
```python
|
888
|
+
def add_flag(flag: InputFlag) -> None
|
889
|
+
```
|
890
|
+
|
891
|
+
Public. Adds a flag to the list of flags
|
892
|
+
|
893
|
+
**Arguments**:
|
894
|
+
|
895
|
+
- `flag`: flag to add
|
896
|
+
|
897
|
+
**Returns**:
|
898
|
+
|
899
|
+
`None`
|
900
|
+
|
901
|
+
---
|
902
|
+
|
903
|
+
<a id="argenta.command.flag.models.BaseFlags.add_flags"></a>
|
904
|
+
|
905
|
+
#### add\_flags
|
906
|
+
|
907
|
+
```python
|
908
|
+
def add_flags(flags: list[InputFlag]) -> None
|
909
|
+
```
|
910
|
+
|
911
|
+
Public. Adds a list of flags to the list of flags
|
912
|
+
|
913
|
+
**Arguments**:
|
914
|
+
|
915
|
+
- `flags`: list of flags to add
|
916
|
+
|
917
|
+
**Returns**:
|
918
|
+
|
919
|
+
`None`
|
920
|
+
|
921
|
+
---
|
922
|
+
|
923
|
+
<a id="argenta.command.flag.models.BaseFlags.get_flag"></a>
|
924
|
+
|
925
|
+
#### get\_flag
|
926
|
+
|
927
|
+
```python
|
928
|
+
def get_flag(name: str) -> InputFlag
|
929
|
+
```
|
930
|
+
|
931
|
+
Public. Returns the flag entity by its name or None if not found
|
932
|
+
|
933
|
+
**Arguments**:
|
934
|
+
|
935
|
+
- `name`: the name of the flag to get
|
936
|
+
|
937
|
+
**Returns**:
|
938
|
+
|
939
|
+
entity of the flag or None
|
940
|
+
|
941
|
+
---
|
942
|
+
|
943
|
+
<a id="argenta.command.models"></a>
|
944
|
+
|
945
|
+
# `.command.models`
|
946
|
+
|
947
|
+
<a id="argenta.command.models.Command"></a>
|
948
|
+
|
949
|
+
## Command Objects
|
950
|
+
|
951
|
+
```python
|
952
|
+
class Command(BaseCommand)
|
953
|
+
```
|
954
|
+
|
955
|
+
<a id="argenta.command.models.Command.__init__"></a>
|
956
|
+
|
957
|
+
#### \_\_init\_\_
|
958
|
+
|
959
|
+
```python
|
960
|
+
def __init__(trigger: str,
|
961
|
+
description: str = None,
|
962
|
+
flags: Flag | Flags = None,
|
963
|
+
aliases: list[str] = None)
|
964
|
+
```
|
965
|
+
|
966
|
+
Public. The command that can and should be registered in the Router
|
967
|
+
|
968
|
+
**Arguments**:
|
969
|
+
|
970
|
+
- `trigger`: A string trigger, which, when entered by the user, indicates that the input corresponds to the command
|
971
|
+
- `description`: the description of the command
|
972
|
+
- `flags`: processed commands
|
973
|
+
- `aliases`: string synonyms for the main trigger
|
974
|
+
|
975
|
+
---
|
976
|
+
|
977
|
+
<a id="argenta.orchestrator.argparse.arguments.models"></a>
|
978
|
+
|
979
|
+
# `.orchestrator.argparse.arguments`
|
980
|
+
|
981
|
+
<a id="argenta.orchestrator.argparse.arguments.models.PositionalArgument"></a>
|
982
|
+
|
983
|
+
## PositionalArgument Objects
|
984
|
+
|
985
|
+
```python
|
986
|
+
class PositionalArgument(BaseArgument)
|
987
|
+
```
|
988
|
+
|
989
|
+
<a id="argenta.orchestrator.argparse.arguments.models.PositionalArgument.__init__"></a>
|
990
|
+
|
991
|
+
#### \_\_init\_\_
|
992
|
+
|
993
|
+
```python
|
994
|
+
def __init__(name: str)
|
995
|
+
```
|
996
|
+
|
997
|
+
Public. Required argument at startup
|
998
|
+
|
999
|
+
**Arguments**:
|
1000
|
+
|
1001
|
+
- `name`: name of the argument, must not start with minus (-)
|
1002
|
+
|
1003
|
+
---
|
1004
|
+
|
1005
|
+
<a id="argenta.orchestrator.argparse.arguments.models.OptionalArgument"></a>
|
1006
|
+
|
1007
|
+
## OptionalArgument Objects
|
1008
|
+
|
1009
|
+
```python
|
1010
|
+
class OptionalArgument(BaseArgument)
|
1011
|
+
```
|
1012
|
+
|
1013
|
+
<a id="argenta.orchestrator.argparse.arguments.models.OptionalArgument.__init__"></a>
|
1014
|
+
|
1015
|
+
#### \_\_init\_\_
|
1016
|
+
|
1017
|
+
```python
|
1018
|
+
def __init__(name: str, prefix: Literal['-', '--', '---'] = '--')
|
1019
|
+
```
|
1020
|
+
|
1021
|
+
Public. Optional argument, must have the value
|
1022
|
+
|
1023
|
+
**Arguments**:
|
1024
|
+
|
1025
|
+
- `name`: name of the argument
|
1026
|
+
- `prefix`: prefix of the argument
|
1027
|
+
|
1028
|
+
---
|
1029
|
+
|
1030
|
+
<a id="argenta.orchestrator.argparse.arguments.models.BooleanArgument"></a>
|
1031
|
+
|
1032
|
+
## BooleanArgument Objects
|
1033
|
+
|
1034
|
+
```python
|
1035
|
+
class BooleanArgument(BaseArgument)
|
1036
|
+
```
|
1037
|
+
|
1038
|
+
<a id="argenta.orchestrator.argparse.arguments.models.BooleanArgument.__init__"></a>
|
1039
|
+
|
1040
|
+
#### \_\_init\_\_
|
1041
|
+
|
1042
|
+
```python
|
1043
|
+
def __init__(name: str,
|
1044
|
+
prefix: Literal['-', '--', '---'] = '--')
|
1045
|
+
```
|
1046
|
+
|
1047
|
+
Public. Boolean argument, does not require a value
|
1048
|
+
|
1049
|
+
**Arguments**:
|
1050
|
+
|
1051
|
+
- `name`: name of the argument
|
1052
|
+
- `prefix`: prefix of the argument
|
1053
|
+
|
1054
|
+
---
|
1055
|
+
|
1056
|
+
<a id="argenta.orchestrator.argparse.entity"></a>
|
1057
|
+
|
1058
|
+
# `.orchestrator.argparser`
|
1059
|
+
|
1060
|
+
<a id="argenta.orchestrator.argparse.entity.ArgParser"></a>
|
1061
|
+
|
1062
|
+
## ArgParse Objects
|
1063
|
+
|
1064
|
+
```python
|
1065
|
+
class ArgParse()
|
1066
|
+
```
|
1067
|
+
|
1068
|
+
<a id="argenta.orchestrator.argparse.entity.ArgParse.__init__"></a>
|
1069
|
+
|
1070
|
+
#### \_\_init\_\_
|
1071
|
+
|
1072
|
+
```python
|
1073
|
+
def __init__(processed_args: list[PositionalArgument | OptionalArgument | BooleanArgument],
|
1074
|
+
name: str = 'Argenta',
|
1075
|
+
description: str = 'Argenta available arguments',
|
1076
|
+
epilog: str = 'github.com/koloideal/Argenta | made by kolo') -> None
|
1077
|
+
```
|
1078
|
+
|
1079
|
+
Public. Cmd argument parser and configurator at startup
|
1080
|
+
|
1081
|
+
**Arguments**:
|
1082
|
+
|
1083
|
+
- `name`: the name of the ArgParse instance
|
1084
|
+
- `description`: the description of the ArgParse instance
|
1085
|
+
- `epilog`: the epilog of the ArgParse instance
|
1086
|
+
- `processed_args`: registered and processed arguments
|
1087
|
+
|
1088
|
+
---
|
1089
|
+
|
1090
|
+
<a id="argenta.orchestrator.argparse.entity.ArgParse.set_args"></a>
|
1091
|
+
|
1092
|
+
#### set\_args
|
1093
|
+
|
1094
|
+
```python
|
1095
|
+
def set_args(*args: PositionalArgument | OptionalArgument | BooleanArgument) -> None
|
1096
|
+
```
|
1097
|
+
|
1098
|
+
Public. Sets the arguments to be processed
|
1099
|
+
|
1100
|
+
**Arguments**:
|
1101
|
+
|
1102
|
+
- `args`: processed arguments
|
1103
|
+
|
1104
|
+
**Returns**:
|
1105
|
+
|
1106
|
+
`None`
|
1107
|
+
|
1108
|
+
---
|
1109
|
+
|
1110
|
+
# `.orchestrator`
|
1111
|
+
|
1112
|
+
<a id="argenta.orchestrator.entity.Orchestrator"></a>
|
1113
|
+
|
1114
|
+
## Orchestrator Objects
|
1115
|
+
|
1116
|
+
```python
|
1117
|
+
class Orchestrator()
|
1118
|
+
```
|
1119
|
+
|
1120
|
+
<a id="argenta.orchestrator.entity.Orchestrator.__init__"></a>
|
1121
|
+
|
1122
|
+
#### \_\_init\_\_
|
1123
|
+
|
1124
|
+
```python
|
1125
|
+
def __init__(arg_parser: ArgParse = False)
|
1126
|
+
```
|
1127
|
+
|
1128
|
+
Public. An orchestrator and configurator that defines the behavior of an integrated system, one level higher than the App
|
1129
|
+
|
1130
|
+
**Arguments**:
|
1131
|
+
|
1132
|
+
- `arg_parser`: Cmd argument parser and configurator at startup
|
1133
|
+
|
1134
|
+
**Returns**:
|
1135
|
+
|
1136
|
+
`None`
|
1137
|
+
|
1138
|
+
---
|
1139
|
+
|
1140
|
+
<a id="argenta.orchestrator.entity.Orchestrator.start_polling"></a>
|
1141
|
+
|
1142
|
+
#### start\_polling
|
1143
|
+
|
1144
|
+
```python
|
1145
|
+
@staticmethod
|
1146
|
+
def start_polling(app: App) -> None
|
1147
|
+
```
|
1148
|
+
|
1149
|
+
Public. Starting the user input processing cycle
|
1150
|
+
|
1151
|
+
**Arguments**:
|
1152
|
+
|
1153
|
+
- `app`: a running application
|
1154
|
+
|
1155
|
+
**Returns**:
|
1156
|
+
|
1157
|
+
`None`
|
1158
|
+
|
1159
|
+
---
|
1160
|
+
|
1161
|
+
<a id="argenta.orchestrator.entity.Orchestrator.get_input_args"></a>
|
1162
|
+
|
1163
|
+
#### get\_input\_args
|
1164
|
+
|
1165
|
+
```python
|
1166
|
+
def get_input_args() -> Namespace | None
|
1167
|
+
```
|
1168
|
+
|
1169
|
+
Public. Returns the arguments parsed
|
1170
|
+
|
1171
|
+
**Returns**:
|
1172
|
+
|
1173
|
+
`None`
|
1174
|
+
|
1175
|
+
---
|
1176
|
+
|
1177
|
+
<a id="argenta.router.entity"></a>
|
1178
|
+
|
1179
|
+
# `.router`
|
1180
|
+
|
1181
|
+
<a id="argenta.router.entity.Router"></a>
|
1182
|
+
|
1183
|
+
## Router Objects
|
1184
|
+
|
1185
|
+
```python
|
1186
|
+
class Router()
|
1187
|
+
```
|
1188
|
+
|
1189
|
+
<a id="argenta.router.entity.Router.__init__"></a>
|
1190
|
+
|
1191
|
+
#### \_\_init\_\_
|
1192
|
+
|
1193
|
+
```python
|
1194
|
+
def __init__(title: str = None)
|
1195
|
+
```
|
1196
|
+
|
1197
|
+
Public. Directly configures and manages handlers
|
1198
|
+
|
1199
|
+
**Arguments**:
|
1200
|
+
|
1201
|
+
- `title`: the title of the router, displayed when displaying the available commands
|
1202
|
+
|
1203
|
+
**Returns**:
|
1204
|
+
|
1205
|
+
`None`
|
1206
|
+
|
1207
|
+
---
|
1208
|
+
|
1209
|
+
<a id="argenta.router.entity.Router.command"></a>
|
1210
|
+
|
1211
|
+
#### @command
|
1212
|
+
|
1213
|
+
```python
|
1214
|
+
def command(command: Command) -> Callable
|
1215
|
+
```
|
1216
|
+
|
1217
|
+
Public. Registers handler
|
1218
|
+
|
1219
|
+
**Arguments**:
|
1220
|
+
|
1221
|
+
- `command`: Registered command
|
1222
|
+
|
1223
|
+
**Returns**:
|
1224
|
+
|
1225
|
+
decorated handler as Callable[[Any], Any]
|
1226
|
+
|
1227
|
+
---
|
1228
|
+
|
1229
|
+
<a id="argenta.router.entity.Router.set_invalid_input_flag_handler"></a>
|
1230
|
+
|
1231
|
+
#### set\_invalid\_input\_flag\_handler
|
1232
|
+
|
1233
|
+
```python
|
1234
|
+
def set_invalid_input_flag_handler(func) -> None
|
1235
|
+
```
|
1236
|
+
|
1237
|
+
Public. Registers handler for invalid input flag
|
1238
|
+
|
1239
|
+
**Arguments**:
|
1240
|
+
|
1241
|
+
- `func`: registered handler
|
1242
|
+
|
1243
|
+
**Returns**:
|
1244
|
+
|
1245
|
+
`None`
|
1246
|
+
|
1247
|
+
---
|
1248
|
+
|
1249
|
+
<a id="argenta.router.entity.Router.input_command_handler"></a>
|
1250
|
+
|
1251
|
+
#### input\_command\_handler
|
1252
|
+
|
1253
|
+
```python
|
1254
|
+
def input_command_handler(input_command: InputCommand) -> None
|
1255
|
+
```
|
1256
|
+
|
1257
|
+
Private. One handler for all input commands
|
1258
|
+
|
1259
|
+
**Arguments**:
|
1260
|
+
|
1261
|
+
- `input_command`: input command as InputCommand
|
1262
|
+
|
1263
|
+
**Returns**:
|
1264
|
+
|
1265
|
+
`None`
|
1266
|
+
|
1267
|
+
---
|
1268
|
+
|
1269
|
+
<a id="argenta.router.entity.Router.set_command_register_ignore"></a>
|
1270
|
+
|
1271
|
+
#### set\_command\_register\_ignore
|
1272
|
+
|
1273
|
+
```python
|
1274
|
+
def set_command_register_ignore(_: bool) -> None
|
1275
|
+
```
|
1276
|
+
|
1277
|
+
Private. Sets the router behavior on the input commands register
|
1278
|
+
|
1279
|
+
**Arguments**:
|
1280
|
+
|
1281
|
+
- `_`: is command register ignore
|
1282
|
+
|
1283
|
+
**Returns**:
|
1284
|
+
|
1285
|
+
`None`
|
1286
|
+
|
1287
|
+
---
|
1288
|
+
|
1289
|
+
<a id="argenta.router.entity.Router.get_triggers"></a>
|
1290
|
+
|
1291
|
+
#### get\_triggers
|
1292
|
+
|
1293
|
+
```python
|
1294
|
+
def get_triggers() -> list[str]
|
1295
|
+
```
|
1296
|
+
|
1297
|
+
Public. Gets registered triggers
|
1298
|
+
|
1299
|
+
**Returns**:
|
1300
|
+
|
1301
|
+
registered in router triggers as list[str]
|
1302
|
+
|
1303
|
+
---
|
1304
|
+
|
1305
|
+
<a id="argenta.router.entity.Router.get_aliases"></a>
|
1306
|
+
|
1307
|
+
#### get\_aliases
|
1308
|
+
|
1309
|
+
```python
|
1310
|
+
def get_aliases() -> list[str]
|
1311
|
+
```
|
1312
|
+
|
1313
|
+
Public. Gets registered aliases
|
1314
|
+
|
1315
|
+
**Returns**:
|
1316
|
+
|
1317
|
+
registered in router aliases as list[str]
|
1318
|
+
|
1319
|
+
---
|
1320
|
+
|
1321
|
+
<a id="argenta.router.entity.Router.get_title"></a>
|
1322
|
+
|
1323
|
+
#### get\_title
|
1324
|
+
|
1325
|
+
```python
|
1326
|
+
def get_title() -> str | None
|
1327
|
+
```
|
1328
|
+
|
1329
|
+
Public. Gets title of the router
|
1330
|
+
|
1331
|
+
**Returns**:
|
1332
|
+
|
1333
|
+
the title of the router as str or None
|
1334
|
+
|
1335
|
+
---
|
1336
|
+
|
1337
|
+
<a id="argenta.router.entity.Router.set_title"></a>
|
1338
|
+
|
1339
|
+
#### set\_title
|
1340
|
+
|
1341
|
+
```python
|
1342
|
+
def set_title(title: str) -> None
|
1343
|
+
```
|
1344
|
+
|
1345
|
+
Public. Sets the title of the router
|
1346
|
+
|
1347
|
+
**Arguments**:
|
1348
|
+
|
1349
|
+
- `title`: title that will be setted
|
1350
|
+
|
1351
|
+
**Returns**:
|
1352
|
+
|
1353
|
+
`None`
|
1354
|
+
|
1355
|
+
---
|
1356
|
+
|
1357
|
+
<a id="argenta.router.exceptions"></a>
|
1358
|
+
|
1359
|
+
# `.router.exceptions`
|
1360
|
+
|
1361
|
+
<a id="argenta.router.exceptions.RepeatedFlagNameException"></a>
|
1362
|
+
|
1363
|
+
## RepeatedFlagNameException Objects
|
1364
|
+
|
1365
|
+
```python
|
1366
|
+
class RepeatedFlagNameException(Exception)
|
1367
|
+
```
|
1368
|
+
|
1369
|
+
Private. Raised when a repeated flag name is registered
|
1370
|
+
|
1371
|
+
---
|
1372
|
+
|
1373
|
+
<a id="argenta.router.exceptions.TooManyTransferredArgsException"></a>
|
1374
|
+
|
1375
|
+
## TooManyTransferredArgsException Objects
|
1376
|
+
|
1377
|
+
```python
|
1378
|
+
class TooManyTransferredArgsException(Exception)
|
1379
|
+
```
|
1380
|
+
|
1381
|
+
Private. Raised when too many arguments are passed
|
1382
|
+
|
1383
|
+
---
|
1384
|
+
|
1385
|
+
<a id="argenta.router.exceptions.RequiredArgumentNotPassedException"></a>
|
1386
|
+
|
1387
|
+
## RequiredArgumentNotPassedException Objects
|
1388
|
+
|
1389
|
+
```python
|
1390
|
+
class RequiredArgumentNotPassedException(Exception)
|
1391
|
+
```
|
1392
|
+
|
1393
|
+
Private. Raised when a required argument is not passed
|
1394
|
+
|
1395
|
+
---
|
1396
|
+
|
1397
|
+
<a id="argenta.router.exceptions.IncorrectNumberOfHandlerArgsException"></a>
|
1398
|
+
|
1399
|
+
## IncorrectNumberOfHandlerArgsException Objects
|
1400
|
+
|
1401
|
+
```python
|
1402
|
+
class IncorrectNumberOfHandlerArgsException(Exception)
|
1403
|
+
```
|
1404
|
+
|
1405
|
+
Private. Raised when incorrect number of arguments are passed
|
1406
|
+
|
1407
|
+
---
|
1408
|
+
|
1409
|
+
<a id="argenta.router.exceptions.TriggerContainSpacesException"></a>
|
1410
|
+
|
1411
|
+
## TriggerContainSpacesException Objects
|
1412
|
+
|
1413
|
+
```python
|
1414
|
+
class TriggerContainSpacesException(Exception)
|
1415
|
+
```
|
1416
|
+
|
1417
|
+
Private. Raised when there is a space in the trigger being registered
|
1418
|
+
|
1419
|
+
<a id="argenta.router"></a>
|
1420
|
+
|
1421
|
+
---
|
1422
|
+
|
1423
|
+
# Tests
|
1424
|
+
|
1425
|
+
Run tests:
|
1426
|
+
|
1427
|
+
```bash
|
1428
|
+
python -m unittest discover
|
1429
|
+
```
|
1430
|
+
or
|
1431
|
+
```bash
|
1432
|
+
python -m unittest discover -v
|
1433
|
+
```
|
1434
|
+
|
1435
|
+
---
|
1436
|
+
|
1437
|
+
# made by kolo `MIT` `2025`
|
1438
|
+
|