diff options
-rw-r--r-- | CHANGES.rst | 2 | ||||
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | doc/source/docs/api-reference.rst | 2 | ||||
-rw-r--r-- | doc/source/docs/codec/native/contents.rst | 7 | ||||
-rw-r--r-- | doc/source/docs/codec/python/contents.rst | 7 | ||||
-rw-r--r-- | doc/source/example-use-case.rst | 4 | ||||
-rw-r--r-- | pyasn1/codec/native/__init__.py (renamed from pyasn1/codec/python/__init__.py) | 0 | ||||
-rw-r--r-- | pyasn1/codec/native/decoder.py (renamed from pyasn1/codec/python/decoder.py) | 2 | ||||
-rw-r--r-- | pyasn1/codec/native/encoder.py (renamed from pyasn1/codec/python/encoder.py) | 0 | ||||
-rw-r--r-- | setup.py | 2 | ||||
-rw-r--r-- | test/codec/native/__init__.py (renamed from test/codec/python/__init__.py) | 0 | ||||
-rw-r--r-- | test/codec/native/suite.py (renamed from test/codec/python/suite.py) | 2 | ||||
-rw-r--r-- | test/codec/native/test_decoder.py (renamed from test/codec/python/test_decoder.py) | 2 | ||||
-rw-r--r-- | test/codec/native/test_encoder.py (renamed from test/codec/python/test_encoder.py) | 2 | ||||
-rw-r--r-- | test/codec/suite.py | 6 |
15 files changed, 21 insertions, 21 deletions
diff --git a/CHANGES.rst b/CHANGES.rst index c596ad8..2655a59 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -3,7 +3,7 @@ Revision 0.1.10, released 05-02-2017 ------------------------------------ - FIX TO A SECURITY WEAKNESS: BER decoder improperly cached long tags. -- New codec implemented to transform pyasn1 types to Python built-in types and back. +- New "native" codec implemented to transform pyasn1 types to Python built-in types and back. - Switched to new-style classes. - BitString improvements: @@ -134,7 +134,7 @@ To make life easier for a Pythonista, they can turn their pyasn1 classes into Python built-ins: ```python ->>> from pyasn1.codec.python.encoder import encode +>>> from pyasn1.codec.native.encoder import encode >>> encode(record) {'id': 123, 'room': 321, 'house': 0} ``` @@ -143,7 +143,7 @@ Or vice-versa -- you can initialize an ASN.1 structure from a tree of Python objects: ```python ->>> from pyasn1.codec.python.decoder import decode +>>> from pyasn1.codec.native.decoder import decode >>> record = decode({'id': 123, 'room': 321, 'house': 0}, asn1Spec=Record()) >>> print(record.prettyPrint()) Record: diff --git a/doc/source/docs/api-reference.rst b/doc/source/docs/api-reference.rst index 9ad4104..f9d518b 100644 --- a/doc/source/docs/api-reference.rst +++ b/doc/source/docs/api-reference.rst @@ -22,4 +22,4 @@ Serialization codecs /docs/codec/ber/contents /docs/codec/cer/contents /docs/codec/der/contents - /docs/codec/python/contents + /docs/codec/native/contents diff --git a/doc/source/docs/codec/native/contents.rst b/doc/source/docs/codec/native/contents.rst new file mode 100644 index 0000000..11e96f0 --- /dev/null +++ b/doc/source/docs/codec/native/contents.rst @@ -0,0 +1,7 @@ + +Native Python types +------------------- + +.. autofunction:: pyasn1.codec.native.encoder.encode(asn1Value) + +.. autofunction:: pyasn1.codec.native.decoder.decode(pyObject, asn1Spec) diff --git a/doc/source/docs/codec/python/contents.rst b/doc/source/docs/codec/python/contents.rst deleted file mode 100644 index deef6a9..0000000 --- a/doc/source/docs/codec/python/contents.rst +++ /dev/null @@ -1,7 +0,0 @@ - -Native Python types -------------------- - -.. autofunction:: pyasn1.codec.python.encoder.encode(asn1Value) - -.. autofunction:: pyasn1.codec.python.decoder.decode(pyObject, asn1Spec) diff --git a/doc/source/example-use-case.rst b/doc/source/example-use-case.rst index 51dbe4c..fb076bb 100644 --- a/doc/source/example-use-case.rst +++ b/doc/source/example-use-case.rst @@ -149,7 +149,7 @@ pyasn1 objects into an analogous tree made of base Python types: .. code-block:: python - >>> from pyasn1.codec.python.encoder import encode + >>> from pyasn1.codec.native.encoder import encode >>> ... >>> py_private_key = encode(private_key) >>> py_private_key @@ -162,7 +162,7 @@ You can do vice-versa: initialize ASN.1 structure from a dict: .. code-block:: python - >>> from pyasn1.codec.python.decoder import decode + >>> from pyasn1.codec.native.decoder import decode >>> py_private_key = {'modulus': 280789907761334970323210643584308373} >>> private_key = decode(py_private_key, asn1Spec=RSAPrivateKey()) diff --git a/pyasn1/codec/python/__init__.py b/pyasn1/codec/native/__init__.py index 8c3066b..8c3066b 100644 --- a/pyasn1/codec/python/__init__.py +++ b/pyasn1/codec/native/__init__.py diff --git a/pyasn1/codec/python/decoder.py b/pyasn1/codec/native/decoder.py index e19c629..82c3801 100644 --- a/pyasn1/codec/python/decoder.py +++ b/pyasn1/codec/native/decoder.py @@ -130,7 +130,7 @@ class Decoder(object): return value -#: Turns Python objects of built-in into ASN.1 objects. +#: Turns Python objects of built-in types into ASN.1 objects. #: #: Takes Python objects of built-in types and turns them into a tree of #: ASN.1 objects (e.g. :py:class:`~pyasn1.type.base.PyAsn1Item` derivative) which diff --git a/pyasn1/codec/python/encoder.py b/pyasn1/codec/native/encoder.py index 2bcd7cf..2bcd7cf 100644 --- a/pyasn1/codec/python/encoder.py +++ b/pyasn1/codec/native/encoder.py @@ -86,7 +86,7 @@ params.update({ 'pyasn1.codec.ber', 'pyasn1.codec.cer', 'pyasn1.codec.der', - 'pyasn1.codec.python']}) + 'pyasn1.codec.native']}) # handle unittest discovery feature if sys.version_info[0:2] < (2, 7) or \ diff --git a/test/codec/python/__init__.py b/test/codec/native/__init__.py index 8c3066b..8c3066b 100644 --- a/test/codec/python/__init__.py +++ b/test/codec/native/__init__.py diff --git a/test/codec/python/suite.py b/test/codec/native/suite.py index 57ce67d..11e429b 100644 --- a/test/codec/python/suite.py +++ b/test/codec/native/suite.py @@ -7,7 +7,7 @@ from sys import path, version_info from os.path import sep -path.insert(1, path[0] + sep + 'python') +path.insert(1, path[0] + sep + 'native') import test_encoder, test_decoder if version_info[0:2] < (2, 7) or \ diff --git a/test/codec/python/test_decoder.py b/test/codec/native/test_decoder.py index af79bd3..00b27d7 100644 --- a/test/codec/python/test_decoder.py +++ b/test/codec/native/test_decoder.py @@ -5,7 +5,7 @@ # License: http://pyasn1.sf.net/license.html # from pyasn1.type import tag, namedtype, univ, char -from pyasn1.codec.python import decoder +from pyasn1.codec.native import decoder from pyasn1.error import PyAsn1Error from sys import version_info diff --git a/test/codec/python/test_encoder.py b/test/codec/native/test_encoder.py index 202248c..f270c46 100644 --- a/test/codec/python/test_encoder.py +++ b/test/codec/native/test_encoder.py @@ -5,7 +5,7 @@ # License: http://pyasn1.sf.net/license.html # from pyasn1.type import tag, namedtype, univ, char -from pyasn1.codec.python import encoder +from pyasn1.codec.native import encoder from pyasn1.error import PyAsn1Error from sys import version_info diff --git a/test/codec/suite.py b/test/codec/suite.py index 344e430..399bf44 100644 --- a/test/codec/suite.py +++ b/test/codec/suite.py @@ -16,8 +16,8 @@ import cer.suite path.insert(1, path[0] + sep + 'codec' + sep + 'der') import der.suite -path.insert(1, path[0] + sep + 'codec' + sep + 'python') -import python.suite +path.insert(1, path[0] + sep + 'codec' + sep + 'native') +import native.suite if version_info[0:2] < (2, 7) or \ version_info[0:2] in ((3, 0), (3, 1)): @@ -29,7 +29,7 @@ else: import unittest suite = unittest.TestSuite() -for m in (ber.suite, cer.suite, der.suite, python.suite): +for m in (ber.suite, cer.suite, der.suite, native.suite): suite.addTest(getattr(m, 'suite')) |