bump to 3.9.1

epel9
Seth Vidal 16 years ago
parent 09166dba1e
commit 21a8790d62

@ -1 +1 @@
urlgrabber-3.9.0.tar.gz urlgrabber-3.9.1.tar.gz

@ -2,10 +2,9 @@
Summary: A high-level cross-protocol url-grabber Summary: A high-level cross-protocol url-grabber
Name: python-urlgrabber Name: python-urlgrabber
Version: 3.9.0 Version: 3.9.1
Release: 8%{?dist} Release: 1%{?dist}
Source0: urlgrabber-%{version}.tar.gz Source0: urlgrabber-%{version}.tar.gz
Patch0: urlgrabber-HEAD.patch
License: LGPLv2+ License: LGPLv2+
Group: Development/Libraries Group: Development/Libraries
@ -23,7 +22,6 @@ authentication, proxies and more.
%prep %prep
%setup -q -n urlgrabber-%{version} %setup -q -n urlgrabber-%{version}
%patch0 -p1
%build %build
@ -44,6 +42,9 @@ rm -rf $RPM_BUILD_ROOT
%{_bindir}/urlgrabber %{_bindir}/urlgrabber
%changelog %changelog
* Fri Sep 25 2009 Seth Vidal <skvidal at fedoraproject.org> - 3.9.1-1
- 3.9.1
* Tue Aug 18 2009 Seth Vidal <skvidal at fedoraproject.org> - 3.9.0-8 * Tue Aug 18 2009 Seth Vidal <skvidal at fedoraproject.org> - 3.9.0-8
- ssl options, http POST string type fixes - ssl options, http POST string type fixes

@ -1 +1 @@
e82f8bd6cd052015d436042872074f3e urlgrabber-3.9.0.tar.gz 00c8359bf71062d0946bacea521f80b4 urlgrabber-3.9.1.tar.gz

