From bcacedcd96ca998b6673c5c2d1222aec0978f7a7 Mon Sep 17 00:00:00 2001 From: Marcus Huewe Date: Wed, 7 Aug 2013 23:25:31 +0200 Subject: [PATCH] - 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', '']) --- osc/babysitter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osc/babysitter.py b/osc/babysitter.py index 1f9fd146..5e695112 100644 --- a/osc/babysitter.py +++ b/osc/babysitter.py @@ -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