[Yum-devel] URLGrabber: question about progress.end()

andrea mariofutire at googlemail.com
Sat Oct 6 19:14:53 UTC 2012


As I've noticed in an other post (there, the original matter was different),
sometimes, progress.end() is not called.

urlread() will call progress.end() (same for urlgrab)
urlopen() will not.

This is an example

You can see that the end of the progress in not the same in both cases.

import urlgrabber.grabber
import urlgrabber.progress

g = urlgrabber.grabber.URLGrabber(progress_obj = urlgrabber.progress.TextMeter(), quote = 0)
out = open("/dev/null", "wb")

url = "http://www.kernel.org/pub/linux/kernel/v3.0/patch-3.6.bz2"

print "this will call progress.end()"
f = g.urlread(url)
out.write(f)

f = g.urlread(url)
out.write(f)

print "this will not call progress.end()"
f = g.urlopen(url)
out.write(f.read())

f = g.urlopen(url)
out.write(f.read())



More information about the Yum-devel mailing list