1
0
Fork 0

Remove prompt at launch

This commit is contained in:
nemunaire 2015-05-08 00:20:14 +02:00
parent 1858a045cc
commit 7bc37617b0
1 changed files with 2 additions and 28 deletions

View File

@ -153,35 +153,9 @@ def main():
for module in args.module:
__import__(module)
print ("Nemubot v%s ready, my PID is %i!" % (nemubot.__version__,
os.getpid()))
while True:
from nemubot.prompt.reset import PromptReset
try:
context.start()
if prmpt.run(context):
break
except PromptReset as e:
if e.type == "quit":
break
context.start()
context.join()
try:
import imp
# Reload all other modules
imp.reload(nemubot)
imp.reload(nemubot.prompt)
nemubot.reload()
import nemubot.bot
context = nemubot.bot.hotswap(context)
prmpt = nemubot.prompt.hotswap(prmpt)
print("\033[1;32mContext reloaded\033[0m, now in Nemubot %s" %
nemubot.__version__)
except:
logger.exception("\033[1;31mUnable to reload the prompt due to "
"errors.\033[0m Fix them before trying to reload "
"the prompt.")
context.quit()
logger.info("Waiting for other threads shuts down...")
sys.exit(0)