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")+", "+config.USER+".\n")
'''
## ttbprc validation
while not os.path.isfile(config.TTBPRC):
setup_repair()
try:
SETTINGS = json.load(open(config.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()
评论列表
文章目录