utils.py 文件源码

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

项目:BPRC 作者: bradwood 项目源码 文件源码
def printheaders(step,*,file, id, http_part, colourful):
    """Prints out the heading of the step to the output file"""
    logging.debug("in printheaders() http_part=" + http_part)
    od = collections.OrderedDict(sorted(eval("step."+ http_part +".headers.items()"))) # sort the headers
    for key, val in od.items():
        if colourful: #for now, does the same thing
            #print(highlight(key +": "+ val, lexers.TextLexer(stripnl=True), formatters.TerminalFormatter()), file=file)
            print(key +": "+val, file=file)
        else:
            print(key +": "+val, file=file)

#TODO: @REFACTOR (60) refactor all these print* functions -- too much copy/paste!
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号