1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 06:46:15 +01:00

- fixed #634042 ("osc shows negative percentages of RPM installation completion")

This commit is contained in:
Marcus Huewe 2010-09-09 15:04:00 +02:00
parent 078400f6cc
commit 7b5471e737

View File

@ -4411,7 +4411,10 @@ def streamfile(url, http_meth = http_GET, bufsize=8192, data=None, progress_obj=
if progress_obj:
import urlparse
basename = os.path.basename(urlparse.urlsplit(url)[2])
progress_obj.start(basename=basename, text=text, size=int(f.info().get('Content-Length', -1)))
cl = f.info().get('Content-Length')
if cl is not None:
cl = int(cl)
progress_obj.start(basename=basename, text=text, size=cl)
data = f.read(bufsize)
read = len(data)
while len(data):