From e199ab3a094a92cc8175a0ba9c0c35c0553c1461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 7 Aug 2009 07:48:52 +0000 Subject: [PATCH] and now do it right :/ (sorry, was before coffee) --- osc/core.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/osc/core.py b/osc/core.py index 0aa229e3..3aebad84 100755 --- a/osc/core.py +++ b/osc/core.py @@ -2300,12 +2300,16 @@ def get_request_list(apiurl, project, package, req_who='', req_state=('new',), r matches = [] match='' + m='' for state in req_state: - if len(match): match += '%20or%20' - match += 'state/@name=\'%s\'' % quote_plus(state) + if len(m): m += '%20or%20' + m += 'state/@name=\'%s\'' % quote_plus(state) + if len(m): match += "(" + m + ")" + m='' if req_who: - if len(match): match += '%20or%20' - match += 'state/@who=\'%s\'' % quote_plus(req_who) + if len(m): m += '%20or%20' + m += 'state/@who=\'%s\'' % quote_plus(req_who) + if len(m): match += "%20and%20(" + m + ")" # XXX: we cannot use the '|' in the xpath expression because it is not supported # in the backend