]> Cypherpunks.ru repositories - pyderasn.git/commitdiff
Field names in SEQUENCE's repr
authorSergey Matveev <stargrave@stargrave.org>
Fri, 29 Jun 2018 20:24:28 +0000 (23:24 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Fri, 29 Jun 2018 20:27:13 +0000 (23:27 +0300)
VERSION
doc/examples.rst
doc/features.rst
doc/news.rst
pyderasn.py

diff --git a/VERSION b/VERSION
index cc1923a40b1a5e8c7fbdb8f9f6c6bbe26c35604b..bd28b9c5c27e0dfa60da94179ec9b23f2be8be0c 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.8
+3.9
index f780360d8c6e0d8073b4a74eb3fcf5a824aa8ffe..f5b58d9a1dabcec2a385927ed4dd0399d0f4d7c1 100644 (file)
@@ -179,9 +179,10 @@ it's DER encoded representation is already in ``raw`` variable)::
 
     >>> crt, tail = Certificate().decode(raw)
     >>> crt
-    Certificate SEQUENCE[TBSCertificate SEQUENCE[[0] EXPLICIT Version
-        INTEGER v3 OPTIONAL, CertificateSerialNumber INTEGER 61595,
-        AlgorithmIdentifier SEQUENCE[OBJECT IDENTIFIER 1.2.840.113549.1.1.5...
+    Certificate SEQUENCE[tbsCertificate: TBSCertificate SEQUENCE[
+        version: [0] EXPLICIT Version INTEGER v3 OPTIONAL;
+        serialNumber: CertificateSerialNumber INTEGER 61595;
+        signature: AlgorithmIdentifier SEQUENCE[OBJECT IDENTIFIER 1.2.840.113549.1.1.5...
 
 Pretty printing
 ---------------
index a0a75fa758c66c901f454e99138364cbbe31ea97..463586ef80336f5b9a0de5e48b135bb328beb219 100644 (file)
@@ -45,7 +45,7 @@ There are drawbacks:
 * PyDERASN does **not** have object recreation capable ``repr``-s::
 
     pyderasn>>> repr(algo_id)
-    AlgorithmIdentifier SEQUENCE[OBJECT IDENTIFIER 1.3.14.3.2.26, [UNIV 5] ANY 0500 OPTIONAL]
+    AlgorithmIdentifier SEQUENCE[algorithm: OBJECT IDENTIFIER 1.3.14.3.2.26; parameters: [UNIV 5] ANY 0500 OPTIONAL]
 
     pyasn1>>> repr(algo_id)
     AlgorithmIdentifier().setComponents(ObjectIdentifier('1.3.14.3.2.26'), Any(hexValue='0500'))
index 971011efd203efb4539ef7d74d47881a3721ae15..7c067edc6a8e69ccb9adbefbcb5d3afe9064a22d 100644 (file)
@@ -1,6 +1,19 @@
 News
 ====
 
+.. _release3.9:
+
+3.9
+---
+SEQUENCE's values are printed with field's name. Previously there was
+the following output::
+
+    AlgorithmIdentifier SEQUENCE[OBJECT IDENTIFIER 1.3.14.3.2.26, [UNIV 5] ANY 0500 OPTIONAL]
+
+now it is::
+
+    AlgorithmIdentifier SEQUENCE[algorithm: OBJECT IDENTIFIER 1.3.14.3.2.26; parameters: [UNIV 5] ANY 0500 OPTIONAL]
+
 .. _release3.8:
 
 3.8
index 5c40361e310310b61d1402ddba04901ccd5aeed5..6f30f582f793654b26a39f9b6a8fc0256be9898b 100755 (executable)
@@ -4240,7 +4240,7 @@ class Sequence(Obj):
         ("algorithm", ObjectIdentifier("1.2.3")),
         ("parameters", Any(Null()))
     ))
-    AlgorithmIdentifier SEQUENCE[OBJECT IDENTIFIER 1.2.3, ANY 0500 OPTIONAL]
+    AlgorithmIdentifier SEQUENCE[algorithm: OBJECT IDENTIFIER 1.2.3; parameters: ANY 0500 OPTIONAL]
 
     You can determine if value exists/set in the sequence and take its value:
 
@@ -4595,8 +4595,8 @@ class Sequence(Obj):
             _value = self._value.get(name)
             if _value is None:
                 continue
-            cols.append(repr(_value))
-        return "%s[%s]" % (value, ", ".join(cols))
+            cols.append("%s: %s" % (name, repr(_value)))
+        return "%s[%s]" % (value, "; ".join(cols))
 
     def pps(self, decode_path=()):
         yield _pp(