nemubot/nemubot.py
2012-06-29 01:00:26 +02:00

28 lines
636 B
Python
Executable File

#!/usr/bin/python3
# coding=utf-8
import sys
import os
import imp
import traceback
servers = dict()
prompt = __import__ ("prompt")
if len(sys.argv) >= 2:
for arg in sys.argv[1:]:
prompt.load_file(arg, servers)
print ("Nemubot ready, my PID is %i!" % (os.getpid()))
while prompt.launch(servers):
try:
imp.reload(prompt)
except:
print ("Unable to reload the prompt due to errors. Fix them before trying to reload the prompt.")
exc_type, exc_value, exc_traceback = sys.exc_info()
sys.stdout.write (traceback.format_exception_only(exc_type, exc_value)[0])
print ("Bye")
sys.exit(0)