preparse 1.0.13__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.
- {preparse-1.0.13/src/preparse.egg-info → preparse-1.0.14.dev0}/PKG-INFO +2 -2
- {preparse-1.0.13 → preparse-1.0.14.dev0}/pyproject.toml +2 -2
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/_processing/digesting.py +1 -22
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/_processing/parsing.py +7 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0/src/preparse.egg-info}/PKG-INFO +2 -2
- {preparse-1.0.13 → preparse-1.0.14.dev0}/LICENSE.txt +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/MANIFEST.in +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/README.rst +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/docs/v1.0.rst +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/setup.cfg +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/__init__.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/_items/Bundle.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/_items/Item.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/_items/Long.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/_items/Option.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/_items/Positional.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/_items/Special.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/_items/__init__.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/_processing/__init__.py +1 -1
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/_processing/deparsing.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/_processing/pulling.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/_utils/__init__.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/_utils/dataprop.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/core/Click.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/core/Optdict.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/core/PreParser.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/core/__init__.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/core/enums.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/core/warnings.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/tests/__init__.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/tests/data.toml +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/tests/expit.toml +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/tests/test_data_toml.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/tests/test_enums.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/tests/test_expit_toml.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/tests/test_optdict.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse/tests/test_preparser.py +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse.egg-info/SOURCES.txt +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse.egg-info/dependency_links.txt +0 -0
- {preparse-1.0.13 → preparse-1.0.14.dev0}/src/preparse.egg-info/requires.txt +0 -0
- {preparse-1.0.13 → 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.
|
|
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 ::
|
|
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 ::
|
|
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.
|
|
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
|
-
|
|
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:
|
|
@@ -163,6 +166,8 @@ def parse_long(
|
|
|
163
166
|
cause(PAOW, option=arg, possibilities=parts)
|
|
164
167
|
return ans
|
|
165
168
|
(ans.fullkey,) = parts
|
|
169
|
+
if expandsabbr:
|
|
170
|
+
ans.abbrlen = len(ans.fullkey)
|
|
166
171
|
ans.nargs = optdict[ans.fullkey]
|
|
167
172
|
if (ans.nargs == Nargs.NO_ARGUMENT) and (ans.right is not None):
|
|
168
173
|
cause(PUAW, option=ans.fullkey)
|
|
@@ -187,6 +192,7 @@ def parse_option(
|
|
|
187
192
|
arg: str,
|
|
188
193
|
*,
|
|
189
194
|
cause: FunctionType,
|
|
195
|
+
expandsabbr: bool,
|
|
190
196
|
expectsabbr: bool,
|
|
191
197
|
optdict: dict,
|
|
192
198
|
**kwargs: Any,
|
|
@@ -195,6 +201,7 @@ def parse_option(
|
|
|
195
201
|
return parse_long(
|
|
196
202
|
arg,
|
|
197
203
|
cause=cause,
|
|
204
|
+
expandsabbr=expandsabbr,
|
|
198
205
|
expectsabbr=expectsabbr,
|
|
199
206
|
optdict=optdict,
|
|
200
207
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: preparse
|
|
3
|
-
Version: 1.0.
|
|
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 ::
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
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,
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|