def extract_details_from_stdin ():
"""
Extract details (ie, NRT structures) from stdin
"""
# Extract the NRT structures from the stdin
nrt_file = sys.stdin.buffer.readlines()
for nrt_file_content in nrt_file:
# Undo DER serialization, reconstruct NRT structure
nrt = None
try:
nrt, rest_of_input = ber_decoder.decode (nrt_file_content,
asn1Spec = Nrtrde.Nrtrde())
except (SubstrateUnderrunError, PyAsn1Error) as err:
print ("Error in decoding standard input: " + str(err))
nrt = None
continue
# Translate the NRT structure into a Python one
py_nrt = None
if nrt is not None:
py_nrt = extract_details_from_nrt (nrt)
#
yield py_nrt
评论列表
文章目录