1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-03 18:16:17 +01:00

- babysitter.run: added new argv parameter

This way other python scripts can execute osc commands via the
babysitter. Example:

>>> from osc import babysitter, commandline
>>> cli = commandline.Osc()
>>> babysitter.run(cli, ['osc', 'ls', '<project>'])
This commit is contained in:
Marcus Huewe 2013-08-07 23:25:31 +02:00
parent aacbf6a03b
commit bcacedcd96

View File

@ -51,13 +51,13 @@ for name in 'SIGBREAK', 'SIGHUP', 'SIGTERM':
signal.signal(num, catchterm)
def run(prg):
def run(prg, argv=None):
try:
try:
if '--debugger' in sys.argv:
pdb.set_trace()
# here we actually run the program:
return prg.main()
return prg.main(argv)
except:
# look for an option in the prg.options object and in the config
# dict print stack trace, if desired