@ -1,5 +1,5 @@
diff --git a/urlgrabber/grabber.py b/urlgrabber/grabber.py diff --git a/urlgrabber/grabber.py b/urlgrabber/grabber.py
index cf51dff..9692219 100644 index cf51dff..979b4c1 100644
--- a/urlgrabber/grabber.py --- a/urlgrabber/grabber.py
+++ b/urlgrabber/grabber.py +++ b/urlgrabber/grabber.py
@@ -402,11 +402,11 @@ import urllib @@ -402,11 +402,11 @@ import urllib
@ -104,7 +104,7 @@ index cf51dff..9692219 100644
+ self.fo.write(buf) + self.fo.write(buf)
+ return len(buf) + return len(buf)
+ except KeyboardInterrupt: + except KeyboardInterrupt:
+ return pycurl.READFUNC_ABORT + return -1
+ +
def _hdr_retrieve(self, buf): def _hdr_retrieve(self, buf):
- self._hdr_dump += buf - self._hdr_dump += buf
@ -199,7 +199,23 @@ index cf51dff..9692219 100644
#headers: #headers:
if opts.http_headers and self.scheme in ('http', 'https'): if opts.http_headers and self.scheme in ('http', 'https'):
@@ -1590,7 +1627,7 @@ class PyCurlFileObject(): @@ -1578,19 +1615,21 @@ class PyCurlFileObject():
if scheme not in ('ftp'):
continue
else:
+ if proxy == '_none_': proxy = ""
self.curl_obj.setopt(pycurl.PROXY, proxy)
elif self.scheme in ('http', 'https'):
if scheme not in ('http', 'https'):
continue
else:
+ if proxy == '_none_': proxy = ""
self.curl_obj.setopt(pycurl.PROXY, proxy)
-
- # username/password/auth settings
+
+ # FIXME username/password/auth settings
#posts - simple - expects the fields as they are #posts - simple - expects the fields as they are
if opts.data: if opts.data:
self.curl_obj.setopt(pycurl.POST, True) self.curl_obj.setopt(pycurl.POST, True)
@ -208,7 +224,7 @@ index cf51dff..9692219 100644
# our url # our url
self.curl_obj.setopt(pycurl.URL, self.url) self.curl_obj.setopt(pycurl.URL, self.url)
@@ -1607,18 +1644,51 @@ class PyCurlFileObject(): @@ -1607,18 +1646,62 @@ class PyCurlFileObject():
# to other URLGrabErrors from # to other URLGrabErrors from
# http://curl.haxx.se/libcurl/c/libcurl-errors.html # http://curl.haxx.se/libcurl/c/libcurl-errors.html
# this covers e.args[0] == 22 pretty well - which will be common # this covers e.args[0] == 22 pretty well - which will be common
@ -235,6 +251,17 @@ index cf51dff..9692219 100644
+ err.url = self.url + err.url = self.url
+ raise err + raise err
+ +
+ if e.args[0] == 42:
+ err = URLGrabError(15, _('User (or something) called abort %s: %s') % (self.url, e))
+ err.url = self.url
+ # this is probably wrong but ultimately this is what happens
+ # we have a legit http code and a pycurl 'writer failed' code
+ # which almost always means something aborted it from outside
+ # since we cannot know what it is -I'm banking on it being
+ # a ctrl-c. XXXX - if there's a way of going back two raises to
+ # figure out what aborted the pycurl process FIXME
+ raise KeyboardInterrupt
+
+ elif e.args[0] == 58: + elif e.args[0] == 58:
+ msg = _("problem with the local client certificate") + msg = _("problem with the local client certificate")
+ err = URLGrabError(14, msg) + err = URLGrabError(14, msg)
@ -266,7 +293,7 @@ index cf51dff..9692219 100644
self.curl_obj = _curl_cache self.curl_obj = _curl_cache
self.curl_obj.reset() # reset all old settings away, just in case self.curl_obj.reset() # reset all old settings away, just in case
# setup any ranges # setup any ranges
@@ -1630,11 +1700,9 @@ class PyCurlFileObject(): @@ -1630,11 +1713,9 @@ class PyCurlFileObject():
pass pass
def _build_range(self): def _build_range(self):
@ -279,7 +306,7 @@ index cf51dff..9692219 100644
# we have reget turned on and we're dumping to a file # we have reget turned on and we're dumping to a file
try: try:
s = os.stat(self.filename) s = os.stat(self.filename)
@@ -1726,10 +1794,10 @@ class PyCurlFileObject(): @@ -1726,10 +1807,10 @@ class PyCurlFileObject():
if self._complete: if self._complete:
return return
@ -292,7 +319,7 @@ index cf51dff..9692219 100644
if self.append: mode = 'ab' if self.append: mode = 'ab'
else: mode = 'wb' else: mode = 'wb'
@@ -1746,19 +1814,23 @@ class PyCurlFileObject(): @@ -1746,19 +1827,23 @@ class PyCurlFileObject():
else: else:
self._prog_reportname = 'MEMORY' self._prog_reportname = 'MEMORY'
self._prog_basename = 'MEMORY' self._prog_basename = 'MEMORY'
@ -321,7 +348,7 @@ index cf51dff..9692219 100644
# set the time # set the time
mod_time = self.curl_obj.getinfo(pycurl.INFO_FILETIME) mod_time = self.curl_obj.getinfo(pycurl.INFO_FILETIME)
if mod_time != -1: if mod_time != -1:
@@ -1766,7 +1838,8 @@ class PyCurlFileObject(): @@ -1766,7 +1851,8 @@ class PyCurlFileObject():
# re open it # re open it
self.fo = open(self.filename, 'r') self.fo = open(self.filename, 'r')
else: else:
@ -331,10 +358,21 @@ index cf51dff..9692219 100644
self._complete = True self._complete = True
@@ -1838,6 +1911,13 @@ class PyCurlFileObject(): @@ -1834,10 +1920,20 @@ class PyCurlFileObject():
downloaded += self._reget_length return
self.opts.progress_obj.update(downloaded)
def _progress_update(self, download_total, downloaded, upload_total, uploaded):
- if self._prog_running:
- downloaded += self._reget_length
- self.opts.progress_obj.update(downloaded)
-
+ try:
+ if self._prog_running:
+ downloaded += self._reget_length
+ self.opts.progress_obj.update(downloaded)
+ except KeyboardInterrupt:
+ return -1
+
+ def _to_utf8(self, obj, errors='replace'): + def _to_utf8(self, obj, errors='replace'):
+ '''convert 'unicode' to an encoded utf-8 byte string ''' + '''convert 'unicode' to an encoded utf-8 byte string '''
+ # stolen from yum.i18n + # stolen from yum.i18n

Loading…
Cancel
Save