githubreflog.py 文件源码

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

项目:githubutils 作者: jimzucker 项目源码 文件源码
def printIt( p, sha, type, repo, branch, login, message, filler):

    #clean up comments that have \n in them
    message = message.replace("\n"," ")

    #print Fore.RED+sha[:SHACOLW].ljust(SHACOLW," ")+Fore.RESET,type[:EVENTCOLW].ljust(EVENTCOLW,filler),repo[:DFLTCOLW].ljust(DFLTCOLW,filler),branch[:BRANCHCOLW].ljust(BRANCHCOLW,filler),Fore.BLUE+login.ljust(DFLTCOLW," ")+Fore.RESET,message.ljust(MSGCOLW," ")
    line = Fore.RED+sha[:SHACOLW].ljust(SHACOLW," ")+Fore.RESET
    line += " " + type[:EVENTCOLW].ljust(EVENTCOLW,filler)
    line += " " + repo[:DFLTCOLW].ljust(DFLTCOLW,filler)
    line += " " + branch[:BRANCHCOLW].ljust(BRANCHCOLW,filler)
    line += " " + Fore.BLUE+login.ljust(DFLTCOLW," ")+Fore.RESET
    line += " " + message.ljust(MSGCOLW," ")
    line += "\n"

    try:
        p.stdin.write(line)
    except:
        # Stop loop on "Invalid pipe" or "Invalid argument".
        # No sense in continuing with broken pipe.
        exit(1)

    return


#----------------------------------------------------------------------------------------------------------------------

#process arguments
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号