argenta 1.0.0a0__py3-none-any.whl → 1.0.0a2__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.
@@ -9,16 +9,16 @@ class PredefinedFlags:
9
9
  Public. A dataclass with predefined flags and most frequently used flags for quick use
10
10
  """
11
11
  HELP = Flag(name='help', possible_values=False)
12
- SHORT_HELP = Flag(name='h', prefix='-', possible_values=False)
12
+ SHORT_HELP = Flag(name='H', prefix='-', possible_values=False)
13
13
 
14
14
  INFO = Flag(name='info', possible_values=False)
15
- SHORT_INFO = Flag(name='i', prefix='-', possible_values=False)
15
+ SHORT_INFO = Flag(name='I', prefix='-', possible_values=False)
16
16
 
17
17
  ALL = Flag(name='all', possible_values=False)
18
- SHORT_ALL = Flag(name='a', prefix='-', possible_values=False)
18
+ SHORT_ALL = Flag(name='A', prefix='-', possible_values=False)
19
19
 
20
20
  HOST = Flag(name='host', possible_values=re.compile(r'^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$'))
21
- SHORT_HOST = Flag(name='h', prefix='-', possible_values=re.compile(r'^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$'))
21
+ SHORT_HOST = Flag(name='H', prefix='-', possible_values=re.compile(r'^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$'))
22
22
 
23
23
  PORT = Flag(name='port', possible_values=re.compile(r'^\d{1,5}$'))
24
- SHORT_PORT = Flag(name='p', prefix='-', possible_values=re.compile(r'^\d{1,5}$'))
24
+ SHORT_PORT = Flag(name='P', prefix='-', possible_values=re.compile(r'^\d{1,5}$'))
argenta/router/entity.py CHANGED
@@ -1,14 +1,13 @@
1
1
  from typing import Callable
2
2
  from inspect import getfullargspec
3
- from src.argenta.command import Command
4
- from src.argenta.command.models import InputCommand
5
- from src.argenta.router.command_handler.entity import CommandHandlers, CommandHandler
6
- from src.argenta.command.flag.models import Flag, Flags, InputFlags
7
- from src.argenta.router.exceptions import (RepeatedFlagNameException,
8
- TooManyTransferredArgsException,
9
- RequiredArgumentNotPassedException,
10
- IncorrectNumberOfHandlerArgsException,
11
- TriggerContainSpacesException)
3
+ from argenta.command import Command
4
+ from argenta.command.models import InputCommand
5
+ from argenta.router.command_handler.entity import CommandHandlers, CommandHandler
6
+ from argenta.command.flag.models import Flag, Flags, InputFlags
7
+ from argenta.router.exceptions import (RepeatedFlagNameException,
8
+ TooManyTransferredArgsException,
9
+ RequiredArgumentNotPassedException,
10
+ TriggerContainSpacesException)
12
11
 
13
12
 
14
13
  class Router:
@@ -45,17 +44,13 @@ class Router:
45
44
  return command_decorator
46
45
 
47
46
 
48
- def set_invalid_input_flag_handler(self, func) -> None:
47
+ def set_invalid_input_flag_handler(self, func: Callable[[Flag], None]) -> None:
49
48
  """
50
49
  Public. Registers handler for invalid input flag
51
50
  :param func: registered handler
52
51
  :return: None
53
52
  """
54
- processed_args = getfullargspec(func).args
55
- if len(processed_args) != 1:
56
- raise IncorrectNumberOfHandlerArgsException()
57
- else:
58
- self._not_valid_flag_handler = func
53
+ self._not_valid_flag_handler = func
59
54
 
60
55
 
61
56
  def finds_appropriate_handler(self, input_command: InputCommand) -> None:
@@ -3,7 +3,7 @@ class RepeatedFlagNameException(Exception):
3
3
  Private. Raised when a repeated flag name is registered
4
4
  """
5
5
  def __str__(self):
6
- return "Repeated registered_flag name in register command"
6
+ return "Repeated registered flag names in register command"
7
7
 
8
8
 
9
9
  class TooManyTransferredArgsException(Exception):
@@ -22,14 +22,6 @@ class RequiredArgumentNotPassedException(Exception):
22
22
  return "Required argument not passed"
23
23
 
24
24
 
25
- class IncorrectNumberOfHandlerArgsException(Exception):
26
- """
27
- Private. Raised when incorrect number of arguments are passed
28
- """
29
- def __str__(self):
30
- return "Handler has incorrect number of arguments"
31
-
32
-
33
25
  class TriggerContainSpacesException(Exception):
