argparse: -m to load modules

This commit is contained in:
nemunaire 2014-12-15 22:08:21 +01:00
parent 22a2ba76c4
commit 02acad5968

View File

@ -46,6 +46,9 @@ if __name__ == "__main__":
default=["./modules/"],
help="directory to use as modules store")
parser.add_argument("-m", "--module", nargs='*',
help="load given modules")
parser.add_argument("-D", "--data-path", default="./datas/",
help="path to use to save bot data")
@ -106,6 +109,10 @@ if __name__ == "__main__":
else:
logger.error("%s is not a readable file", path)
if args.module:
for module in args.module:
__import__(module)
print ("Nemubot v%s ready, my PID is %i!" % (bot.__version__,
os.getpid()))
context.start()