_ttbp.py 文件源码

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

项目:ttbp 作者: modgethanc 项目源码 文件源码
def check_init():
    '''
    user handler

    * checks for presence of ttbprc
    * checks for last run version
    '''

    global SETTINGS

    print("\n\n")
    if os.path.exists(os.path.join(os.path.expanduser("~"),".ttbp")):
        print(chatter.say("greet")+", "+USER+".\n")

        '''
        ## ttbprc validation
        while not os.path.isfile(TTBPRC):
            setup_repair()
        try:
            SETTINGS = json.load(open(TTBPRC))
        except ValueError:
            setup_repair()
        '''

        ## ttbp env validation
        if not valid_setup():
            setup_repair()

        ## version checker
        mismatch = build_mismatch()
        if mismatch is not False:
            switch_build(mismatch)
        if not updated():
            update_version()

        ## when ready, enter main program and load core engine
        raw_input("press <enter> to explore your feels.\n\n")
        core.load(SETTINGS)

        return ""
    else:
        return init()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号