I'm writing some simple user helper scripts.
One of it need to do for example a
'osc copypac origproject package newproject'.
I did this with a function:
def obs_copypac(org, pkg, new):
cmdline = "osc copypac -e %s %s %s" % (org, pkg, new)
dbg_print( "cmdline: %s" % cmdline )
p = Popen(cmdline, shell=True, stdout=PIPE, stderr=PIPE)
(stdout, stderr) = p.communicate()
rc = p.returncode
dbg_print( "osc copypac output: %s" % stdout )
print( osc copypac error: %s" % stderr
Works as expected. Then I remembered that osc itself was written in
Python as well, so it should be better to call the python stuff directly.
I looked at the osc-wrapper.py and was thinking that it should be easy
to do. Simple give the commandline.Osc() call the arguments for the osc
osccli = commandline.Osc("copypac","-e", org, pkg, new)
r = babysitter.run(osccli)
But this does not work, it seems the arguments are ignored, I get always
the osc help page (same as running osc with no arguments).
What do I missing here ?
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe(a)opensuse.org
To contact the owner, e-mail: opensuse-buildservice+owner(a)opensuse.org