nrt.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:ti-data-samples 作者: bom4v 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号