34
26
  """
35
27
  Private. Raised when there is a space in the trigger being registered
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: argenta
3
- Version: 1.0.0a0
3
+ Version: 1.0.0a2
4
4
  Summary: Python library for creating TUI
5
5
  Author-email: kolo <kolo.is.main@gmail.com>
6
6
  License: MIT
@@ -347,22 +347,6 @@ Public. Sets the handler for exit command when entering a command
347
347
 
348
348
  ---
349
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
350
  <a id="argenta.app.models.App.include_router"></a>
367
351
 
368
352
  #### include\_router
@@ -507,26 +491,6 @@ Public. The static dividing line
507
491
 
508
492
  ---
509
493
 
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
494
  <a id="argenta.app.dividing_line.models.DynamicDividingLine"></a>
531
495
 
532
496
  ## DynamicDividingLine Objects
@@ -555,27 +519,6 @@ Public. The dynamic dividing line
555
519
 
556
520
  ---
557
521
 
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
522
  <a id="argenta.app.exceptions"></a>
580
523
 
581
524
  # `.app.exceptions`
@@ -1246,46 +1189,6 @@ Public. Registers handler for invalid input flag
1246
1189
 
1247
1190
  ---
1248
1191
 
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
1192
  <a id="argenta.router.entity.Router.get_triggers"></a>
1290
1193
 
1291
1194
  #### get\_triggers
@@ -13,7 +13,7 @@ argenta/command/__init__.py,sha256=Plo2Da0fhq8H1eo2mg7nA1-OBLuGjK2BYpDGRvGGMIU,6
13
13
  argenta/command/exceptions.py,sha256=FLX4z7-mvCTRKO7_2_FfJVUbfNLf_Z-vwyZYDy6cnnY,1030
14
14
  argenta/command/models.py,sha256=-CTHYhiBYOUz-XmkNPIxC8-Ma0rb7e1uYwLodQlW4D4,6604
15
15
  argenta/command/flag/__init__.py,sha256=PaZAaqU3DgyO1o5do-xKhWV6TyEuOSaQTmE4VbPY6JA,136
16
- argenta/command/flag/defaults.py,sha256=0xiJPMpNfCVUHvzL5TSadlJ42AKKIMyJScokMG63zEg,982
16
+ argenta/command/flag/defaults.py,sha256=0wCvh2l3eNU3vTuxuARVaUwhEzG3v9FID0rBbXHyK-k,982
17
17
  argenta/command/flag/models.py,sha256=OYC4yfym1XPvGdtWtRFKJF48SuwZpVU3dalOIplm-zQ,6403
18
18
  argenta/orchestrator/__init__.py,sha256=vFtJEJTjFfoYP3DZx0gNlhoa0Tk8u-yzkGIUN3SiABA,86
19
19
  argenta/orchestrator/entity.py,sha256=HUKhoEQtiWvxeA3QhSkvTcIgwgXDLjmcB2cBFHlCGhw,1101
@@ -23,11 +23,11 @@ argenta/orchestrator/argparser/arguments/__init__.py,sha256=4T55Tl_4WKOYp9HtVDmz
23
23
  argenta/orchestrator/argparser/arguments/models.py,sha256=hSUXBjTsyzNKvyPgWhiNCa4SSQdmixIQnne2A9iuPMc,1546
24
24
  argenta/router/__init__.py,sha256=ldrIWTXNLXUAMAGQ8ex4e8nMso_fhi01nZi2DVzHnnk,66
25
25
  argenta/router/defaults.py,sha256=RX3DMbZk7XUbj6uR4uADhZOPqEDoeCz9X-n26YTCCPM,87
26
- argenta/router/entity.py,sha256=BQ6yELPkwh0fpm7f3eEPKAykqOo_3vzvrhKa0yz3dy4,8224
27
- argenta/router/exceptions.py,sha256=nCvROHOunNwTKojH6IcAq7puzm7Y56Cdw620wt9cqQ4,1081
26
+ argenta/router/entity.py,sha256=pTXN1agjbRJDYNpiCvxGVzNRnmSOWniOChW7A-mHr_U,7965
27
+ argenta/router/exceptions.py,sha256=q6y-4gmbgkX-0U4-qXHDP5HTtUQ_c4svaqVILn-ZzRw,852
28
28
  argenta/router/command_handler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
29
  argenta/router/command_handler/entity.py,sha256=87H1jGO6O_udWDAmvfGDjpkeFCCHdbsTPnJ94r6_r70,2817
30
- argenta-1.0.0a0.dist-info/METADATA,sha256=G0OmS-jfV4KT2tO-4f_rjsQgPEWHWBc0YM-dR4nWAjI,27366
31
- argenta-1.0.0a0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
32
- argenta-1.0.0a0.dist-info/licenses/LICENSE,sha256=zmqoGh2n5rReBv4s8wPxF_gZEZDgauJYSPMuPczgOiU,1082
33
- argenta-1.0.0a0.dist-info/RECORD,,
30
+ argenta-1.0.0a2.dist-info/METADATA,sha256=cDVECr_bZaXoYByK3pgEI6EBkK3YGrz-vbmS8vEts5Y,25759
31
+ argenta-1.0.0a2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
32
+ argenta-1.0.0a2.dist-info/licenses/LICENSE,sha256=zmqoGh2n5rReBv4s8wPxF_gZEZDgauJYSPMuPczgOiU,1082
33
+ argenta-1.0.0a2.dist-info/RECORD,,