1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 01:06:17 +02:00

allow to specify limit=0 so jobhist works with apis that don't support limit

This commit is contained in:
Ludwig Nussel 2009-11-23 10:13:12 +00:00
parent 881349eaff
commit 989d7fa5d0
2 changed files with 6 additions and 4 deletions

View File

@ -3118,7 +3118,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
if opts.csv:
format = 'csv'
print_jobhistory(apiurl, project, package, repository, arch, format, int(opts.limit or 20))
print_jobhistory(apiurl, project, package, repository, arch, format, opts.limit)
@cmdln.hide(1)
def do_rlog(self, subcmd, opts, *args):

View File

@ -3566,10 +3566,12 @@ def get_buildhistory(apiurl, prj, package, repository, arch, format = 'text'):
def print_jobhistory(apiurl, prj, current_package, repository, arch, format = 'text', limit=20):
import time
query = {}
if current_package:
u = makeurl(apiurl, ['build', prj, repository, arch, '_jobhistory'], "package=%s&limit=%d" % (current_package, limit))
else:
u = makeurl(apiurl, ['build', prj, repository, arch, '_jobhistory'], "limit=%d" % (limit) )
query['package'] = current_package
if limit != None and int(limit) > 0:
query['limit'] = int(limit)
u = makeurl(apiurl, ['build', prj, repository, arch, '_jobhistory'], query )
f = http_GET(u)
root = ET.parse(f).getroot()