encommon 0.12.3__tar.gz → 0.13.1__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.
Files changed (81) hide show
  1. {encommon-0.12.3/encommon.egg-info → encommon-0.13.1}/PKG-INFO +1 -1
  2. {encommon-0.12.3 → encommon-0.13.1}/encommon/config/config.py +27 -0
  3. {encommon-0.12.3 → encommon-0.13.1}/encommon/config/test/test_config.py +3 -0
  4. {encommon-0.12.3 → encommon-0.13.1}/encommon/conftest.py +5 -1
  5. {encommon-0.12.3 → encommon-0.13.1}/encommon/times/timers.py +6 -0
  6. {encommon-0.12.3 → encommon-0.13.1}/encommon/times/windows.py +6 -0
  7. encommon-0.13.1/encommon/version.txt +1 -0
  8. {encommon-0.12.3 → encommon-0.13.1/encommon.egg-info}/PKG-INFO +1 -1
  9. encommon-0.12.3/encommon/version.txt +0 -1
  10. {encommon-0.12.3 → encommon-0.13.1}/LICENSE +0 -0
  11. {encommon-0.12.3 → encommon-0.13.1}/MANIFEST.in +0 -0
  12. {encommon-0.12.3 → encommon-0.13.1}/README.md +0 -0
  13. {encommon-0.12.3 → encommon-0.13.1}/encommon/__init__.py +0 -0
  14. {encommon-0.12.3 → encommon-0.13.1}/encommon/config/__init__.py +0 -0
  15. {encommon-0.12.3 → encommon-0.13.1}/encommon/config/files.py +0 -0
  16. {encommon-0.12.3 → encommon-0.13.1}/encommon/config/logger.py +0 -0
  17. {encommon-0.12.3 → encommon-0.13.1}/encommon/config/params.py +0 -0
  18. {encommon-0.12.3 → encommon-0.13.1}/encommon/config/paths.py +0 -0
  19. {encommon-0.12.3 → encommon-0.13.1}/encommon/config/test/__init__.py +0 -0
  20. {encommon-0.12.3 → encommon-0.13.1}/encommon/config/test/test_files.py +0 -0
  21. {encommon-0.12.3 → encommon-0.13.1}/encommon/config/test/test_logger.py +0 -0
  22. {encommon-0.12.3 → encommon-0.13.1}/encommon/config/test/test_paths.py +0 -0
  23. {encommon-0.12.3 → encommon-0.13.1}/encommon/config/test/test_utils.py +0 -0
  24. {encommon-0.12.3 → encommon-0.13.1}/encommon/config/utils.py +0 -0
  25. {encommon-0.12.3 → encommon-0.13.1}/encommon/crypts/__init__.py +0 -0
  26. {encommon-0.12.3 → encommon-0.13.1}/encommon/crypts/crypts.py +0 -0
  27. {encommon-0.12.3 → encommon-0.13.1}/encommon/crypts/hashes.py +0 -0
  28. {encommon-0.12.3 → encommon-0.13.1}/encommon/crypts/params.py +0 -0
  29. {encommon-0.12.3 → encommon-0.13.1}/encommon/crypts/test/__init__.py +0 -0
  30. {encommon-0.12.3 → encommon-0.13.1}/encommon/crypts/test/test_crypts.py +0 -0
  31. {encommon-0.12.3 → encommon-0.13.1}/encommon/crypts/test/test_hashes.py +0 -0
  32. {encommon-0.12.3 → encommon-0.13.1}/encommon/py.typed +0 -0
  33. {encommon-0.12.3 → encommon-0.13.1}/encommon/times/__init__.py +0 -0
  34. {encommon-0.12.3 → encommon-0.13.1}/encommon/times/common.py +0 -0
  35. {encommon-0.12.3 → encommon-0.13.1}/encommon/times/duration.py +0 -0
  36. {encommon-0.12.3 → encommon-0.13.1}/encommon/times/params.py +0 -0
  37. {encommon-0.12.3 → encommon-0.13.1}/encommon/times/parse.py +0 -0
  38. {encommon-0.12.3 → encommon-0.13.1}/encommon/times/test/__init__.py +0 -0
  39. {encommon-0.12.3 → encommon-0.13.1}/encommon/times/test/test_duration.py +0 -0
  40. {encommon-0.12.3 → encommon-0.13.1}/encommon/times/test/test_params.py +0 -0
  41. {encommon-0.12.3 → encommon-0.13.1}/encommon/times/test/test_parse.py +0 -0
  42. {encommon-0.12.3 → encommon-0.13.1}/encommon/times/test/test_timer.py +0 -0
  43. {encommon-0.12.3 → encommon-0.13.1}/encommon/times/test/test_timers.py +0 -0
  44. {encommon-0.12.3 → encommon-0.13.1}/encommon/times/test/test_times.py +0 -0
  45. {encommon-0.12.3 → encommon-0.13.1}/encommon/times/test/test_utils.py +0 -0
  46. {encommon-0.12.3 → encommon-0.13.1}/encommon/times/test/test_window.py +0 -0
  47. {encommon-0.12.3 → encommon-0.13.1}/encommon/times/test/test_windows.py +0 -0
  48. {encommon-0.12.3 → encommon-0.13.1}/encommon/times/timer.py +0 -0
  49. {encommon-0.12.3 → encommon-0.13.1}/encommon/times/times.py +0 -0
  50. {encommon-0.12.3 → encommon-0.13.1}/encommon/times/utils.py +0 -0
  51. {encommon-0.12.3 → encommon-0.13.1}/encommon/times/window.py +0 -0
  52. {encommon-0.12.3 → encommon-0.13.1}/encommon/types/__init__.py +0 -0
  53. {encommon-0.12.3 → encommon-0.13.1}/encommon/types/dicts.py +0 -0
  54. {encommon-0.12.3 → encommon-0.13.1}/encommon/types/empty.py +0 -0
  55. {encommon-0.12.3 → encommon-0.13.1}/encommon/types/notate.py +0 -0
  56. {encommon-0.12.3 → encommon-0.13.1}/encommon/types/strings.py +0 -0
  57. {encommon-0.12.3 → encommon-0.13.1}/encommon/types/test/__init__.py +0 -0
  58. {encommon-0.12.3 → encommon-0.13.1}/encommon/types/test/test_dicts.py +0 -0
  59. {encommon-0.12.3 → encommon-0.13.1}/encommon/types/test/test_empty.py +0 -0
  60. {encommon-0.12.3 → encommon-0.13.1}/encommon/types/test/test_notate.py +0 -0
  61. {encommon-0.12.3 → encommon-0.13.1}/encommon/types/test/test_strings.py +0 -0
  62. {encommon-0.12.3 → encommon-0.13.1}/encommon/utils/__init__.py +0 -0
  63. {encommon-0.12.3 → encommon-0.13.1}/encommon/utils/common.py +0 -0
  64. {encommon-0.12.3 → encommon-0.13.1}/encommon/utils/files.py +0 -0
  65. {encommon-0.12.3 → encommon-0.13.1}/encommon/utils/match.py +0 -0
  66. {encommon-0.12.3 → encommon-0.13.1}/encommon/utils/paths.py +0 -0
  67. {encommon-0.12.3 → encommon-0.13.1}/encommon/utils/sample.py +0 -0
  68. {encommon-0.12.3 → encommon-0.13.1}/encommon/utils/stdout.py +0 -0
  69. {encommon-0.12.3 → encommon-0.13.1}/encommon/utils/test/__init__.py +0 -0
  70. {encommon-0.12.3 → encommon-0.13.1}/encommon/utils/test/test_files.py +0 -0
  71. {encommon-0.12.3 → encommon-0.13.1}/encommon/utils/test/test_match.py +0 -0
  72. {encommon-0.12.3 → encommon-0.13.1}/encommon/utils/test/test_paths.py +0 -0
  73. {encommon-0.12.3 → encommon-0.13.1}/encommon/utils/test/test_sample.py +0 -0
  74. {encommon-0.12.3 → encommon-0.13.1}/encommon/utils/test/test_stdout.py +0 -0
  75. {encommon-0.12.3 → encommon-0.13.1}/encommon.egg-info/SOURCES.txt +0 -0
  76. {encommon-0.12.3 → encommon-0.13.1}/encommon.egg-info/dependency_links.txt +0 -0
  77. {encommon-0.12.3 → encommon-0.13.1}/encommon.egg-info/requires.txt +0 -0
  78. {encommon-0.12.3 → encommon-0.13.1}/encommon.egg-info/top_level.txt +0 -0
  79. {encommon-0.12.3 → encommon-0.13.1}/pyproject.toml +0 -0
  80. {encommon-0.12.3 → encommon-0.13.1}/reqs-install.txt +0 -0
  81. {encommon-0.12.3 → encommon-0.13.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: encommon
3
- Version: 0.12.3
3
+ Version: 0.13.1
4
4
  Summary: Enasis Network Common Library
5
5
  License: MIT
6
6
  Classifier: Programming Language :: Python :: 3
@@ -49,12 +49,14 @@ class Config:
49
49
  :param paths: Complete or relative path to config paths.
50
50
  :param cargs: Configuration arguments in dictionary form,
51
51
  which will override contents from the config files.
52
+ :param sargs: Additional arguments on the command line.
52
53
  :param model: Override default config validation model.
53
54
  """
54
55
 
55
56
  __files: ConfigFiles
56
57
  __paths: ConfigPaths
57
58
  __cargs: dict[str, Any]
59
+ __sargs: dict[str, Any]
58
60
 
59
61
  __model: Callable # type: ignore
60
62
 
@@ -69,6 +71,7 @@ class Config:
69
71
  files: Optional['PATHABLE'] = None,
70
72
  paths: Optional['PATHABLE'] = None,
71
73
  cargs: Optional[dict[str, Any]] = None,
74
+ sargs: Optional[dict[str, Any]] = None,
72
75
  model: Optional[Callable] = None, # type: ignore
73
76
  ) -> None:
74
77
  """
@@ -78,12 +81,14 @@ class Config:
78
81
  files = files or []
79
82
  paths = paths or []
80
83
  cargs = cargs or {}
84
+ sargs = sargs or {}
81
85
 
82
86
  paths = list(config_paths(paths))
83
87
 
84
88
  self.__model = model or Params
85
89
  self.__files = ConfigFiles(files)
86
90
  self.__cargs = deepcopy(cargs)
91
+ self.__sargs = deepcopy(sargs)
87
92
 
88
93
  self.__params = None
89
94
 
@@ -147,6 +152,28 @@ class Config:
147
152
  return deepcopy(returned)
148
153
 
149
154
 
155
+ @property
156
+ def sargs(
157
+ self,
158
+ ) -> dict[str, Any]:
159
+ """
160
+ Return the value for the attribute from class instance.
161
+
162
+ :returns: Value for the attribute from class instance.
163
+ """
164
+
165
+ returned: dict[str, Any] = {}
166
+
167
+ sargs = deepcopy(self.__sargs)
168
+
169
+ items = sargs.items()
170
+
171
+ for key, value in items:
172
+ setate(returned, key, value)
173
+
174
+ return deepcopy(returned)
175
+
176
+
150
177
  @property
151
178
  def config(
152
179
  self,
@@ -44,6 +44,7 @@ def test_Config(
44
44
  '_Config__model',
45
45
  '_Config__files',
46
46
  '_Config__cargs',
47
+ '_Config__sargs',
47
48
  '_Config__params',
48
49
  '_Config__paths',
49
50
  '_Config__logger',
@@ -71,6 +72,8 @@ def test_Config(
71
72
 
72
73
  assert len(config.cargs) == 1
73
74
 
75
+ assert len(config.sargs) == 1
76
+
74
77
  assert len(config.config) == 3
75
78
 
76
79
  assert config.model is Params
@@ -47,9 +47,13 @@ def config_factory(
47
47
  'enlogger/file_path': config_log,
48
48
  'enlogger/file_level': 'info'}
49
49
 
50
+ sargs = {
51
+ 'custom/parameter': 'fart'}
52
+
50
53
  return Config(
51
54
  files=f'{tmp_path}/config.yml',
52
- cargs=cargs)
55
+ cargs=cargs,
56
+ sargs=sargs)
53
57
 
54
58
 
55
59
 
@@ -430,12 +430,18 @@ class Timers:
430
430
  :param unique: Unique identifier for the related child.
431
431
  """
432
432
 
433
+ params = self.__params
433
434
  timers = self.__timers
434
435
 
435
436
  group = self.__group
436
437
 
437
438
  session = self.store_session
438
439
 
440
+ config = params.timers
441
+
442
+
443
+ if unique in config:
444
+ del config[unique]
439
445
 
440
446
  if unique in timers:
441
447
  del timers[unique]
@@ -495,12 +495,18 @@ class Windows:
495
495
  :param unique: Unique identifier for the related child.
496
496
  """
497
497
 
498
+ params = self.__params
498
499
  windows = self.__windows
499
500
 
500
501
  group = self.__group
501
502
 
502
503
  session = self.store_session
503
504
 
505
+ config = params.windows
506
+
507
+
508
+ if unique in config:
509
+ del config[unique]
504
510
 
505
511
  if unique in windows:
506
512
  del windows[unique]
@@ -0,0 +1 @@
1
+ 0.13.1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: encommon
3
- Version: 0.12.3
3
+ Version: 0.13.1
4
4
  Summary: Enasis Network Common Library
5
5
  License: MIT
6
6
  Classifier: Programming Language :: Python :: 3
@@ -1 +0,0 @@
1
- 0.12.3
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes