mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-04 02:26:16 +01:00
- add support for streaming build log, while it is being written (patch
by Christoph Thiel)
This commit is contained in:
parent
ae285de206
commit
29fa2b0810
@ -558,7 +558,13 @@ usage: log <platform> <arch>
|
||||
|
||||
platform = args[0]
|
||||
arch = args[1]
|
||||
print ''.join(get_log(project, package, platform, arch))
|
||||
offset = 0
|
||||
while True:
|
||||
log_chunk = get_log(project, package, platform, arch, offset)
|
||||
if len(log_chunk) == 0:
|
||||
break
|
||||
offset += len(log_chunk)
|
||||
print log_chunk.strip()
|
||||
|
||||
|
||||
def history(args):
|
||||
|
@ -1004,10 +1004,10 @@ def get_results(prj, package, platform):
|
||||
return r
|
||||
|
||||
|
||||
def get_log(prj, package, platform, arch):
|
||||
u = makeurl(['result', prj, platform, package, arch, 'log'])
|
||||
def get_log(prj, package, platform, arch, offset):
|
||||
u = makeurl(['result', prj, platform, package, arch, 'log?nostream=1&start=%s' % offset])
|
||||
f = urllib2.urlopen(u)
|
||||
return f.readlines()
|
||||
return f.read()
|
||||
|
||||
|
||||
def get_history(prj, package):
|
||||
|
Loading…
Reference in New Issue
Block a user