[Yum-devel] [UG] keepalive.py: allow usage of methods other than GET and POST

Dr. Peter Poeml poeml at suse.de
Wed Apr 18 08:04:53 UTC 2007


Hi,

the attached patch allows overriding the two hardcoded methods "GET" and
"POST" in keepalive.py.

This makes it possible to use keepalive.py like this:

req = urllib2.Request(url)
req.get_method = lambda: "DELETE"
f = urllib2.urlopen(req)

or with a subclassed urllib2.Request, which overwrites get_method, like

    def get_method(self):
        if self.has_data():
            return "PUT"
        else:
            return "DELETE"

as described here:
http://www.agileprogrammer.com/eightytwenty/archive/2006/04/07/13258.aspx

Could you please apply it? Thanks!

Peter
-- 
Allen Gewalten zum Trutz sich erhalten.
 
SUSE LINUX Products GmbH
Research & Development
-------------- next part --------------
A non-text attachment was scrubbed...
Name: keepalive.py-methods.patch
Type: text/x-patch
Size: 944 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20070418/7ec93b25/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20070418/7ec93b25/attachment.pgp 


More information about the Yum-devel mailing list