mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Script: Add config in script init parameter.
This commit is contained in:
1 parent
4de6784bec
commit
4debe830b6
2 files changed
+3
-2
No files matched your search
@@ -22,9 +22,10 @@ class AScript(object):
|
||||
name = ""
|
||||
description = ""
|
||||
|
||||
def __init__(self, args):
|
||||
def __init__(self, conf, args):
|
||||
super(AScript, self).__init__()
|
||||
|
||||
self._conf = conf
|
||||
self._args = args.copy()
|
||||
|
||||
def usage(self):
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ def main():
|
||||
usage(sys.argv)
|
||||
sys.exit(-1)
|
||||
|
||||
application = scripts[script](sys.argv)
|
||||
application = scripts[script](conf, sys.argv)
|
||||
ret = application.run()
|
||||
if not ret:
|
||||
application.usage()
|
||||
|
||||
Reference in new issue
Block a user