asnkit-gen-python 2.0.0rc3__tar.gz → 2.0.0rc5__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.
- {asnkit_gen_python-2.0.0rc3 → asnkit_gen_python-2.0.0rc5}/PKG-INFO +5 -7
- {asnkit_gen_python-2.0.0rc3 → asnkit_gen_python-2.0.0rc5}/README.rst +3 -5
- {asnkit_gen_python-2.0.0rc3 → asnkit_gen_python-2.0.0rc5}/pyproject.toml +2 -2
- {asnkit_gen_python-2.0.0rc3 → asnkit_gen_python-2.0.0rc5}/pyproject.toml.orig +2 -2
- {asnkit_gen_python-2.0.0rc3 → asnkit_gen_python-2.0.0rc5}/src/asnkit_gen_python/generate.py +9 -33
- {asnkit_gen_python-2.0.0rc3 → asnkit_gen_python-2.0.0rc5}/src/asnkit_gen_python/version.py +1 -1
- {asnkit_gen_python-2.0.0rc3 → asnkit_gen_python-2.0.0rc5}/LICENSE-COMPILER +0 -0
- {asnkit_gen_python-2.0.0rc3 → asnkit_gen_python-2.0.0rc5}/src/asnkit_gen_python/__init__.py +0 -0
- {asnkit_gen_python-2.0.0rc3 → asnkit_gen_python-2.0.0rc5}/src/asnkit_gen_python/__main__.py +0 -0
- {asnkit_gen_python-2.0.0rc3 → asnkit_gen_python-2.0.0rc5}/src/asnkit_gen_python/cli.py +0 -0
- {asnkit_gen_python-2.0.0rc3 → asnkit_gen_python-2.0.0rc5}/src/asnkit_gen_python/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: asnkit-gen-python
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.0rc5
|
|
4
4
|
Summary: asnkit plugin that makes Python code with data classes from ASN.1
|
|
5
5
|
Author: xadaemon
|
|
6
6
|
Author-email: xadaemon <mxavier@boxtheta.com>
|
|
@@ -10,7 +10,7 @@ Classifier: Development Status :: 5 - Production/Stable
|
|
|
10
10
|
Classifier: Intended Audience :: Developers
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Classifier: Topic :: Software Development :: Code Generators
|
|
13
|
-
Requires-Dist: asnkitrt==2.0.
|
|
13
|
+
Requires-Dist: asnkitrt==2.0.0rc5
|
|
14
14
|
Requires-Python: >=3.13
|
|
15
15
|
Project-URL: source, https://github.com/boxtheta/asnkit
|
|
16
16
|
Description-Content-Type: text/x-rst
|
|
@@ -47,11 +47,9 @@ Options, given with ``--plugin-opt KEY=VALUE``:
|
|
|
47
47
|
|
|
48
48
|
``embed``
|
|
49
49
|
``false`` to leave the compiled specification out of the module, as
|
|
50
|
-
for one
|
|
51
|
-
``use_asni(data
|
|
52
|
-
file
|
|
53
|
-
``bound_to``, ``verification_keys``, ``decryption_keys`` and those
|
|
54
|
-
to accept any), checks it once and uses it for every codec. Until it
|
|
50
|
+
for one distributed separately. The module then has
|
|
51
|
+
``use_asni(data)``, which takes the contents of a version 2 ``.asni``
|
|
52
|
+
file, checks its CRC-32 once and uses it for every codec. Until it
|
|
55
53
|
is called, encoding and decoding raise ``RuntimeError``. The file has
|
|
56
54
|
to be compiled from the same specification. Default: ``true``.
|
|
57
55
|
|
|
@@ -30,11 +30,9 @@ Options, given with ``--plugin-opt KEY=VALUE``:
|
|
|
30
30
|
|
|
31
31
|
``embed``
|
|
32
32
|
``false`` to leave the compiled specification out of the module, as
|
|
33
|
-
for one
|
|
34
|
-
``use_asni(data
|
|
35
|
-
file
|
|
36
|
-
``bound_to``, ``verification_keys``, ``decryption_keys`` and those
|
|
37
|
-
to accept any), checks it once and uses it for every codec. Until it
|
|
33
|
+
for one distributed separately. The module then has
|
|
34
|
+
``use_asni(data)``, which takes the contents of a version 2 ``.asni``
|
|
35
|
+
file, checks its CRC-32 once and uses it for every codec. Until it
|
|
38
36
|
is called, encoding and decoding raise ``RuntimeError``. The file has
|
|
39
37
|
to be compiled from the same specification. Default: ``true``.
|
|
40
38
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "asnkit-gen-python"
|
|
3
|
-
version = "2.0.
|
|
3
|
+
version = "2.0.0rc5"
|
|
4
4
|
description = "asnkit plugin that makes Python code with data classes from ASN.1"
|
|
5
5
|
readme = "README.rst"
|
|
6
6
|
requires-python = ">=3.13"
|
|
7
|
-
dependencies = ["asnkitrt==2.0.
|
|
7
|
+
dependencies = ["asnkitrt==2.0.0rc5"]
|
|
8
8
|
license = "Apache-2.0"
|
|
9
9
|
license-files = ["LICENSE-COMPILER"]
|
|
10
10
|
classifiers = [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "asnkit-gen-python"
|
|
3
|
-
version = "2.0.
|
|
3
|
+
version = "2.0.0rc5"
|
|
4
4
|
description = "asnkit plugin that makes Python code with data classes from ASN.1"
|
|
5
5
|
readme = "README.rst"
|
|
6
6
|
authors = [
|
|
@@ -8,7 +8,7 @@ authors = [
|
|
|
8
8
|
]
|
|
9
9
|
requires-python = ">=3.13"
|
|
10
10
|
dependencies = [
|
|
11
|
-
"asnkitrt==2.0.
|
|
11
|
+
"asnkitrt==2.0.0rc5",
|
|
12
12
|
]
|
|
13
13
|
license = "Apache-2.0"
|
|
14
14
|
license-files = ["LICENSE-COMPILER"]
|
|
@@ -771,34 +771,15 @@ NOT_EMBEDDED = """\
|
|
|
771
771
|
_SPECIFICATION: asnkitrt.syntax.CompiledSpecification | None = None
|
|
772
772
|
|
|
773
773
|
|
|
774
|
-
def use_asni(
|
|
775
|
-
data: bytes | bytearray,
|
|
776
|
-
nonce: asnkitrt.syntax.NonceCheck = None,
|
|
777
|
-
accept_any_nonce: bool = False,
|
|
778
|
-
bound_to: str | None = None,
|
|
779
|
-
accept_any_binding: bool = False,
|
|
780
|
-
verification_keys: asnkitrt.syntax.Keys | None = None,
|
|
781
|
-
accept_any_signature: bool = False,
|
|
782
|
-
decryption_keys: asnkitrt.syntax.Keys | None = None,
|
|
783
|
-
) -> None:
|
|
774
|
+
def use_asni(data: bytes | bytearray) -> None:
|
|
784
775
|
\"\"\"Uses the contents of an .asni file, made from the specification this
|
|
785
|
-
module is made from, for all codecs.
|
|
786
|
-
options of asnkitrt.load_asni().
|
|
776
|
+
module is made from, for all codecs. Its CRC-32 is checked once, here.
|
|
787
777
|
|
|
788
778
|
\"\"\"
|
|
789
779
|
|
|
790
780
|
global _SPECIFICATION
|
|
791
781
|
|
|
792
|
-
_SPECIFICATION = asnkitrt.syntax.from_asni(
|
|
793
|
-
data,
|
|
794
|
-
nonce,
|
|
795
|
-
accept_any_nonce,
|
|
796
|
-
bound_to,
|
|
797
|
-
accept_any_binding,
|
|
798
|
-
verification_keys,
|
|
799
|
-
accept_any_signature,
|
|
800
|
-
decryption_keys,
|
|
801
|
-
)
|
|
782
|
+
_SPECIFICATION = asnkitrt.syntax.from_asni(data)
|
|
802
783
|
spec.cache_clear()
|
|
803
784
|
|
|
804
785
|
|
|
@@ -840,22 +821,17 @@ def generate(
|
|
|
840
821
|
embed: bool = True,
|
|
841
822
|
) -> str:
|
|
842
823
|
"""Returns the text of a Python module for given contents of an
|
|
843
|
-
``.asni`` file, which
|
|
844
|
-
|
|
845
|
-
module and
|
|
846
|
-
the
|
|
847
|
-
|
|
848
|
-
does not have the specification in it, and is given it with its
|
|
849
|
-
``use_asni()``, as from a file that is signed or encrypted.
|
|
824
|
+
``.asni`` file, which may be embedded in the module. `sources`
|
|
825
|
+
are the names of the files it was made from, and `codec` is what
|
|
826
|
+
the module encodes and decodes with if not told otherwise. Without
|
|
827
|
+
`embed`, the module does not have the specification in it, and is
|
|
828
|
+
given it with its ``use_asni()``, as from a file it is sent.
|
|
850
829
|
|
|
851
830
|
"""
|
|
852
831
|
|
|
853
832
|
try:
|
|
854
833
|
compiled = syntax.from_asni(asni)
|
|
855
834
|
except Exception as error:
|
|
856
|
-
raise GenerateError(
|
|
857
|
-
"Expected a compiled specification that is not signed, encrypted, "
|
|
858
|
-
"bound to something or has a nonce, but: {}".format(error)
|
|
859
|
-
)
|
|
835
|
+
raise GenerateError("Expected a compiled specification, but: {}".format(error))
|
|
860
836
|
|
|
861
837
|
return Generator(compiled, asni, sources or [], codec, embed).run()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|