mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-11 16:36:14 +01:00
- do_request: added "--edit" option to edit a submit action ("osc rq show <id> --edit")
This commit is contained in:
parent
ef06aa26cf
commit
880e7d5cb2
@ -1623,6 +1623,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
help='only show requests created by yourself')
|
help='only show requests created by yourself')
|
||||||
@cmdln.option('-B', '--bugowner', action='store_true',
|
@cmdln.option('-B', '--bugowner', action='store_true',
|
||||||
help='also show requests about packages where I am bugowner')
|
help='also show requests about packages where I am bugowner')
|
||||||
|
@cmdln.option('-e', '--edit', action='store_true',
|
||||||
|
help='edit a submit action')
|
||||||
@cmdln.option('-i', '--interactive', action='store_true',
|
@cmdln.option('-i', '--interactive', action='store_true',
|
||||||
help='interactive review of request')
|
help='interactive review of request')
|
||||||
@cmdln.option('--non-interactive', action='store_true',
|
@cmdln.option('--non-interactive', action='store_true',
|
||||||
@ -1886,6 +1888,11 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
r = get_request(apiurl, reqid)
|
r = get_request(apiurl, reqid)
|
||||||
if opts.brief:
|
if opts.brief:
|
||||||
print r.list_view()
|
print r.list_view()
|
||||||
|
elif opts.edit:
|
||||||
|
if not r.get_actions('submit'):
|
||||||
|
raise oscerr.WrongOptions('\'--edit\' not possible ' \
|
||||||
|
'(request has no \'submit\' action)')
|
||||||
|
return request_interactive_review(apiurl, r, 'e')
|
||||||
elif (opts.interactive or conf.config['request_show_interactive']) and not opts.non_interactive:
|
elif (opts.interactive or conf.config['request_show_interactive']) and not opts.non_interactive:
|
||||||
return request_interactive_review(apiurl, r)
|
return request_interactive_review(apiurl, r)
|
||||||
else:
|
else:
|
||||||
|
@ -5912,7 +5912,7 @@ def print_request_list(apiurl, project, package = None, states = ('new', ), forc
|
|||||||
for r in requests:
|
for r in requests:
|
||||||
print r.list_view(), '\n'
|
print r.list_view(), '\n'
|
||||||
|
|
||||||
def request_interactive_review(apiurl, request):
|
def request_interactive_review(apiurl, request, initial_cmd=''):
|
||||||
"""review the request interactively"""
|
"""review the request interactively"""
|
||||||
import tempfile, re
|
import tempfile, re
|
||||||
|
|
||||||
@ -5935,7 +5935,11 @@ def request_interactive_review(apiurl, request):
|
|||||||
editprj = ''
|
editprj = ''
|
||||||
orequest = None
|
orequest = None
|
||||||
while True:
|
while True:
|
||||||
repl = raw_input(prompt).strip()
|
if initial_cmd:
|
||||||
|
repl = initial_cmd
|
||||||
|
initial_cmd = ''
|
||||||
|
else:
|
||||||
|
repl = raw_input(prompt).strip()
|
||||||
if repl == 'i' and sr_actions:
|
if repl == 'i' and sr_actions:
|
||||||
if not orequest is None and tmpfile:
|
if not orequest is None and tmpfile:
|
||||||
tmpfile.close()
|
tmpfile.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user