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
评论列表
文章目录