bluefile.py 文件源码

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

项目:core-framework 作者: RedhawkSDR 项目源码 文件源码
def pack_ext_header(hdr, structured=0):
    """
    Packs the value of the given BLUE file hdr dictionary's
    'ext_header' key into the BLUE file extended header format and
    updates the value of 'ext_size'.  The value of 'ext_header' can be
    a list of (key, value) tuples or a dict.  Before writing this out
    to disk at the end of a BLUE file it must be padded out to a
    multiple of 512 bytes.  If the keywords given are already a string
    it is presumed they are already packed and the 'ext_size' field is
    updated but the string itself is left alone.

    If <structured> is true, any embedded Python dictionaries, lists
    or tuples will pack their structure into the keywords with
    them. See pack_keywords() for more info.
    """
    packed = pack_keywords(hdr['ext_header'], _rep_tran[hdr['head_rep']],
                           structured=structured)
    hdr['ext_header'] = packed
    hdr['ext_size'] = len(packed)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号