argenta 0.3.7__tar.gz → 0.3.8__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.
- {argenta-0.3.7 → argenta-0.3.8}/PKG-INFO +4 -3
- {argenta-0.3.7 → argenta-0.3.8}/README.md +3 -2
- {argenta-0.3.7 → argenta-0.3.8}/argenta/router/entity.py +4 -1
- {argenta-0.3.7 → argenta-0.3.8}/argenta/router/exceptions.py +5 -0
- {argenta-0.3.7 → argenta-0.3.8}/pyproject.toml +1 -1
- {argenta-0.3.7 → argenta-0.3.8}/LICENSE +0 -0
- {argenta-0.3.7 → argenta-0.3.8}/argenta/__init__.py +0 -0
- {argenta-0.3.7 → argenta-0.3.8}/argenta/app/__init__.py +0 -0
- {argenta-0.3.7 → argenta-0.3.8}/argenta/app/entity.py +0 -0
- {argenta-0.3.7 → argenta-0.3.8}/argenta/app/exceptions.py +0 -0
- {argenta-0.3.7 → argenta-0.3.8}/argenta/command/__init__.py +0 -0
- {argenta-0.3.7 → argenta-0.3.8}/argenta/command/entity.py +0 -0
- {argenta-0.3.7 → argenta-0.3.8}/argenta/command/exceptions.py +0 -0
- {argenta-0.3.7 → argenta-0.3.8}/argenta/command/params/__init__.py +0 -0
- {argenta-0.3.7 → argenta-0.3.8}/argenta/command/params/flag/__init__.py +0 -0
- {argenta-0.3.7 → argenta-0.3.8}/argenta/command/params/flag/entity.py +0 -0
- {argenta-0.3.7 → argenta-0.3.8}/argenta/command/params/flag/flags_group/__init__.py +0 -0
- {argenta-0.3.7 → argenta-0.3.8}/argenta/command/params/flag/flags_group/entity.py +0 -0
- {argenta-0.3.7 → argenta-0.3.8}/argenta/router/__init__.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: argenta
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.8
|
4
4
|
Summary: python library for creating custom shells
|
5
5
|
License: MIT
|
6
6
|
Author: kolo
|
@@ -320,6 +320,7 @@ Router(title: str = 'Commands group title:',
|
|
320
320
|
- `TooManyTransferredArgsException` - Слишком много зарегистрированных аргументов у обработчика команды
|
321
321
|
- `RequiredArgumentNotPassedException` - Не зарегистрирован обязательный аргумент у обработчика команды(аргумент, через который будут переданы флаги введённой команды)
|
322
322
|
- `IncorrectNumberOfHandlerArgsException` - У обработчика нестандартного поведения зарегистрировано неверное количество аргументов(в большинстве случаев у него должен быть один аргумент)
|
323
|
+
- `TriggerCannotContainSpacesException` - У регистрируемой команды в триггере содержатся пробелы
|
323
324
|
|
324
325
|
---
|
325
326
|
|
@@ -378,9 +379,9 @@ Command(trigger: str,
|
|
378
379
|
### Конструктор
|
379
380
|
```python
|
380
381
|
Flag(flag_name: str,
|
381
|
-
flag_prefix: Literal['-', '--', '---'] = '-',
|
382
|
+
flag_prefix: typing.Literal['-', '--', '---'] = '-',
|
382
383
|
ignore_flag_value_register: bool = False,
|
383
|
-
possible_flag_values: list[str] | Pattern[str] = False)
|
384
|
+
possible_flag_values: list[str] | typing.Pattern[str] = False)
|
384
385
|
```
|
385
386
|
|
386
387
|
---
|
@@ -305,6 +305,7 @@ Router(title: str = 'Commands group title:',
|
|
305
305
|
- `TooManyTransferredArgsException` - Слишком много зарегистрированных аргументов у обработчика команды
|
306
306
|
- `RequiredArgumentNotPassedException` - Не зарегистрирован обязательный аргумент у обработчика команды(аргумент, через который будут переданы флаги введённой команды)
|
307
307
|
- `IncorrectNumberOfHandlerArgsException` - У обработчика нестандартного поведения зарегистрировано неверное количество аргументов(в большинстве случаев у него должен быть один аргумент)
|
308
|
+
- `TriggerCannotContainSpacesException` - У регистрируемой команды в триггере содержатся пробелы
|
308
309
|
|
309
310
|
---
|
310
311
|
|
@@ -363,9 +364,9 @@ Command(trigger: str,
|
|
363
364
|
### Конструктор
|
364
365
|
```python
|
365
366
|
Flag(flag_name: str,
|
366
|
-
flag_prefix: Literal['-', '--', '---'] = '-',
|
367
|
+
flag_prefix: typing.Literal['-', '--', '---'] = '-',
|
367
368
|
ignore_flag_value_register: bool = False,
|
368
|
-
possible_flag_values: list[str] | Pattern[str] = False)
|
369
|
+
possible_flag_values: list[str] | typing.Pattern[str] = False)
|
369
370
|
```
|
370
371
|
|
371
372
|
---
|
@@ -8,7 +8,8 @@ from ..router.exceptions import (RepeatedCommandException,
|
|
8
8
|
RepeatedFlagNameException,
|
9
9
|
TooManyTransferredArgsException,
|
10
10
|
RequiredArgumentNotPassedException,
|
11
|
-
IncorrectNumberOfHandlerArgsException
|
11
|
+
IncorrectNumberOfHandlerArgsException,
|
12
|
+
TriggerCannotContainSpacesException)
|
12
13
|
|
13
14
|
|
14
15
|
class Router:
|
@@ -71,6 +72,8 @@ class Router:
|
|
71
72
|
|
72
73
|
def _validate_command(self, command: Command):
|
73
74
|
command_name: str = command.get_trigger()
|
75
|
+
if command_name.find(' ') != -1:
|
76
|
+
raise TriggerCannotContainSpacesException()
|
74
77
|
if command_name in self.get_all_commands():
|
75
78
|
raise RepeatedCommandException()
|
76
79
|
if self._ignore_command_register:
|
@@ -21,3 +21,8 @@ class RequiredArgumentNotPassedException(Exception):
|
|
21
21
|
class IncorrectNumberOfHandlerArgsException(Exception):
|
22
22
|
def __str__(self):
|
23
23
|
return "Handler has incorrect number of arguments"
|
24
|
+
|
25
|
+
|
26
|
+
class TriggerCannotContainSpacesException(Exception):
|
27
|
+
def __str__(self):
|
28
|
+
return "Command trigger cannot contain spaces"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|