encommon 0.20.0__tar.gz → 0.20.2__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. {encommon-0.20.0/encommon.egg-info → encommon-0.20.2}/PKG-INFO +1 -1
  2. {encommon-0.20.0 → encommon-0.20.2}/encommon/colors/color.py +1 -4
  3. {encommon-0.20.0 → encommon-0.20.2}/encommon/colors/test/test_color.py +2 -1
  4. {encommon-0.20.0 → encommon-0.20.2}/encommon/config/config.py +3 -3
  5. {encommon-0.20.0 → encommon-0.20.2}/encommon/config/test/test_config.py +2 -1
  6. {encommon-0.20.0 → encommon-0.20.2}/encommon/config/test/test_files.py +4 -2
  7. {encommon-0.20.0 → encommon-0.20.2}/encommon/config/test/test_logger.py +4 -2
  8. {encommon-0.20.0 → encommon-0.20.2}/encommon/config/test/test_paths.py +4 -2
  9. {encommon-0.20.0 → encommon-0.20.2}/encommon/crypts/crypts.py +32 -11
  10. {encommon-0.20.0 → encommon-0.20.2}/encommon/crypts/test/test_crypts.py +2 -1
  11. {encommon-0.20.0 → encommon-0.20.2}/encommon/crypts/test/test_hashes.py +2 -1
  12. {encommon-0.20.0 → encommon-0.20.2}/encommon/parse/test/test_jinja2.py +2 -1
  13. {encommon-0.20.0 → encommon-0.20.2}/encommon/parse/test/test_network.py +2 -1
  14. {encommon-0.20.0 → encommon-0.20.2}/encommon/times/duration.py +1 -1
  15. {encommon-0.20.0 → encommon-0.20.2}/encommon/times/test/test_duration.py +2 -1
  16. {encommon-0.20.0 → encommon-0.20.2}/encommon/times/test/test_time.py +2 -1
  17. {encommon-0.20.0 → encommon-0.20.2}/encommon/times/test/test_timer.py +2 -1
  18. {encommon-0.20.0 → encommon-0.20.2}/encommon/times/test/test_timers.py +2 -1
  19. {encommon-0.20.0 → encommon-0.20.2}/encommon/times/test/test_window.py +2 -1
  20. {encommon-0.20.0 → encommon-0.20.2}/encommon/times/test/test_windows.py +2 -1
  21. {encommon-0.20.0 → encommon-0.20.2}/encommon/times/timers.py +3 -1
  22. {encommon-0.20.0 → encommon-0.20.2}/encommon/times/windows.py +3 -1
  23. {encommon-0.20.0 → encommon-0.20.2}/encommon/types/test/test_empty.py +2 -1
  24. encommon-0.20.2/encommon/version.txt +1 -0
  25. {encommon-0.20.0 → encommon-0.20.2/encommon.egg-info}/PKG-INFO +1 -1
  26. encommon-0.20.0/encommon/version.txt +0 -1
  27. {encommon-0.20.0 → encommon-0.20.2}/LICENSE +0 -0
  28. {encommon-0.20.0 → encommon-0.20.2}/MANIFEST.in +0 -0
  29. {encommon-0.20.0 → encommon-0.20.2}/README.md +0 -0
  30. {encommon-0.20.0 → encommon-0.20.2}/encommon/__init__.py +0 -0
  31. {encommon-0.20.0 → encommon-0.20.2}/encommon/colors/__init__.py +0 -0
  32. {encommon-0.20.0 → encommon-0.20.2}/encommon/colors/test/__init__.py +0 -0
  33. {encommon-0.20.0 → encommon-0.20.2}/encommon/config/__init__.py +0 -0
  34. {encommon-0.20.0 → encommon-0.20.2}/encommon/config/files.py +0 -0
  35. {encommon-0.20.0 → encommon-0.20.2}/encommon/config/logger.py +0 -0
  36. {encommon-0.20.0 → encommon-0.20.2}/encommon/config/params.py +0 -0
  37. {encommon-0.20.0 → encommon-0.20.2}/encommon/config/paths.py +0 -0
  38. {encommon-0.20.0 → encommon-0.20.2}/encommon/config/test/__init__.py +0 -0
  39. {encommon-0.20.0 → encommon-0.20.2}/encommon/config/test/test_utils.py +0 -0
  40. {encommon-0.20.0 → encommon-0.20.2}/encommon/config/utils.py +0 -0
  41. {encommon-0.20.0 → encommon-0.20.2}/encommon/conftest.py +0 -0
  42. {encommon-0.20.0 → encommon-0.20.2}/encommon/crypts/__init__.py +0 -0
  43. {encommon-0.20.0 → encommon-0.20.2}/encommon/crypts/hashes.py +0 -0
  44. {encommon-0.20.0 → encommon-0.20.2}/encommon/crypts/params.py +0 -0
  45. {encommon-0.20.0 → encommon-0.20.2}/encommon/crypts/test/__init__.py +0 -0
  46. {encommon-0.20.0 → encommon-0.20.2}/encommon/parse/__init__.py +0 -0
  47. {encommon-0.20.0 → encommon-0.20.2}/encommon/parse/jinja2.py +0 -0
  48. {encommon-0.20.0 → encommon-0.20.2}/encommon/parse/network.py +0 -0
  49. {encommon-0.20.0 → encommon-0.20.2}/encommon/parse/test/__init__.py +0 -0
  50. {encommon-0.20.0 → encommon-0.20.2}/encommon/py.typed +0 -0
  51. {encommon-0.20.0 → encommon-0.20.2}/encommon/times/__init__.py +0 -0
  52. {encommon-0.20.0 → encommon-0.20.2}/encommon/times/common.py +0 -0
  53. {encommon-0.20.0 → encommon-0.20.2}/encommon/times/params.py +0 -0
  54. {encommon-0.20.0 → encommon-0.20.2}/encommon/times/parse.py +0 -0
  55. {encommon-0.20.0 → encommon-0.20.2}/encommon/times/test/__init__.py +0 -0
  56. {encommon-0.20.0 → encommon-0.20.2}/encommon/times/test/test_params.py +0 -0
  57. {encommon-0.20.0 → encommon-0.20.2}/encommon/times/test/test_parse.py +0 -0
  58. {encommon-0.20.0 → encommon-0.20.2}/encommon/times/test/test_unitime.py +0 -0
  59. {encommon-0.20.0 → encommon-0.20.2}/encommon/times/test/test_utils.py +0 -0
  60. {encommon-0.20.0 → encommon-0.20.2}/encommon/times/time.py +0 -0
  61. {encommon-0.20.0 → encommon-0.20.2}/encommon/times/timer.py +0 -0
  62. {encommon-0.20.0 → encommon-0.20.2}/encommon/times/unitime.py +0 -0
  63. {encommon-0.20.0 → encommon-0.20.2}/encommon/times/utils.py +0 -0
  64. {encommon-0.20.0 → encommon-0.20.2}/encommon/times/window.py +0 -0
  65. {encommon-0.20.0 → encommon-0.20.2}/encommon/types/__init__.py +0 -0
  66. {encommon-0.20.0 → encommon-0.20.2}/encommon/types/classes.py +0 -0
  67. {encommon-0.20.0 → encommon-0.20.2}/encommon/types/dicts.py +0 -0
  68. {encommon-0.20.0 → encommon-0.20.2}/encommon/types/empty.py +0 -0
  69. {encommon-0.20.0 → encommon-0.20.2}/encommon/types/lists.py +0 -0
  70. {encommon-0.20.0 → encommon-0.20.2}/encommon/types/notate.py +0 -0
  71. {encommon-0.20.0 → encommon-0.20.2}/encommon/types/strings.py +0 -0
  72. {encommon-0.20.0 → encommon-0.20.2}/encommon/types/test/__init__.py +0 -0
  73. {encommon-0.20.0 → encommon-0.20.2}/encommon/types/test/test_classes.py +0 -0
  74. {encommon-0.20.0 → encommon-0.20.2}/encommon/types/test/test_dicts.py +0 -0
  75. {encommon-0.20.0 → encommon-0.20.2}/encommon/types/test/test_lists.py +0 -0
  76. {encommon-0.20.0 → encommon-0.20.2}/encommon/types/test/test_notate.py +0 -0
  77. {encommon-0.20.0 → encommon-0.20.2}/encommon/types/test/test_strings.py +0 -0
  78. {encommon-0.20.0 → encommon-0.20.2}/encommon/types/types.py +0 -0
  79. {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/__init__.py +0 -0
  80. {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/common.py +0 -0
  81. {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/files.py +0 -0
  82. {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/match.py +0 -0
  83. {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/paths.py +0 -0
  84. {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/sample.py +0 -0
  85. {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/stdout.py +0 -0
  86. {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/test/__init__.py +0 -0
  87. {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/test/test_files.py +0 -0
  88. {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/test/test_match.py +0 -0
  89. {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/test/test_paths.py +0 -0
  90. {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/test/test_sample.py +0 -0
  91. {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/test/test_stdout.py +0 -0
  92. {encommon-0.20.0 → encommon-0.20.2}/encommon.egg-info/SOURCES.txt +0 -0
  93. {encommon-0.20.0 → encommon-0.20.2}/encommon.egg-info/dependency_links.txt +0 -0
  94. {encommon-0.20.0 → encommon-0.20.2}/encommon.egg-info/requires.txt +0 -0
  95. {encommon-0.20.0 → encommon-0.20.2}/encommon.egg-info/top_level.txt +0 -0
  96. {encommon-0.20.0 → encommon-0.20.2}/pyproject.toml +0 -0
  97. {encommon-0.20.0 → encommon-0.20.2}/reqs-install.txt +0 -0
  98. {encommon-0.20.0 → encommon-0.20.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: encommon
3
- Version: 0.20.0
3
+ Version: 0.20.2
4
4
  Summary: Enasis Network Common Library
5
5
  License: MIT
6
6
  Classifier: Programming Language :: Python :: 3
@@ -84,10 +84,7 @@ class Color:
84
84
  :returns: Boolean indicating outcome from the operation.
85
85
  """
86
86
 
87
- color = int(
88
- self.__source, 16)
89
-
90
- return int(1e9 + color)
87
+ return hash(self.__source)
91
88
 
92
89
 
93
90
  def __str__(
@@ -31,7 +31,8 @@ def test_Color() -> None:
31
31
  assert repr(color) == (
32
32
  "Color('#000001')")
33
33
 
34
- assert hash(color) > 0
34
+ assert isinstance(
35
+ hash(color), int)
35
36
 
36
37
  assert str(color) == '#000001'
37
38
 
@@ -185,7 +185,7 @@ class Config:
185
185
  :returns: Configuration source loaded from the objects.
186
186
  """
187
187
 
188
- files = self.files
188
+ files = self.__files
189
189
 
190
190
  ferged = files.merge
191
191
 
@@ -207,8 +207,8 @@ class Config:
207
207
  :returns: Configuration source loaded from the objects.
208
208
  """
209
209
 
210
- files = self.files
211
- paths = self.paths
210
+ files = self.__files
211
+ paths = self.__paths
212
212
 
213
213
  ferged = files.merge
214
214
  perged = paths.merge
@@ -53,7 +53,8 @@ def test_Config(
53
53
  'config.Config object',
54
54
  config)
55
55
 
56
- assert hash(config) > 0
56
+ assert isinstance(
57
+ hash(config), int)
57
58
 
58
59
  assert instr(
59
60
  'config.Config object',
@@ -61,7 +61,8 @@ def test_ConfigFile(
61
61
  'files.ConfigFile object',
62
62
  file)
63
63
 
64
- assert hash(file) > 0
64
+ assert isinstance(
65
+ hash(file), int)
65
66
 
66
67
  assert instr(
67
68
  'files.ConfigFile object',
@@ -96,7 +97,8 @@ def test_ConfigFiles(
96
97
  'files.ConfigFiles object',
97
98
  files)
98
99
 
99
- assert hash(files) > 0
100
+ assert isinstance(
101
+ hash(files), int)
100
102
 
101
103
  assert instr(
102
104
  'files.ConfigFiles object',
@@ -83,7 +83,8 @@ def test_Message() -> None:
83
83
  'Message(level="info"',
84
84
  message)
85
85
 
86
- assert hash(message) > 0
86
+ assert isinstance(
87
+ hash(message), int)
87
88
 
88
89
  assert instr(
89
90
  'Message(level="info"',
@@ -157,7 +158,8 @@ def test_Logger(
157
158
  'logger.Logger object',
158
159
  logger)
159
160
 
160
- assert hash(logger) > 0
161
+ assert isinstance(
162
+ hash(logger), int)
161
163
 
162
164
  assert instr(
163
165
  'logger.Logger object',
@@ -64,7 +64,8 @@ def test_ConfigPath(
64
64
  'paths.ConfigPath object',
65
65
  path)
66
66
 
67
- assert hash(path) > 0
67
+ assert isinstance(
68
+ hash(path), int)
68
69
 
69
70
  assert instr(
70
71
  'paths.ConfigPath object',
@@ -98,7 +99,8 @@ def test_ConfigPaths(
98
99
  'paths.ConfigPaths object',
99
100
  paths)
100
101
 
101
- assert hash(paths) > 0
102
+ assert isinstance(
103
+ hash(paths), int)
102
104
 
103
105
  assert instr(
104
106
  'paths.ConfigPaths object',
@@ -62,12 +62,14 @@ class Crypts:
62
62
  Initialize instance for class using provided parameters.
63
63
  """
64
64
 
65
- from .params import CryptsParams
65
+ from .params import (
66
+ CryptsParams)
66
67
 
67
68
  if params is None:
68
69
  params = CryptsParams()
69
70
 
70
- self.__params = deepcopy(params)
71
+ self.__params = (
72
+ deepcopy(params))
71
73
 
72
74
 
73
75
  @property
@@ -96,16 +98,22 @@ class Crypts:
96
98
  :returns: Encrypted value using the relevant passphrase.
97
99
  """
98
100
 
99
- phrases = self.params.phrases
101
+ phrases = (
102
+ self.params
103
+ .phrases)
100
104
 
101
105
  if unique not in phrases:
102
106
  raise ValueError('unique')
103
107
 
104
- phrase = phrases[unique].phrase
108
+ phrase = (
109
+ phrases[unique]
110
+ .phrase)
111
+
112
+ encoded = value.encode()
105
113
 
106
114
  encrypt = (
107
115
  Fernet(phrase)
108
- .encrypt(value.encode())
116
+ .encrypt(encoded)
109
117
  .decode())
110
118
 
111
119
  return (
@@ -124,11 +132,16 @@ class Crypts:
124
132
  :returns: Decrypted value using the relevant passphrase.
125
133
  """
126
134
 
127
- phrases = self.params.phrases
135
+ phrases = (
136
+ self.params
137
+ .phrases)
128
138
 
129
139
  value = crypt_clean(value)
130
140
 
131
- if not re_match(ENCRYPT, value):
141
+ match = re_match(
142
+ ENCRYPT, value)
143
+
144
+ if match is None:
132
145
  raise ValueError('string')
133
146
 
134
147
  version, unique, value = (
@@ -137,11 +150,15 @@ class Crypts:
137
150
  if version != '1.0':
138
151
  raise ValueError('version')
139
152
 
140
- phrase = phrases[unique].phrase
153
+ phrase = (
154
+ phrases[unique]
155
+ .phrase)
156
+
157
+ encoded = value.encode()
141
158
 
142
159
  return (
143
160
  Fernet(phrase)
144
- .decrypt(value.encode())
161
+ .decrypt(encoded)
145
162
  .decode())
146
163
 
147
164
 
@@ -157,7 +174,9 @@ class Crypts:
157
174
  :param params: Parameters used to instantiate the class.
158
175
  """
159
176
 
160
- phrases = self.params.phrases
177
+ phrases = (
178
+ self.params
179
+ .phrases)
161
180
 
162
181
  if unique in phrases:
163
182
  raise ValueError('unique')
@@ -175,7 +194,9 @@ class Crypts:
175
194
  :param unique: Unique identifier of mapping passphrase.
176
195
  """
177
196
 
178
- phrases = self.params.phrases
197
+ phrases = (
198
+ self.params
199
+ .phrases)
179
200
 
180
201
  if unique not in phrases:
181
202
  raise ValueError('unique')
@@ -60,7 +60,8 @@ def test_Crypts(
60
60
  'crypts.Crypts object',
61
61
  crypts)
62
62
 
63
- assert hash(crypts) > 0
63
+ assert isinstance(
64
+ hash(crypts), int)
64
65
 
65
66
  assert instr(
66
67
  'crypts.Crypts object',
@@ -32,7 +32,8 @@ def test_Hashes() -> None:
32
32
  'hashes.Hashes object',
33
33
  hashes)
34
34
 
35
- assert hash(hashes) > 0
35
+ assert isinstance(
36
+ hash(hashes), int)
36
37
 
37
38
  assert instr(
38
39
  'hashes.Hashes object',
@@ -65,7 +65,8 @@ def test_Jinja2(
65
65
  'jinja2.Jinja2 object',
66
66
  jinja2)
67
67
 
68
- assert hash(jinja2) > 0
68
+ assert isinstance(
69
+ hash(jinja2), int)
69
70
 
70
71
  assert instr(
71
72
  'jinja2.Jinja2 object',
@@ -37,7 +37,8 @@ def test_Network() -> None:
37
37
  "Network('12.34.",
38
38
  naddr)
39
39
 
40
- assert hash(naddr) > 0
40
+ assert isinstance(
41
+ hash(naddr), int)
41
42
 
42
43
  assert instr(
43
44
  '12.34.56.7/32',
@@ -137,7 +137,7 @@ class Duration:
137
137
  :returns: Boolean indicating outcome from the operation.
138
138
  """
139
139
 
140
- return int(self.__source * 100000)
140
+ return hash(self.__source)
141
141
 
142
142
 
143
143
  def __str__(
@@ -34,7 +34,8 @@ def test_Duration() -> None:
34
34
  'Duration(seconds=95401',
35
35
  durate)
36
36
 
37
- assert hash(durate) > 0
37
+ assert isinstance(
38
+ hash(durate), int)
38
39
 
39
40
  assert str(durate) == '1d2h30m'
40
41
 
@@ -38,7 +38,8 @@ def test_Time() -> None:
38
38
  "Time('1970-01-01T00:00",
39
39
  time)
40
40
 
41
- assert hash(time) > 0
41
+ assert isinstance(
42
+ hash(time), int)
42
43
 
43
44
  assert instr(
44
45
  '1970-01-01T00:00:00.000',
@@ -52,7 +52,8 @@ def test_Timer(
52
52
  'timer.Timer object',
53
53
  timer)
54
54
 
55
- assert hash(timer) > 0
55
+ assert isinstance(
56
+ hash(timer), int)
56
57
 
57
58
  assert instr(
58
59
  'timer.Timer object',
@@ -109,7 +109,8 @@ def test_Timers(
109
109
  'timers.Timers object',
110
110
  timers)
111
111
 
112
- assert hash(timers) > 0
112
+ assert isinstance(
113
+ hash(timers), int)
113
114
 
114
115
  assert instr(
115
116
  'timers.Timers object',
@@ -68,7 +68,8 @@ def test_Window(
68
68
  'window.Window object',
69
69
  window)
70
70
 
71
- assert hash(window) > 0
71
+ assert isinstance(
72
+ hash(window), int)
72
73
 
73
74
  assert instr(
74
75
  'window.Window object',
@@ -122,7 +122,8 @@ def test_Windows(
122
122
  'windows.Windows object',
123
123
  windows)
124
124
 
125
- assert hash(windows) > 0
125
+ assert isinstance(
126
+ hash(windows), int)
126
127
 
127
128
  assert instr(
128
129
  'windows.Windows object',
@@ -395,7 +395,9 @@ class Timers:
395
395
  :returns: Newly constructed instance of related class.
396
396
  """
397
397
 
398
- config = self.params.timers
398
+ config = (
399
+ self.params
400
+ .timers)
399
401
 
400
402
  if unique in config:
401
403
  raise ValueError('unique')
@@ -443,7 +443,9 @@ class Windows:
443
443
  :returns: Newly constructed instance of related class.
444
444
  """
445
445
 
446
- config = self.params.windows
446
+ config = (
447
+ self.params
448
+ .windows)
447
449
 
448
450
  if unique in config:
449
451
  raise ValueError('unique')
@@ -32,7 +32,8 @@ def test_EmptyType() -> None:
32
32
 
33
33
  assert repr(empty) == 'Empty'
34
34
 
35
- assert hash(empty) > 0
35
+ assert isinstance(
36
+ hash(empty), int)
36
37
 
37
38
  assert str(empty) == 'Empty'
38
39
 
@@ -0,0 +1 @@
1
+ 0.20.2
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: encommon
3
- Version: 0.20.0
3
+ Version: 0.20.2
4
4
  Summary: Enasis Network Common Library
5
5
  License: MIT
6
6
  Classifier: Programming Language :: Python :: 3
@@ -1 +0,0 @@
1
- 0.20.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes