[yum-commits] 2 commits - .cvsignore .gitignore urlgrabber/grabber.py
Ville Skyttä
scop at osuosl.org
Thu Dec 10 16:49:12 UTC 2009
.cvsignore | 7 -------
.gitignore | 7 +++++++
urlgrabber/grabber.py | 22 +++++++++++-----------
3 files changed, 18 insertions(+), 18 deletions(-)
New commits:
commit c20d1601774ae13e1ddc9db4dfb8bc386f0fec18
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Tue Dec 8 20:49:31 2009 +0200
Change default timeout to 300 (seconds), update documentation.
diff --git a/urlgrabber/grabber.py b/urlgrabber/grabber.py
index 0023fed..90311de 100644
--- a/urlgrabber/grabber.py
+++ b/urlgrabber/grabber.py
@@ -68,14 +68,14 @@ GENERAL ARGUMENTS (kwargs)
(which can be set on default_grabber.throttle) is used. See
BANDWIDTH THROTTLING for more information.
- timeout = None
+ timeout = 300
- a positive float expressing the number of seconds to wait for socket
- operations. If the value is None or 0.0, socket operations will block
- forever. Setting this option causes urlgrabber to call the settimeout
- method on the Socket object used for the request. See the Python
- documentation on settimeout for more information.
- http://www.python.org/doc/current/lib/socket-objects.html
+ a positive integer expressing the number of seconds to wait before
+ timing out attempts to connect to a server. If the value is None
+ or 0, connection attempts will not time out. The timeout is passed
+ to the underlying pycurl object as its CONNECTTIMEOUT option, see
+ the curl documentation on CURLOPT_CONNECTTIMEOUT for more information.
+ http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTCONNECTTIMEOUT
bandwidth = 0
@@ -814,7 +814,7 @@ class URLGrabberOptions:
self.prefix = None
self.opener = None
self.cache_openers = True
- self.timeout = None
+ self.timeout = 300
self.text = None
self.http_headers = None
self.ftp_headers = None
@@ -1171,9 +1171,9 @@ class PyCurlFileObject():
# timeouts
timeout = 300
- if opts.timeout:
- timeout = int(opts.timeout)
- self.curl_obj.setopt(pycurl.CONNECTTIMEOUT, timeout)
+ if hasattr(opts, 'timeout'):
+ timeout = int(opts.timeout or 0)
+ self.curl_obj.setopt(pycurl.CONNECTTIMEOUT, timeout)
# ssl options
if self.scheme == 'https':
commit 9b21ccfbd77301629e763528a9f027baa5508a7e
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Tue Dec 8 20:16:40 2009 +0200
Move .cvsignore to .gitignore, add *.pyo.
diff --git a/.cvsignore b/.cvsignore
deleted file mode 100644
index 3715d52..0000000
--- a/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-*.pyc
-MANIFEST
-dist
-build
-*.kdev*
-*.kateproject
-ipython.log*
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..1ffe416
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+*.py[co]
+MANIFEST
+dist
+build
+*.kdev*
+*.kateproject
+ipython.log*
More information about the Yum-commits
mailing list