preparse 1.0.12__tar.gz → 1.0.14.dev0__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 (41) hide show
  1. {preparse-1.0.12/src/preparse.egg-info → preparse-1.0.14.dev0}/PKG-INFO +2 -2
  2. {preparse-1.0.12 → preparse-1.0.14.dev0}/pyproject.toml +2 -2
  3. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/_processing/digesting.py +1 -22
  4. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/_processing/parsing.py +9 -5
  5. {preparse-1.0.12 → preparse-1.0.14.dev0/src/preparse.egg-info}/PKG-INFO +2 -2
  6. {preparse-1.0.12 → preparse-1.0.14.dev0}/LICENSE.txt +0 -0
  7. {preparse-1.0.12 → preparse-1.0.14.dev0}/MANIFEST.in +0 -0
  8. {preparse-1.0.12 → preparse-1.0.14.dev0}/README.rst +0 -0
  9. {preparse-1.0.12 → preparse-1.0.14.dev0}/docs/v1.0.rst +0 -0
  10. {preparse-1.0.12 → preparse-1.0.14.dev0}/setup.cfg +0 -0
  11. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/__init__.py +0 -0
  12. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/_items/Bundle.py +0 -0
  13. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/_items/Item.py +0 -0
  14. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/_items/Long.py +0 -0
  15. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/_items/Option.py +0 -0
  16. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/_items/Positional.py +0 -0
  17. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/_items/Special.py +0 -0
  18. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/_items/__init__.py +0 -0
  19. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/_processing/__init__.py +1 -1
  20. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/_processing/deparsing.py +0 -0
  21. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/_processing/pulling.py +0 -0
  22. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/_utils/__init__.py +0 -0
  23. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/_utils/dataprop.py +0 -0
  24. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/core/Click.py +0 -0
  25. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/core/Optdict.py +0 -0
  26. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/core/PreParser.py +0 -0
  27. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/core/__init__.py +0 -0
  28. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/core/enums.py +0 -0
  29. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/core/warnings.py +0 -0
  30. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/tests/__init__.py +0 -0
  31. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/tests/data.toml +0 -0
  32. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/tests/expit.toml +0 -0
  33. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/tests/test_data_toml.py +0 -0
  34. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/tests/test_enums.py +0 -0
  35. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/tests/test_expit_toml.py +0 -0
  36. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/tests/test_optdict.py +0 -0
  37. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse/tests/test_preparser.py +0 -0
  38. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse.egg-info/SOURCES.txt +0 -0
  39. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse.egg-info/dependency_links.txt +0 -0
  40. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse.egg-info/requires.txt +0 -0
  41. {preparse-1.0.12 → preparse-1.0.14.dev0}/src/preparse.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: preparse
3
- Version: 1.0.12
3
+ Version: 1.0.14.dev0
4
4
  Summary: This project preparses args for further parsing later on.
5
5
  Author-email: Johannes <johannes.programming@gmail.com>
6
6
  License: The MIT License (MIT)
@@ -28,7 +28,7 @@ Project-URL: Download, https://pypi.org/project/preparse/#files
28
28
  Project-URL: Index, https://pypi.org/project/preparse/
29
29
  Project-URL: Source, https://github.com/johannes-programming/preparse/
30
30
  Project-URL: Website, https://preparse.johannes-programming.online/
31
- Classifier: Development Status :: 5 - Production/Stable
31
+ Classifier: Development Status :: 3 - Alpha
32
32
  Classifier: License :: OSI Approved :: MIT License
33
33
  Classifier: Natural Language :: English
34
34
  Classifier: Operating System :: OS Independent
@@ -9,7 +9,7 @@ authors = [
9
9
  { email = "johannes.programming@gmail.com", name = "Johannes" },
10
10
  ]
