[Yum-devel] URLGrabber Batch Mode

Ryan Tomayko rtomayko at naeblis.cx
Sat Feb 28 19:06:19 UTC 2004


On Sat, 2004-02-28 at 12:30, Michael Stenner wrote:
> > http://aspn.activestate.com/ASPN/Cookbook/Python?kwd=Threads
> > 
> > Also, several users have requested a download resume feature.
> > Here is an example.  I found it in a python mailing list a few weeks ago
> > can't remember where so I can't give the author credit.
> 
> That is also being implemented (hell, it might be done... Ryan?) in
> the current urlgrabber.  

Range support is there, automatic reget is not. Today if you wanted
reget, the calling application would have to determine the range by
looking at the file and pass the appropriate range kwarg. For example,
if we had 499 bytes in a file on disk, the calling application could do
the following:

urlgrab(url, file, range=(500,)) 

I've never seen this request on the yum list myself. If this is
something you guys want I could probably have it in CVS in 30 minutes.
I'm thinking another kwarg possibly (reget=True or something) that would
automatically determine the range based on the local file. What I don't
like is that it is only possible for urlgrab where we have a local
filename and not urlread/urlopen. So, a "reget" kwarg would not be
generically useful like most other kwargs (exception being retry). Not a
big deal, IMO, just moves you a little further from perfect.

The more I think about it. Reget and range would have to work
_together_. So, for example, if yum requests the byte range of an rpm's
header and it dies half way through, the next time yum is going to
request the same range again. urlgrabber would need to offset the range
provided by yum with the number of bytes on disk. Takeaway is that reget
and range should work together if they're both provided by urlgrabber.

> It's a little more complex than the example
> you provide simply because of the other constraints in place (http,
> ftp, file, independent need for byte-ranges, etc).

Yep. Especially ftp. =/

- Ryan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20040228/dc2fad82/attachment.pgp 


More information about the Yum-devel mailing list