mirror of https://gitlab.com/pamhyr/pamhyr2
Script: Add config in script init parameter.
parent
4de6784bec
commit
4debe830b6
|
|
@ -22,9 +22,10 @@ class AScript(object):
|
||||||
name = ""
|
name = ""
|
||||||
description = ""
|
description = ""
|
||||||
|
|
||||||
def __init__(self, args):
|
def __init__(self, conf, args):
|
||||||
super(AScript, self).__init__()
|
super(AScript, self).__init__()
|
||||||
|
|
||||||
|
self._conf = conf
|
||||||
self._args = args.copy()
|
self._args = args.copy()
|
||||||
|
|
||||||
def usage(self):
|
def usage(self):
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ def main():
|
||||||
usage(sys.argv)
|
usage(sys.argv)
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
||||||
application = scripts[script](sys.argv)
|
application = scripts[script](conf, sys.argv)
|
||||||
ret = application.run()
|
ret = application.run()
|
||||||
if not ret:
|
if not ret:
|
||||||
application.usage()
|
application.usage()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue