mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-28 15:36:13 +01:00
- do_maintainer(): cleanup + renamed "--bugowner_only" to "--bugowner-only"
This commit is contained in:
parent
a1cea77795
commit
9e892b9e58
@ -3967,7 +3967,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
return self.do_maintainer(subcmd, opts, *args)
|
return self.do_maintainer(subcmd, opts, *args)
|
||||||
|
|
||||||
|
|
||||||
@cmdln.option('-b', '--bugowner_only', action='store_true',
|
@cmdln.option('-b', '--bugowner-only', action='store_true',
|
||||||
help='Show only the bugowner')
|
help='Show only the bugowner')
|
||||||
@cmdln.option('-B', '--bugowner', action='store_true',
|
@cmdln.option('-B', '--bugowner', action='store_true',
|
||||||
help='Show only the bugowner if defined, or maintainer otherwise')
|
help='Show only the bugowner if defined, or maintainer otherwise')
|
||||||
@ -3999,14 +3999,12 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
${cmd_option_list}
|
${cmd_option_list}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
maintainers = []
|
|
||||||
pac = None
|
pac = None
|
||||||
tree = None
|
tree = None
|
||||||
if not opts.role:
|
|
||||||
roles = [ 'bugowner', 'maintainer' ]
|
roles = [ 'bugowner', 'maintainer' ]
|
||||||
else:
|
if opts.role:
|
||||||
roles = [opts.role]
|
roles = [opts.role]
|
||||||
if opts.bugowner_only:
|
if opts.bugowner_only or opts.bugowner:
|
||||||
roles = [ 'bugowner' ]
|
roles = [ 'bugowner' ]
|
||||||
|
|
||||||
if len(args) == 1:
|
if len(args) == 1:
|
||||||
@ -4041,41 +4039,34 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
for role in roles:
|
for role in roles:
|
||||||
delPerson(conf.config['apiurl'], prj, pac, opts.delete, role)
|
delPerson(conf.config['apiurl'], prj, pac, opts.delete, role)
|
||||||
elif opts.devel_project:
|
elif opts.devel_project:
|
||||||
|
# XXX: does it really belong to this command?
|
||||||
setDevelProject(conf.config['apiurl'], prj, pac, opts.devel_project)
|
setDevelProject(conf.config['apiurl'], prj, pac, opts.devel_project)
|
||||||
else:
|
else:
|
||||||
# showing the maintainers
|
# showing the maintainers
|
||||||
seen=0
|
maintainers = {}
|
||||||
for role in roles:
|
|
||||||
if opts.bugowner:
|
|
||||||
if seen:
|
|
||||||
break;
|
|
||||||
for person in tree.findall('person'):
|
for person in tree.findall('person'):
|
||||||
if person.get('role') == role:
|
maintainers.setdefault(person.get('role'), []).append(person.get('userid'))
|
||||||
seen += 1
|
for role in roles:
|
||||||
maintainers.append(person.get('userid'))
|
if opts.bugowner and not len(maintainers.get(role, [])):
|
||||||
if opts.bugowner:
|
role = 'maintainer'
|
||||||
if seen:
|
print role + ':'
|
||||||
print role+":",
|
|
||||||
else:
|
|
||||||
print ""
|
|
||||||
print role, ":"
|
|
||||||
|
|
||||||
if opts.email:
|
if opts.email:
|
||||||
emails = []
|
emails = []
|
||||||
for maintainer in maintainers:
|
for maintainer in maintainers.get(role, []):
|
||||||
user = get_user_data(conf.config['apiurl'], maintainer, 'email')
|
user = get_user_data(conf.config['apiurl'], maintainer, 'email')
|
||||||
if len(user):
|
if len(user):
|
||||||
emails.append(''.join(user))
|
emails.append(''.join(user))
|
||||||
print ', '.join(emails)
|
print ', '.join(emails) or '-'
|
||||||
elif opts.verbose:
|
elif opts.verbose:
|
||||||
userdata = []
|
userdata = []
|
||||||
for maintainer in maintainers:
|
for maintainer in maintainers.get(role, []):
|
||||||
user = get_user_data(conf.config['apiurl'], maintainer, 'realname', 'login', 'email')
|
user = get_user_data(conf.config['apiurl'], maintainer, 'realname', 'login', 'email')
|
||||||
userdata.extend(user)
|
userdata.extend(user)
|
||||||
for row in build_table(3, userdata, ['realname', 'userid', 'email\n']):
|
for row in build_table(3, userdata, ['realname', 'userid', 'email\n']):
|
||||||
print row
|
print row
|
||||||
else:
|
else:
|
||||||
print ', '.join(maintainers)
|
print ', '.join(maintainers.get(role, [])) or '-'
|
||||||
|
print
|
||||||
|
|
||||||
|
|
||||||
@cmdln.option('-r', '--revision', metavar='rev',
|
@cmdln.option('-r', '--revision', metavar='rev',
|
||||||
|
Loading…
Reference in New Issue
Block a user