X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=pyderasn.py;h=3868b61f60874d7c95b39e451be894cbe2f95258;hb=165e97910a69809f2a7dcc852b0229d0aa1ff157;hp=814d85fba9113ef595bdbd326a93c3c60382b5ca;hpb=6b0b62f656d1ccecc754c6bffb1fe450291c7419;p=pyderasn.git diff --git a/pyderasn.py b/pyderasn.py index 814d85f..3868b61 100755 --- a/pyderasn.py +++ b/pyderasn.py @@ -429,7 +429,7 @@ For example, again for CMS, you want to automatically decode structures it may hold. Also, automatically decode ``controlSequence`` of ``PKIResponse``:: - content_info, tail = ContentInfo().decode(data, defines_by_path=( + content_info, tail = ContentInfo().decode(data, ctx={"defines_by_path": ( ( ("contentType",), ((("content",), {id_signedData: SignedData()}),), @@ -464,7 +464,7 @@ of ``PKIResponse``:: id_cmc_transactionId: TransactionId(), })), ), - )) + )}) Pay attention for :py:class:`pyderasn.DecodePathDefBy` and ``any``. First function is useful for path construction when some automatic @@ -670,7 +670,7 @@ from six.moves import xrange as six_xrange try: from termcolor import colored except ImportError: # pragma: no cover - def colored(what, *args): + def colored(what, *args, **kwargs): return what @@ -5700,7 +5700,10 @@ def main(): # pragma: no cover args.DERFile.seek(args.skip) der = memoryview(args.DERFile.read()) args.DERFile.close() - oid_maps = [obj_by_path(_path) for _path in (args.oids or "").split(",")] + oid_maps = ( + [obj_by_path(_path) for _path in (args.oids or "").split(",")] + if args.oids else () + ) if args.schema: schema = obj_by_path(args.schema) from functools import partial