mecanic.py 文件源码

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

项目:operative-framework 作者: graniet 项目源码 文件源码
def load_db():
    global total_dbs
    count = 1
    if not os.path.isdir("core/dbs/"):
        print Fore.RED + "core/dbs/ folder not found" + Style.RESET_ALL
        return False
    else:
        file_dbs = glob.glob("core/dbs/*.sql")
        if len(file_dbs) < 1:
            print Fore.YELLOW + "core/dbs/ No dbs found" + Style.RESET_ALL
            return False
        else:
            file_nb = len(file_dbs)
        print "Load "+str(file_nb)+" databases..."
        for line in file_dbs:
            if line not in total_dbs:
                print "Load database : "+Fore.GREEN + line + Style.RESET_ALL
                total_dbs.append(line)
            else:
                print "Already loaded : "+Fore.YELLOW + line + Style.RESET_ALL
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号