encommon 0.22.1__tar.gz → 0.22.3__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 (144) hide show
  1. {encommon-0.22.1/encommon.egg-info → encommon-0.22.3}/PKG-INFO +1 -1
  2. {encommon-0.22.1 → encommon-0.22.3}/encommon/parse/jinja2.py +5 -4
  3. encommon-0.22.3/encommon/version.txt +1 -0
  4. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/scripts/default.js +75 -9
  5. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/styles/default.css +12 -0
  6. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/styles/image.css +0 -12
  7. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/test/test_default.py +27 -1
  8. {encommon-0.22.1 → encommon-0.22.3/encommon.egg-info}/PKG-INFO +1 -1
  9. encommon-0.22.1/encommon/version.txt +0 -1
  10. {encommon-0.22.1 → encommon-0.22.3}/LICENSE +0 -0
  11. {encommon-0.22.1 → encommon-0.22.3}/MANIFEST.in +0 -0
  12. {encommon-0.22.1 → encommon-0.22.3}/README.md +0 -0
  13. {encommon-0.22.1 → encommon-0.22.3}/encommon/__init__.py +0 -0
  14. {encommon-0.22.1 → encommon-0.22.3}/encommon/colors/__init__.py +0 -0
  15. {encommon-0.22.1 → encommon-0.22.3}/encommon/colors/color.py +0 -0
  16. {encommon-0.22.1 → encommon-0.22.3}/encommon/colors/test/__init__.py +0 -0
  17. {encommon-0.22.1 → encommon-0.22.3}/encommon/colors/test/test_color.py +0 -0
  18. {encommon-0.22.1 → encommon-0.22.3}/encommon/config/__init__.py +0 -0
  19. {encommon-0.22.1 → encommon-0.22.3}/encommon/config/config.py +0 -0
  20. {encommon-0.22.1 → encommon-0.22.3}/encommon/config/files.py +0 -0
  21. {encommon-0.22.1 → encommon-0.22.3}/encommon/config/logger.py +0 -0
  22. {encommon-0.22.1 → encommon-0.22.3}/encommon/config/params.py +0 -0
  23. {encommon-0.22.1 → encommon-0.22.3}/encommon/config/paths.py +0 -0
  24. {encommon-0.22.1 → encommon-0.22.3}/encommon/config/test/__init__.py +0 -0
  25. {encommon-0.22.1 → encommon-0.22.3}/encommon/config/test/test_config.py +0 -0
  26. {encommon-0.22.1 → encommon-0.22.3}/encommon/config/test/test_files.py +0 -0
  27. {encommon-0.22.1 → encommon-0.22.3}/encommon/config/test/test_logger.py +0 -0
  28. {encommon-0.22.1 → encommon-0.22.3}/encommon/config/test/test_paths.py +0 -0
  29. {encommon-0.22.1 → encommon-0.22.3}/encommon/config/test/test_utils.py +0 -0
  30. {encommon-0.22.1 → encommon-0.22.3}/encommon/config/utils.py +0 -0
  31. {encommon-0.22.1 → encommon-0.22.3}/encommon/conftest.py +0 -0
  32. {encommon-0.22.1 → encommon-0.22.3}/encommon/crypts/__init__.py +0 -0
  33. {encommon-0.22.1 → encommon-0.22.3}/encommon/crypts/crypts.py +0 -0
  34. {encommon-0.22.1 → encommon-0.22.3}/encommon/crypts/hashes.py +0 -0
  35. {encommon-0.22.1 → encommon-0.22.3}/encommon/crypts/params.py +0 -0
  36. {encommon-0.22.1 → encommon-0.22.3}/encommon/crypts/test/__init__.py +0 -0
  37. {encommon-0.22.1 → encommon-0.22.3}/encommon/crypts/test/test_crypts.py +0 -0
  38. {encommon-0.22.1 → encommon-0.22.3}/encommon/crypts/test/test_hashes.py +0 -0
  39. {encommon-0.22.1 → encommon-0.22.3}/encommon/parse/__init__.py +0 -0
  40. {encommon-0.22.1 → encommon-0.22.3}/encommon/parse/network.py +0 -0
  41. {encommon-0.22.1 → encommon-0.22.3}/encommon/parse/test/__init__.py +0 -0
  42. {encommon-0.22.1 → encommon-0.22.3}/encommon/parse/test/test_jinja2.py +0 -0
  43. {encommon-0.22.1 → encommon-0.22.3}/encommon/parse/test/test_network.py +0 -0
  44. {encommon-0.22.1 → encommon-0.22.3}/encommon/py.typed +0 -0
  45. {encommon-0.22.1 → encommon-0.22.3}/encommon/times/__init__.py +0 -0
  46. {encommon-0.22.1 → encommon-0.22.3}/encommon/times/common.py +0 -0
  47. {encommon-0.22.1 → encommon-0.22.3}/encommon/times/duration.py +0 -0
  48. {encommon-0.22.1 → encommon-0.22.3}/encommon/times/params.py +0 -0
  49. {encommon-0.22.1 → encommon-0.22.3}/encommon/times/parse.py +0 -0
  50. {encommon-0.22.1 → encommon-0.22.3}/encommon/times/test/__init__.py +0 -0
  51. {encommon-0.22.1 → encommon-0.22.3}/encommon/times/test/test_duration.py +0 -0
  52. {encommon-0.22.1 → encommon-0.22.3}/encommon/times/test/test_params.py +0 -0
  53. {encommon-0.22.1 → encommon-0.22.3}/encommon/times/test/test_parse.py +0 -0
  54. {encommon-0.22.1 → encommon-0.22.3}/encommon/times/test/test_time.py +0 -0
  55. {encommon-0.22.1 → encommon-0.22.3}/encommon/times/test/test_timer.py +0 -0
  56. {encommon-0.22.1 → encommon-0.22.3}/encommon/times/test/test_timers.py +0 -0
  57. {encommon-0.22.1 → encommon-0.22.3}/encommon/times/test/test_unitime.py +0 -0
  58. {encommon-0.22.1 → encommon-0.22.3}/encommon/times/test/test_utils.py +0 -0
  59. {encommon-0.22.1 → encommon-0.22.3}/encommon/times/test/test_window.py +0 -0
  60. {encommon-0.22.1 → encommon-0.22.3}/encommon/times/test/test_windows.py +0 -0
  61. {encommon-0.22.1 → encommon-0.22.3}/encommon/times/time.py +0 -0
  62. {encommon-0.22.1 → encommon-0.22.3}/encommon/times/timer.py +0 -0
  63. {encommon-0.22.1 → encommon-0.22.3}/encommon/times/timers.py +0 -0
  64. {encommon-0.22.1 → encommon-0.22.3}/encommon/times/unitime.py +0 -0
  65. {encommon-0.22.1 → encommon-0.22.3}/encommon/times/utils.py +0 -0
  66. {encommon-0.22.1 → encommon-0.22.3}/encommon/times/window.py +0 -0
  67. {encommon-0.22.1 → encommon-0.22.3}/encommon/times/windows.py +0 -0
  68. {encommon-0.22.1 → encommon-0.22.3}/encommon/types/__init__.py +0 -0
  69. {encommon-0.22.1 → encommon-0.22.3}/encommon/types/classes.py +0 -0
  70. {encommon-0.22.1 → encommon-0.22.3}/encommon/types/dicts.py +0 -0
  71. {encommon-0.22.1 → encommon-0.22.3}/encommon/types/empty.py +0 -0
  72. {encommon-0.22.1 → encommon-0.22.3}/encommon/types/lists.py +0 -0
  73. {encommon-0.22.1 → encommon-0.22.3}/encommon/types/notate.py +0 -0
  74. {encommon-0.22.1 → encommon-0.22.3}/encommon/types/strings.py +0 -0
  75. {encommon-0.22.1 → encommon-0.22.3}/encommon/types/test/__init__.py +0 -0
  76. {encommon-0.22.1 → encommon-0.22.3}/encommon/types/test/test_classes.py +0 -0
  77. {encommon-0.22.1 → encommon-0.22.3}/encommon/types/test/test_dicts.py +0 -0
  78. {encommon-0.22.1 → encommon-0.22.3}/encommon/types/test/test_empty.py +0 -0
  79. {encommon-0.22.1 → encommon-0.22.3}/encommon/types/test/test_lists.py +0 -0
  80. {encommon-0.22.1 → encommon-0.22.3}/encommon/types/test/test_notate.py +0 -0
  81. {encommon-0.22.1 → encommon-0.22.3}/encommon/types/test/test_strings.py +0 -0
  82. {encommon-0.22.1 → encommon-0.22.3}/encommon/types/types.py +0 -0
  83. {encommon-0.22.1 → encommon-0.22.3}/encommon/utils/__init__.py +0 -0
  84. {encommon-0.22.1 → encommon-0.22.3}/encommon/utils/common.py +0 -0
  85. {encommon-0.22.1 → encommon-0.22.3}/encommon/utils/files.py +0 -0
  86. {encommon-0.22.1 → encommon-0.22.3}/encommon/utils/match.py +0 -0
  87. {encommon-0.22.1 → encommon-0.22.3}/encommon/utils/paths.py +0 -0
  88. {encommon-0.22.1 → encommon-0.22.3}/encommon/utils/sample.py +0 -0
  89. {encommon-0.22.1 → encommon-0.22.3}/encommon/utils/stdout.py +0 -0
  90. {encommon-0.22.1 → encommon-0.22.3}/encommon/utils/test/__init__.py +0 -0
  91. {encommon-0.22.1 → encommon-0.22.3}/encommon/utils/test/test_files.py +0 -0
  92. {encommon-0.22.1 → encommon-0.22.3}/encommon/utils/test/test_match.py +0 -0
  93. {encommon-0.22.1 → encommon-0.22.3}/encommon/utils/test/test_paths.py +0 -0
  94. {encommon-0.22.1 → encommon-0.22.3}/encommon/utils/test/test_sample.py +0 -0
  95. {encommon-0.22.1 → encommon-0.22.3}/encommon/utils/test/test_stdout.py +0 -0
  96. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/__init__.py +0 -0
  97. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/content.py +0 -0
  98. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/images/enasis.svg +0 -0
  99. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/images/failure.svg +0 -0
  100. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/images/information.svg +0 -0
  101. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/images/success.svg +0 -0
  102. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/images/warning.svg +0 -0
  103. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/index.html +0 -0
  104. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/scripts/color.js +0 -0
  105. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/scripts/datagrid.js +0 -0
  106. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/scripts/datetime.js +0 -0
  107. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/scripts/duration.js +0 -0
  108. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/scripts/helpers.js +0 -0
  109. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/scripts/image.js +0 -0
  110. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/scripts/message.js +0 -0
  111. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/scripts/moderate.js +0 -0
  112. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/scripts/numeric.js +0 -0
  113. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/scripts/statate.js +0 -0
  114. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/scripts/tagues.js +0 -0
  115. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/styles/color.css +0 -0
  116. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/styles/datagrid.css +0 -0
  117. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/styles/datetime.css +0 -0
  118. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/styles/duration.css +0 -0
  119. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/styles/message.css +0 -0
  120. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/styles/moderate.css +0 -0
  121. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/styles/numeric.css +0 -0
  122. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/styles/statate.css +0 -0
  123. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/styles/tagues.css +0 -0
  124. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/test/__init__.py +0 -0
  125. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/test/conftest.py +0 -0
  126. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/test/test_color.py +0 -0
  127. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/test/test_content.py +0 -0
  128. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/test/test_datagrid.py +0 -0
  129. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/test/test_datetime.py +0 -0
  130. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/test/test_duration.py +0 -0
  131. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/test/test_helpers.py +0 -0
  132. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/test/test_image.py +0 -0
  133. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/test/test_message.py +0 -0
  134. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/test/test_moderate.py +0 -0
  135. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/test/test_numeric.py +0 -0
  136. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/test/test_statate.py +0 -0
  137. {encommon-0.22.1 → encommon-0.22.3}/encommon/webkit/test/test_tagues.py +0 -0
  138. {encommon-0.22.1 → encommon-0.22.3}/encommon.egg-info/SOURCES.txt +0 -0
  139. {encommon-0.22.1 → encommon-0.22.3}/encommon.egg-info/dependency_links.txt +0 -0
  140. {encommon-0.22.1 → encommon-0.22.3}/encommon.egg-info/requires.txt +0 -0
  141. {encommon-0.22.1 → encommon-0.22.3}/encommon.egg-info/top_level.txt +0 -0
  142. {encommon-0.22.1 → encommon-0.22.3}/pyproject.toml +0 -0
  143. {encommon-0.22.1 → encommon-0.22.3}/require/install.txt +0 -0
  144. {encommon-0.22.1 → encommon-0.22.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: encommon
3
- Version: 0.22.1
3
+ Version: 0.22.3
4
4
  Summary: Enasis Network Common Library
5
5
  License: MIT
6
6
  Project-URL: Source, https://github.com/enasisnetwork/encommon
@@ -45,6 +45,7 @@ from ..utils import rgxp_match
45
45
 
46
46
 
47
47
  FILTER = Callable[..., Any]
48
+ FILTERS = dict[str, FILTER]
48
49
 
49
50
  JINJA2 = (
50
51
  r'(\{\{.+?\}\})|'
@@ -57,7 +58,7 @@ LITERAL = (
57
58
 
58
59
 
59
60
 
60
- DEFAULT: dict[str, FILTER] = {
61
+ DEFAULT: FILTERS = {
61
62
 
62
63
  # Python builtins
63
64
  'all': all,
@@ -115,7 +116,7 @@ class Jinja2:
115
116
  """
116
117
 
117
118
  __statics: DictStrAny
118
- __filters: dict[str, FILTER]
119
+ __filters: FILTERS
119
120
 
120
121
  __jinjenv: Environment
121
122
 
@@ -123,7 +124,7 @@ class Jinja2:
123
124
  def __init__(
124
125
  self,
125
126
  statics: Optional[DictStrAny] = None,
126
- filters: Optional[dict[str, FILTER]] = None,
127
+ filters: Optional[FILTERS] = None,
127
128
  ) -> None:
128
129
  """
129
130
  Initialize instance for class using provided parameters.
@@ -176,7 +177,7 @@ class Jinja2:
176
177
  @property
177
178
  def filters(
178
179
  self,
179
- ) -> dict[str, FILTER]:
180
+ ) -> FILTERS:
180
181
  """
181
182
  Return the value for the attribute from class instance.
182
183
 
@@ -0,0 +1 @@
1
+ 0.22.3
@@ -91,6 +91,9 @@ is permitted, for more information consult the project license file.
91
91
  $.prototype
92
92
  .attr = _enquery_attr;
93
93
 
94
+ $.prototype
95
+ .prop = _enquery_prop;
96
+
94
97
  })(window);
95
98
 
96
99
 
@@ -181,20 +184,51 @@ function _enquery_remcls(
181
184
  function _enquery_hide() {
182
185
  // Helper function for Enasis Network jQuery replacement.
183
186
 
184
- let returned =
185
- this.css('display', 'none');
186
187
 
187
- return returned; }
188
+ function _each() {
189
+
190
+ let dataset = this.dataset;
191
+ let style = this.style;
192
+ let hide = dataset.enqHide;
193
+
194
+ if (hide === undefined
195
+ && style.display != 'none'
196
+ && !isempty(style.display))
197
+ dataset.enqHide =
198
+ style.display;
199
+
200
+ style.display = 'none'; }
201
+
202
+
203
+ return this.each(_each); }
188
204
 
189
205
 
190
206
 
191
207
  function _enquery_show() {
192
208
  // Helper function for Enasis Network jQuery replacement.
193
209
 
194
- let returned =
195
- this.css('display', 'block');
196
210
 
197
- return returned; }
211
+ function _each() {
212
+
213
+ let dataset = this.dataset;
214
+ let style = this.style;
215
+ let hide = dataset.enqHide;
216
+
217
+ if (hide !== undefined) {
218
+ if (!isempty(hide))
219
+ style.display = hide;
220
+ else
221
+ style
222
+ .removeProperty('display');
223
+
224
+ delete dataset.enqHide; }
225
+
226
+ else
227
+ style
228
+ .removeProperty('display'); }
229
+
230
+
231
+ return this.each(_each); }
198
232
 
199
233
 
200
234
 
@@ -262,7 +296,7 @@ function _enquery_append(
262
296
  (x) => {
263
297
  const element =
264
298
  index < 1 ?
265
- x : node.cloneNode(true);
299
+ x : x.cloneNode(true);
266
300
  this
267
301
  .appendChild(element); }); }
268
302
 
@@ -305,9 +339,17 @@ function _enquery_attr(
305
339
  if (this.length === 0)
306
340
  return undefined;
307
341
 
342
+
343
+ function _each() {
344
+ if (value === null)
345
+ this.removeAttribute(name);
346
+ else
347
+ this.setAttribute(
348
+ name, value); }
349
+
308
350
  if (value !== undefined)
309
- this[0]
310
- .setAttribute(name, value);
351
+ return this.each(_each);
352
+
311
353
 
312
354
  let returned =
313
355
  this[0]
@@ -317,6 +359,30 @@ function _enquery_attr(
317
359
 
318
360
 
319
361
 
362
+ function _enquery_prop(
363
+ name,
364
+ value,
365
+ ) {
366
+ // Helper function for Enasis Network jQuery replacement.
367
+
368
+ if (this.length === 0)
369
+ return undefined;
370
+
371
+
372
+ function _each() {
373
+ if (value === null)
374
+ this.removeProperty(name);
375
+ else
376
+ this[name] = value; }
377
+
378
+ if (value !== undefined)
379
+ return this.each(_each);
380
+
381
+
382
+ return this[0][name]; }
383
+
384
+
385
+
320
386
  function _enquery_clone() {
321
387
 
322
388
  let clones =
@@ -63,6 +63,18 @@ is permitted, for more information consult the project license file.
63
63
 
64
64
 
65
65
 
66
+ /*****************************************/
67
+ /* Extended structure for image elements */
68
+ /*****************************************/
69
+
70
+ :root {
71
+ --svgicon-failure: url('/images/failure');
72
+ --svgicon-information: url('/images/information');
73
+ --svgicon-success: url('/images/success');
74
+ --svgicon-warning: url('/images/warning'); }
75
+
76
+
77
+
66
78
  /************************************/
67
79
  /* Initial default for all elements */
68
80
  /************************************/
@@ -23,18 +23,6 @@ is permitted, for more information consult the project license file.
23
23
 
24
24
 
25
25
 
26
- /*****************************************/
27
- /* Extended structure for image elements */
28
- /*****************************************/
29
-
30
- :root {
31
- --svgicon-failure: url('/images/failure');
32
- --svgicon-information: url('/images/information');
33
- --svgicon-success: url('/images/success');
34
- --svgicon-warning: url('/images/warning'); }
35
-
36
-
37
-
38
26
  /*****************************************/
39
27
  /* Extended structure for image elements */
40
28
  /*****************************************/
@@ -192,7 +192,7 @@ def test_default_showhide(
192
192
  '$("body>div")[0]'
193
193
  '.style.display;')
194
194
 
195
- assert outcome == 'block'
195
+ assert outcome == SEMPTY
196
196
 
197
197
 
198
198
 
@@ -312,3 +312,29 @@ def test_default_attr(
312
312
  wrap=False)
313
313
 
314
314
  assert outcome == 'bar'
315
+
316
+
317
+
318
+ def test_default_prop(
319
+ prepare: tuple['Content', WebDriver],
320
+ ) -> None:
321
+ """
322
+ Perform various tests associated with relevant routines.
323
+
324
+ :param prepare: Driver and content loaded with scripts.
325
+ """
326
+
327
+ content, driver = prepare
328
+
329
+ _executejs(
330
+ driver,
331
+ '$("body")'
332
+ '.prop("foo", "bar")')
333
+
334
+ outcome = _executejs(
335
+ driver,
336
+ 'return $("body")'
337
+ ' .prop("foo");',
338
+ wrap=False)
339
+
340
+ assert outcome == 'bar'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: encommon
3
- Version: 0.22.1
3
+ Version: 0.22.3
4
4
  Summary: Enasis Network Common Library
5
5
  License: MIT
6
6
  Project-URL: Source, https://github.com/enasisnetwork/encommon
@@ -1 +0,0 @@
1
- 0.22.1
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes