argparse: -m to load modules
This commit is contained in:
parent
22a2ba76c4
commit
02acad5968
@ -46,6 +46,9 @@ if __name__ == "__main__":
|
|||||||
default=["./modules/"],
|
default=["./modules/"],
|
||||||
help="directory to use as modules store")
|
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/",
|
parser.add_argument("-D", "--data-path", default="./datas/",
|
||||||
help="path to use to save bot data")
|
help="path to use to save bot data")
|
||||||
|
|
||||||
@ -106,6 +109,10 @@ if __name__ == "__main__":
|
|||||||
else:
|
else:
|
||||||
logger.error("%s is not a readable file", path)
|
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__,
|
print ("Nemubot v%s ready, my PID is %i!" % (bot.__version__,
|
||||||
os.getpid()))
|
os.getpid()))
|
||||||
context.start()
|
context.start()
|
||||||
|
Loading…
Reference in New Issue
Block a user