ycleptic 2.0.2__tar.gz → 2.0.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 (73) hide show
  1. {ycleptic-2.0.2 → ycleptic-2.0.3}/PKG-INFO +2 -2
  2. {ycleptic-2.0.2 → ycleptic-2.0.3}/README.md +1 -1
  3. {ycleptic-2.0.2 → ycleptic-2.0.3}/pyproject.toml +1 -1
  4. {ycleptic-2.0.2 → ycleptic-2.0.3}/ycleptic/dictthings.py +1 -1
  5. {ycleptic-2.0.2 → ycleptic-2.0.3}/ycleptic/walkers.py +7 -7
  6. {ycleptic-2.0.2 → ycleptic-2.0.3}/.github/workflows/release.yaml +0 -0
  7. {ycleptic-2.0.2 → ycleptic-2.0.3}/.github/workflows/update_docs_only.yaml +0 -0
  8. {ycleptic-2.0.2 → ycleptic-2.0.3}/.gitignore +0 -0
  9. {ycleptic-2.0.2 → ycleptic-2.0.3}/.readthedocs.yaml +0 -0
  10. {ycleptic-2.0.2 → ycleptic-2.0.3}/LICENSE +0 -0
  11. {ycleptic-2.0.2 → ycleptic-2.0.3}/MANIFEST.in +0 -0
  12. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/Makefile +0 -0
  13. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/make.bat +0 -0
  14. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/requirements.txt +0 -0
  15. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/_static/css/custom.css +0 -0
  16. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/about.rst +0 -0
  17. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/api/API.rst +0 -0
  18. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/api/ycleptic.cli.rst +0 -0
  19. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/api/ycleptic.dictthings.rst +0 -0
  20. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/api/ycleptic.makedoc.rst +0 -0
  21. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/api/ycleptic.resources.rst +0 -0
  22. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/api/ycleptic.rst +0 -0
  23. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/api/ycleptic.stringthings.rst +0 -0
  24. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/api/ycleptic.walkers.rst +0 -0
  25. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/api/ycleptic.yclept.rst +0 -0
  26. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/conf.py +0 -0
  27. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/index.rst +0 -0
  28. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/installation.rst +0 -0
  29. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/usage/class.rst +0 -0
  30. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/usage/interactive_help.rst +0 -0
  31. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/usage/resource_file.rst +0 -0
  32. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/usage/the_base_config.rst +0 -0
  33. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/usage/the_user_config.rst +0 -0
  34. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/usage/yclept_config-help.rst +0 -0
  35. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/usage/yclept_makedoc.rst +0 -0
  36. {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/usage.rst +0 -0
  37. {ycleptic-2.0.2 → ycleptic-2.0.3}/pytest.ini +0 -0
  38. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/__init__.py +0 -0
  39. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/conftest.py +0 -0
  40. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/console-out.txt +0 -0
  41. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/example1.yaml +0 -0
  42. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/test_package/rootdir/README.md +0 -0
  43. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/test_package/rootdir/mypackage/__init__.py +0 -0
  44. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/test_package/rootdir/mypackage/config.py +0 -0
  45. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/test_package/rootdir/mypackage/data/__init__.py +0 -0
  46. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/test_package/rootdir/mypackage/data/base.yaml +0 -0
  47. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/test_package/rootdir/mypackage/docs/source/intro.rst +0 -0
  48. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/test_package/rootdir/mypackage/otherstuff/stuff.py +0 -0
  49. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/test_package/rootdir/setup.py +0 -0
  50. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/user-dump.yaml +0 -0
  51. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_1/attribute_1_1.rst +0 -0
  52. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_1.rst +0 -0
  53. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_2/attribute_2a/d2_a_dict.rst +0 -0
  54. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_2/attribute_2a.rst +0 -0
  55. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_2/attribute_2b.rst +0 -0
  56. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_2.rst +0 -0
  57. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_3/attribute_3_1/attribute_3_1_1/attribute_3_1_1_1.rst +0 -0
  58. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_3/attribute_3_1/attribute_3_1_1.rst +0 -0
  59. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_3/attribute_3_1.rst +0 -0
  60. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_3/attribute_3_2/d322/d322a.rst +0 -0
  61. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_3/attribute_3_2/d322/d322b.rst +0 -0
  62. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_3/attribute_3_2/d322.rst +0 -0
  63. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_3/attribute_3_2.rst +0 -0
  64. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_3.rst +0 -0
  65. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc.rst +0 -0
  66. {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set.py +0 -0
  67. {ycleptic-2.0.2 → ycleptic-2.0.3}/ycleptic/__init__.py +0 -0
  68. {ycleptic-2.0.2 → ycleptic-2.0.3}/ycleptic/cli.py +0 -0
  69. {ycleptic-2.0.2 → ycleptic-2.0.3}/ycleptic/makedoc.py +0 -0
  70. {ycleptic-2.0.2 → ycleptic-2.0.3}/ycleptic/resources/__init__.py +0 -0
  71. {ycleptic-2.0.2 → ycleptic-2.0.3}/ycleptic/resources/example_base.yaml +0 -0
  72. {ycleptic-2.0.2 → ycleptic-2.0.3}/ycleptic/stringthings.py +0 -0
  73. {ycleptic-2.0.2 → ycleptic-2.0.3}/ycleptic/yclept.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ycleptic
3
- Version: 2.0.2
3
+ Version: 2.0.3
4
4
  Summary: A YAML-format configuration generator
5
5
  Project-URL: Source, https://github.com/cameronabrams/ycleptic
6
6
  Project-URL: Documentation, https://ycleptic.readthedocs.io/en/latest/
@@ -34,7 +34,7 @@ pip install ycleptic
34
34
  Once installed, the developer has access to the ``Yclept`` class.
35
35
 
36
36
  ## Release History
37
- * 2.0.2
37
+ * 2.0.3
38
38
  * refactored to change `directive` to `attribute` throughout
39
39
  * 1.9.0
40
40
  * new `update_user` method
@@ -18,7 +18,7 @@ pip install ycleptic
18
18
  Once installed, the developer has access to the ``Yclept`` class.
19
19
 
20
20
  ## Release History
21
- * 2.0.2
21
+ * 2.0.3
22
22
  * refactored to change `directive` to `attribute` throughout
23
23
  * 1.9.0
24
24
  * new `update_user` method
@@ -3,7 +3,7 @@ requires = ["hatchling"]
3
3
  build-backend = "hatchling.build"
4
4
  [project]
5
5
  name = "ycleptic"
6
- version = "2.0.2"
6
+ version = "2.0.3"
7
7
  authors = [
8
8
  { name="Cameron F Abrams", email="cfa22@drexel.edu" },
9
9
  ]
@@ -1,7 +1,7 @@
1
1
  # Author: Cameron F. Abrams <cfa22@drexel.edu>
2
2
 
3
3
  """
4
- Utilities for modifying dictionary entries in the directive tree
4
+ Utilities for modifying dictionary entries in the Attribute tree
5
5
  """
6
6
 
7
7
  import logging
@@ -93,7 +93,7 @@ def dwalk(D: dict, I: dict):
93
93
  The user's config dictionary to be processed.
94
94
  """
95
95
  if not 'attributes' in D:
96
- raise ValueError(f'Directive {D["name"]} has no attributes; cannot walk through it.')
96
+ raise ValueError(f'Attribute {D["name"]} has no attributes; cannot walk through it.')
97
97
  # get the name of each config attribute at this level in this block
98
98
  tld = [x['name'] for x in D['attributes']]
99
99
  if I == None:
@@ -102,7 +102,7 @@ def dwalk(D: dict, I: dict):
102
102
  ud = list(I.keys())
103
103
  for u in ud:
104
104
  if not u in tld:
105
- raise_clean(ValueError(f'Directive \'{u}\' invalid; expecting one of {tld} under \'{D["name"]}\'.'))
105
+ raise_clean(ValueError(f'Attribute \'{u}\' invalid; expecting one of {tld} under \'{D["name"]}\'.'))
106
106
  # logger.debug(f'dwalk along {tld} for {I}')
107
107
  # for each attribute name
108
108
  for d in tld:
@@ -114,7 +114,7 @@ def dwalk(D: dict, I: dict):
114
114
  # get its type
115
115
  typ = dx['type']
116
116
  if typ == 'dict' and (d in I and not type(I[d]) == dict):
117
- raise_clean(ValueError(f'Directive \'{d}\' of \'{D["name"]}\' must be a dict; found {type(I[d])}.'))
117
+ raise_clean(ValueError(f'Attribute \'{d}\' of \'{D["name"]}\' must be a dict; found {type(I[d])}.'))
118
118
  # logger.debug(f' - {d} typ {typ} I {I[d]}
119
119
  # logger.debug(f'- {d} typ {typ} I {I}')
120
120
  # if this attribute name does not already have a key in the result
@@ -129,7 +129,7 @@ def dwalk(D: dict, I: dict):
129
129
  # if it is flagged as required, die since it is not in the read-in
130
130
  elif 'required' in dx:
131
131
  if dx['required']:
132
- raise_clean(ValueError(f'Directive \'{d}\' of \'{D["name"]}\' requires a value.'))
132
+ raise_clean(ValueError(f'Attribute \'{d}\' of \'{D["name"]}\' requires a value.'))
133
133
  # if it is a dict
134
134
  elif typ == 'dict':
135
135
  # if it is explicitly tagged as not required, do nothing
@@ -159,11 +159,11 @@ def dwalk(D: dict, I: dict):
159
159
  if not case_sensitive:
160
160
  # just check the choices that were provided by the user
161
161
  if not I[d].casefold() in [x.casefold() for x in dx['choices']]:
162
- raise_clean(ValueError(f'Directive \'{d}\' of \'{dx["name"]}\' must be one of {", ".join(dx["choices"])} (case-insensitive); found \'{I[d]}\''))
162
+ raise_clean(ValueError(f'Attribute \'{d}\' of \'{dx["name"]}\' must be one of {", ".join(dx["choices"])} (case-insensitive); found \'{I[d]}\''))
163
163
  else:
164
164
  # check the choices that were provided by the user
165
165
  if not I[d] in dx['choices']:
166
- raise_clean(ValueError(f'Directive \'{d}\' of \'{dx["name"]}\' must be one of {", ".join(dx["choices"])}; found \'{I[d]}\''))
166
+ raise_clean(ValueError(f'Attribute \'{d}\' of \'{dx["name"]}\' must be one of {", ".join(dx["choices"])}; found \'{I[d]}\''))
167
167
  elif typ == 'dict':
168
168
  # process descendants
169
169
  if 'attributes' in dx:
@@ -179,7 +179,7 @@ def dwalk(D: dict, I: dict):
179
179
  I[d] = defaults + I[d]
180
180
  elif typ == 'tuple':
181
181
  if 'attributes' in dx:
182
- raise_clean(TypeError(f'Directive \'{d}\' of \'{D["name"]}\' cannot have subattributes.'))
182
+ raise_clean(TypeError(f'Attribute \'{d}\' of \'{D["name"]}\' cannot have subattributes.'))
183
183
  I[d] = dx.get('default', ())
184
184
 
185
185
  def lwalk(D: dict, L: list[dict]):
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
File without changes
File without changes
File without changes
File without changes
File without changes