mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-27 15:06:15 +01:00
allow to restrict 'my pkgs' to maintained ones
This commit is contained in:
parent
8e48815f54
commit
a00c0c4006
@ -4483,6 +4483,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
help='exclude requests for specified project')
|
||||
@cmdln.option('-v', '--verbose', action='store_true',
|
||||
help='verbose listing')
|
||||
@cmdln.option('--maintained', action='store_true',
|
||||
help='limit search results to packages with maintained attribute set.')
|
||||
def do_my(self, subcmd, opts, type):
|
||||
"""${cmd_name}: show packages, projects or requests involving yourself
|
||||
|
||||
@ -4554,7 +4556,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
role_filter = ''
|
||||
|
||||
res = get_user_projpkgs(apiurl, user, role_filter,
|
||||
exclude_projects, what.has_key('project'), what.has_key('package'))
|
||||
exclude_projects, what.has_key('project'), what.has_key('package'), opts.maintained)
|
||||
request_todo = {}
|
||||
roles = {}
|
||||
if len(what.keys()) == 2:
|
||||
|
@ -4979,7 +4979,7 @@ def request_interactive_review(apiurl, request):
|
||||
if tmpfile is not None:
|
||||
tmpfile.close()
|
||||
|
||||
def get_user_projpkgs(apiurl, user, role=None, exclude_projects=[], proj=True, pkg=True):
|
||||
def get_user_projpkgs(apiurl, user, role=None, exclude_projects=[], proj=True, pkg=True, maintained=False):
|
||||
"""Return all project/packages where user is involved."""
|
||||
xpath = 'person/@userid = \'%s\'' % user
|
||||
excl_prj = ''
|
||||
@ -4992,6 +4992,10 @@ def get_user_projpkgs(apiurl, user, role=None, exclude_projects=[], proj=True, p
|
||||
xpath = xpath_join(xpath, 'person/@role = \'%s\'' % role, inner=True, op='and')
|
||||
xpath_pkg = xpath_join(xpath, excl_pkg, op='and')
|
||||
xpath_prj = xpath_join(xpath, excl_prj, op='and')
|
||||
|
||||
if maintained:
|
||||
xpath_pkg = xpath_join(xpath_pkg, '(project/attribute/@name=\'%(attr)s\' or attribute/@name=\'%(attr)s\')' % {'attr': conf.config['maintained_attribute']}, op='and')
|
||||
|
||||
what = {}
|
||||
if pkg:
|
||||
what['package_id'] = xpath_pkg
|
||||
|
Loading…
Reference in New Issue
Block a user