X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=pyderasn.py;h=e08f6bad3a090204af25441d78c285fec6521034;hb=11cdf11960823bae2e68dcfcb355e222ccda5af7;hp=7ca25aab5779972c785a10c46bb4da9df8933ed1;hpb=44741873733949a977e18c0ae475fee04fa6e643;p=pyderasn.git diff --git a/pyderasn.py b/pyderasn.py index 7ca25aa..e08f6ba 100755 --- a/pyderasn.py +++ b/pyderasn.py @@ -4,7 +4,7 @@ # pylint: disable=line-too-long,superfluous-parens,protected-access,too-many-lines # pylint: disable=too-many-return-statements,too-many-branches,too-many-statements # PyDERASN -- Python ASN.1 DER/CER/BER codec with abstract structures -# Copyright (C) 2017-2020 Sergey Matveev +# Copyright (C) 2017-2021 Sergey Matveev # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as @@ -17,9 +17,9 @@ # # You should have received a copy of the GNU Lesser General Public # License along with this program. If not, see . -"""Python ASN.1 DER/BER codec with abstract structures +"""Python ASN.1 DER/CER/BER codec with abstract structures -This library allows you to marshal various structures in ASN.1 DER +This library allows you to marshal various structures in ASN.1 DER/CER format, unmarshal BER/CER/DER ones. >>> i = Integer(123) @@ -770,7 +770,7 @@ forcefully encoded in DER during CER encoding, by specifying class SignedAttributes(SetOf): schema = Attribute() - bounds = (1, 32) + bounds = (1, float("+inf")) der_forced = True .. _agg_octet_string: @@ -1204,7 +1204,7 @@ except ImportError: # pragma: no cover def colored(what, *args, **kwargs): return what -__version__ = "8.1" +__version__ = "8.4" __all__ = ( "agg_octet_string", @@ -7675,7 +7675,7 @@ def browse(raw, obj, oid_maps=()): self._state_update() return super(TW, self).selectable() - def get_display_text(self): + def _get_display_text_without_offset(self): pp, constructed = self._get_pp() style = "constructed" if constructed else "" if len(pp.decode_path) == 0: @@ -7693,6 +7693,11 @@ def browse(raw, obj, oid_maps=()): )) return (style, ent) + def get_display_text(self): + pp, _ = self._get_pp() + style, ent = self._get_display_text_without_offset() + return [(style, ent), " [%d]" % pp.offset] + def _scroll(self, what, step): self.state[what]._invalidate() pos = self.state[what].focus_position