X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=pyderasn.py;h=ad20ddbefa32263f28fa4940f1958628bc71f515;hb=99786fe3384c423c0fbdabbc4e66a9c59cc536d6;hp=e3ac23f2edac814ec2c6f806eadf8e40f012286f;hpb=27a82ffe77ce79e494b3e46d1cb5843efd1e6483;p=pyderasn.git diff --git a/pyderasn.py b/pyderasn.py index e3ac23f..ad20ddb 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) @@ -1204,7 +1204,7 @@ except ImportError: # pragma: no cover def colored(what, *args, **kwargs): return what -__version__ = "8.1" +__version__ = "8.3" __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,10 @@ def browse(raw, obj, oid_maps=()): )) return (style, ent) + def get_display_text(self): + pp, _ = self._get_pp() + return "%s: [%d]" % (self._get_display_text_without_offset(), pp.offset) + def _scroll(self, what, step): self.state[what]._invalidate() pos = self.state[what].focus_position