11
11
  classifiers = [
12
- "Development Status :: 5 - Production/Stable",
12
+ "Development Status :: 3 - Alpha",
13
13
  "License :: OSI Approved :: MIT License",
14
14
  "Natural Language :: English",
15
15
  "Operating System :: OS Independent",
@@ -34,7 +34,7 @@ keywords = []
34
34
  name = "preparse"
35
35
  readme = "README.rst"
36
36
  requires-python = ">=3.11"
37
- version = "1.0.12"
37
+ version = "1.0.14.dev0"
38
38
 
39
39
  [project.license]
40
40
  file = "LICENSE.txt"
@@ -2,7 +2,6 @@ from typing import *
2
2
 
3
3
  from preparse._items.Bundle import Bundle
4
4
  from preparse._items.Item import Item
5
- from preparse._items.Long import Long
6
5
  from preparse._items.Option import Option
7
6
  from preparse._items.Positional import Positional
8
7
  from preparse._items.Special import Special
@@ -17,17 +16,13 @@ def digest(
17
16
  *,
18
17
  allowslong: bool,
19
18
  bundling: Tuning,
20
- expandsabbr: bool,
21
19
  expectsposix: bool,
22
20
  reconcilesorders: bool,
23
21
  special: Tuning,
24
22
  ) -> list[Item]:
25
23
  ans: list[Item]
26
24
  ans = list(items)
27
- ans = digest_abbr(
28
- ans,
29
- expandsabbr=expandsabbr,
30
- )
25
+
31
26
  ans = digest_special(
32
27
  ans,
33
28
  expectsposix=expectsposix,
@@ -47,22 +42,6 @@ def digest(
47
42
  return ans
48
43
 
49
44
 
50
- def digest_abbr(
51
- items: list[Item],
52
- *,
53
- expandsabbr: bool,
54
- ) -> list[Item]:
55
- ans: list[Item]
56
- item: Item
57
- ans = list(items)
58
- if not expandsabbr:
59
- return ans
60
- for item in ans:
61
- if isinstance(item, Long):
62
- item.abbrlen = None
63
- return ans
64
-
65
-
66
45
  def digest_bundling(
67
46
  items: list[Item],
68
47
  *,
@@ -66,6 +66,7 @@ def parse_generator(
66
66
  *,
67
67
  allowslong: bool,
68
68
  allowsshort: bool,
69
+ expandsabbr: bool,
69
70
  expectsabbr: bool,
70
71
  expectsposix: bool,
71
72
  optdict: dict,
@@ -105,6 +106,7 @@ def parse_generator(
105
106
  allowslong=allowslong,
106
107
  allowsshort=allowsshort,
107
108
  cause=cause,
109
+ expandsabbr=expandsabbr,
108
110
  expectsabbr=expectsabbr,
109
111
  optdict=optdict,
110
112
  )
@@ -137,6 +139,7 @@ def parse_long(
137
139
  arg: str,
138
140
  *,
139
141
  cause: FunctionType,
142
+ expandsabbr: bool,
140
143
  expectsabbr: bool,
141
144
  optdict: dict,
142
145
  ) -> Long:
@@ -149,11 +152,8 @@ def parse_long(
149
152
  ans.right = parts.pop()
150
153
  ans.abbrlen = len(ans.fullkey)
151
154
  if ans.fullkey in optdict.keys():
152
- ans.nargs = optdict[ans.fullkey]
153
- if (ans.nargs == Nargs.NO_ARGUMENT) and (ans.right is not None):
154
- cause(PUAW, option=ans.fullkey)
155
- return ans
156
- if expectsabbr:
155
+ parts = [ans.fullkey]
156
+ elif expectsabbr:
157
157
  parts = parse_long_startswith(ans.abbr, keys=optdict.keys())
158
158
  else:
159
159
  parts = list() # can be assumed
@@ -166,6 +166,8 @@ def parse_long(
166
166
  cause(PAOW, option=arg, possibilities=parts)
167
167
  return ans
168
168
  (ans.fullkey,) = parts
169
+ if expandsabbr:
170
+ ans.abbrlen = len(ans.fullkey)
169
171
  ans.nargs = optdict[ans.fullkey]
170
172
  if (ans.nargs == Nargs.NO_ARGUMENT) and (ans.right is not None):
171
173
  cause(PUAW, option=ans.fullkey)
@@ -190,6 +192,7 @@ def parse_option(
190
192
  arg: str,
191
193
  *,
192
194
  cause: FunctionType,
195
+ expandsabbr: bool,
193
196
  expectsabbr: bool,
194
197
  optdict: dict,
195
198
  **kwargs: Any,
@@ -198,6 +201,7 @@ def parse_option(
198
201
  return parse_long(
199
202
  arg,
200
203
  cause=cause,
204
+ expandsabbr=expandsabbr,
201
205
  expectsabbr=expectsabbr,
202
206
  optdict=optdict,
203
207
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: preparse
3
- Version: 1.0.12
3
+ Version: 1.0.14.dev0
4
4
  Summary: This project preparses args for further parsing later on.
5
5
  Author-email: Johannes <johannes.programming@gmail.com>
6
6
  License: The MIT License (MIT)
@@ -28,7 +28,7 @@ Project-URL: Download, https://pypi.org/project/preparse/#files
28
28
  Project-URL: Index, https://pypi.org/project/preparse/
29
29
  Project-URL: Source, https://github.com/johannes-programming/preparse/
30
30
  Project-URL: Website, https://preparse.johannes-programming.online/
31
- Classifier: Development Status :: 5 - Production/Stable
31
+ Classifier: Development Status :: 3 - Alpha
32
32
  Classifier: License :: OSI Approved :: MIT License
33
33
  Classifier: Natural Language :: English
34
34
  Classifier: Operating System :: OS Independent
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -34,6 +34,7 @@ def process(
34
34
  items,
35
35
  allowslong=allowslong,
36
36
  allowsshort=allowsshort,
37
+ expandsabbr=expandsabbr,
37
38
  expectsabbr=expectsabbr,
38
39
  expectsposix=expectsposix,
39
40
  optdict=optdict,
@@ -44,7 +45,6 @@ def process(
44
45
  items,
45
46
  allowslong=allowslong,
46
47
  bundling=bundling,
47
- expandsabbr=expandsabbr,
48
48
  expectsposix=expectsposix,
49
49
  reconcilesorders=reconcilesorders,
50
50
  special=special,