[Python-modules-commits] [pycurl] 22/140: Import pycurl_7.14.0.orig.tar.gz

Barry Warsaw barry at moszumanska.debian.org
Wed Oct 1 21:45:02 UTC 2014


This is an automated email from the git hooks/post-receive script.

barry pushed a commit to branch master
in repository pycurl.

commit a2066ba66ca141550c04c0c87ac447adca4c394b
Author: Barry Warsaw <barry at python.org>
Date:   Wed Oct 1 16:43:25 2014 -0400

    Import pycurl_7.14.0.orig.tar.gz
---
 ChangeLog                     | 14 ++++++-
 PKG-INFO                      |  2 +-
 python/curl/__init__.py       | 87 ++++++++++++++++++++++++++-----------------
 setup.py                      |  6 +--
 setup_win32_ssl.py            | 10 ++---
 src/pycurl.c                  |  5 ++-
 tests/test_multi_vs_thread.py |  4 +-
 7 files changed, 81 insertions(+), 47 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 13f4a60..6ad0e88 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,16 @@
-Version 7.13.2 [requires libcurl-7.13.2 or better]
+Version 7.14.0 [requires libcurl-7.13.2 or better]
+--------------
+
+2005-05-18  Kjetil Jacobsen  <kjetilja>
+
+        * Added missing information returned from the info() method
+          in the high-level interface.
+
+        * Added the FORM_FILENAME option to the CURLFORM API
+          with HTTPPOST.
+
+
+Version 7.13.2
 --------------
 
 2005-03-30  Kjetil Jacobsen  <kjetilja>
diff --git a/PKG-INFO b/PKG-INFO
index a03341a..156b51a 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: pycurl
-Version: 7.13.2
+Version: 7.14.0
 Summary: PycURL -- cURL library module for Python
 Home-page: http://pycurl.sourceforge.net/
 Author: Kjetil Jacobsen, Markus F.X.J. Oberhumer
diff --git a/python/curl/__init__.py b/python/curl/__init__.py
index 8fecb4d..13001f2 100644
--- a/python/curl/__init__.py
+++ b/python/curl/__init__.py
@@ -17,7 +17,7 @@ except ImportError:
 
 
 class Curl:
-    "High-level interface to cURL functions."
+    "High-level interface to pycurl functions."
     def __init__(self, base_url="", fakeheaders=[]):
         self.handle = pycurl.Curl()
         # These members might be set.
@@ -26,7 +26,7 @@ class Curl:
         self.fakeheaders = fakeheaders
         # Nothing past here should be modified by the caller.
         self.payload = ""
-        self.header = StringIO()
+        self.hrd = ""
         # Verify that we've got the right site; harmless on a non-SSL connect.
         self.set_option(pycurl.SSL_VERIFYHOST, 2)
         # Follow redirects in case it wants to take us to a CGI...
@@ -44,12 +44,11 @@ class Curl:
             self.payload += x
         self.set_option(pycurl.WRITEFUNCTION, payload_callback)
         def header_callback(x):
-            self.header.write(x)
+            self.hdr += x
         self.set_option(pycurl.HEADERFUNCTION, header_callback)
 
     def set_timeout(self, timeout):
-        "Set timeout for connect and object retrieval (applies for both)"
-        self.set_option(pycurl.CONNECTTIMEOUT, timeout)
+        "Set timeout for a retrieving an object"
         self.set_option(pycurl.TIMEOUT, timeout)
 
     def set_url(self, url):
@@ -58,7 +57,7 @@ class Curl:
         self.set_option(pycurl.URL, self.base_url)
 
     def set_option(self, *args):
-        "Set an option on the retrieval,"
+        "Set an option on the retrieval."
         apply(self.handle.setopt, args)
 
     def set_verbosity(self, level):
@@ -71,8 +70,8 @@ class Curl:
             self.set_option(pycurl.HTTPHEADER, self.fakeheaders)
         if relative_url:
             self.set_option(pycurl.URL,os.path.join(self.base_url,relative_url))
-        self.header.seek(0,0)
         self.payload = ""
+        self.hdr = ""
         self.handle.perform()
         return self.payload
 
@@ -93,31 +92,46 @@ class Curl:
         "Return the body from the last response."
         return self.payload
 
+    def header(self):
+        "Return the header from the last response."
+        return self.hdr
+
+    def get_info(self, *args):
+        "Get information about retrieval."
+        return apply(self.handle.getinfo, args)
+
     def info(self):
-        "Return an RFC822 object with info on the page."
-        self.header.seek(0,0)
-        url = self.handle.getinfo(pycurl.EFFECTIVE_URL)
-        if url[:5] == 'http:':
-            self.header.readline()
-            m = mimetools.Message(self.header)
-        else:
-            m = mimetools.Message(StringIO())
-        m['effective-url'] = url
-        m['http-code'] = str(self.handle.getinfo(pycurl.HTTP_CODE))
-        m['total-time'] = str(self.handle.getinfo(pycurl.TOTAL_TIME))
-        m['namelookup-time'] = str(self.handle.getinfo(pycurl.NAMELOOKUP_TIME))
-        m['connect-time'] = str(self.handle.getinfo(pycurl.CONNECT_TIME))
-        m['pretransfer-time'] = str(self.handle.getinfo(pycurl.PRETRANSFER_TIME))
-        m['redirect-time'] = str(self.handle.getinfo(pycurl.REDIRECT_TIME))
-        m['redirect-count'] = str(self.handle.getinfo(pycurl.REDIRECT_COUNT))
-        m['size-upload'] = str(self.handle.getinfo(pycurl.SIZE_UPLOAD))
-        m['size-download'] = str(self.handle.getinfo(pycurl.SIZE_DOWNLOAD))
-        m['speed-upload'] = str(self.handle.getinfo(pycurl.SPEED_UPLOAD))
-        m['header-size'] = str(self.handle.getinfo(pycurl.HEADER_SIZE))
-        m['request-size'] = str(self.handle.getinfo(pycurl.REQUEST_SIZE))
-        m['content-length-download'] = str(self.handle.getinfo(pycurl.CONTENT_LENGTH_DOWNLOAD))
-        m['content-length-upload'] = str(self.handle.getinfo(pycurl.CONTENT_LENGTH_UPLOAD))
-        m['content-type'] = (self.handle.getinfo(pycurl.CONTENT_TYPE) or '').strip(';')
+        "Return a dictionary with all info on the last response."
+        m = {}
+        m['effective-url'] = self.handle.getinfo(pycurl.EFFECTIVE_URL)
+        m['http-code'] = self.handle.getinfo(pycurl.HTTP_CODE)
+        m['total-time'] = self.handle.getinfo(pycurl.TOTAL_TIME)
+        m['namelookup-time'] = self.handle.getinfo(pycurl.NAMELOOKUP_TIME)
+        m['connect-time'] = self.handle.getinfo(pycurl.CONNECT_TIME)
+        m['pretransfer-time'] = self.handle.getinfo(pycurl.PRETRANSFER_TIME)
+        m['redirect-time'] = self.handle.getinfo(pycurl.REDIRECT_TIME)
+        m['redirect-count'] = self.handle.getinfo(pycurl.REDIRECT_COUNT)
+        m['size-upload'] = self.handle.getinfo(pycurl.SIZE_UPLOAD)
+        m['size-download'] = self.handle.getinfo(pycurl.SIZE_DOWNLOAD)
+        m['speed-upload'] = self.handle.getinfo(pycurl.SPEED_UPLOAD)
+        m['header-size'] = self.handle.getinfo(pycurl.HEADER_SIZE)
+        m['request-size'] = self.handle.getinfo(pycurl.REQUEST_SIZE)
+        m['content-length-download'] = self.handle.getinfo(pycurl.CONTENT_LENGTH_DOWNLOAD)
+        m['content-length-upload'] = self.handle.getinfo(pycurl.CONTENT_LENGTH_UPLOAD)
+        m['content-type'] = self.handle.getinfo(pycurl.CONTENT_TYPE)
+        m['response-code'] = self.handle.getinfo(pycurl.RESPONSE_CODE)
+        m['speed-download'] = self.handle.getinfo(pycurl.SPEED_DOWNLOAD)
+        m['ssl-verifyresult'] = self.handle.getinfo(pycurl.SSL_VERIFYRESULT)
+        m['filetime'] = self.handle.getinfo(pycurl.INFO_FILETIME)
+        m['starttransfer-time'] = self.handle.getinfo(pycurl.STARTTRANSFER_TIME)
+        m['redirect-time'] = self.handle.getinfo(pycurl.REDIRECT_TIME)
+        m['redirect-count'] = self.handle.getinfo(pycurl.REDIRECT_COUNT)
+        m['http-connectcode'] = self.handle.getinfo(pycurl.HTTP_CONNECTCODE)
+        m['httpauth-avail'] = self.handle.getinfo(pycurl.HTTPAUTH_AVAIL)
+        m['proxyauth-avail'] = self.handle.getinfo(pycurl.PROXYAUTH_AVAIL)
+        m['os-errno'] = self.handle.getinfo(pycurl.OS_ERRNO)
+        m['num-connects'] = self.handle.getinfo(pycurl.NUM_CONNECTS)
+        m['ssl-engines'] = self.handle.getinfo(pycurl.SSL_ENGINES)
         return m
 
     def answered(self, check):
@@ -126,8 +140,10 @@ class Curl:
 
     def close(self):
         "Close a session, freeing resources."
-        self.handle.close()
-        self.header.close()
+        if self.handle:  self.handle.close()
+        self.handle = None
+        self.hdr = ""
+        self.payload = ""
 
     def __del__(self):
         self.close()
@@ -142,5 +158,8 @@ if __name__ == "__main__":
     c.get(url)
     print c.body()
     print '='*74 + '\n'
-    print c.info()
+    import pprint
+    pprint.pprint(c.info())
+    print c.get_info(pycurl.OS_ERRNO)
+    print c.info()['os-errno']
     c.close()
diff --git a/setup.py b/setup.py
index d4a7430..d67f8ed 100644
--- a/setup.py
+++ b/setup.py
@@ -1,13 +1,13 @@
 #! /usr/bin/env python
 # -*- coding: iso-8859-1 -*-
 # vi:ts=4:et
-# $Id: setup.py,v 1.123 2005/02/17 10:13:23 mfx Exp $
+# $Id: setup.py,v 1.125 2005/06/14 13:43:26 kjetilja Exp $
 
 """Setup script for the PycURL module distribution."""
 
 PACKAGE = "pycurl"
 PY_PACKAGE = "curl"
-VERSION = "7.13.2"
+VERSION = "7.14.0"
 
 import glob, os, re, sys, string
 import distutils
@@ -63,7 +63,7 @@ if sys.platform == "win32":
     # Windows users have to configure the CURL_DIR path parameter to match
     # their cURL source installation.  The path set here is just an example
     # and thus unlikely to match your installation.
-    CURL_DIR = r"c:\src\build\pycurl\curl-7.13.2"
+    CURL_DIR = r"c:\src\build\pycurl\curl-7.14.0"
     CURL_DIR = scan_argv("--curl-dir=", CURL_DIR)
     print "Using curl directory:", CURL_DIR
     assert os.path.isdir(CURL_DIR), "please check CURL_DIR in setup.py"
diff --git a/setup_win32_ssl.py b/setup_win32_ssl.py
index ca93146..dc3089b 100644
--- a/setup_win32_ssl.py
+++ b/setup_win32_ssl.py
@@ -1,14 +1,14 @@
 #! /usr/bin/env python
 # -*- coding: iso-8859-1 -*-
 # vi:ts=4:et
-# $Id: setup_win32_ssl.py,v 1.27 2005/02/17 10:13:23 mfx Exp $
+# $Id: setup_win32_ssl.py,v 1.30 2005/06/14 13:43:34 kjetilja Exp $
 
 import os, sys, string
 assert sys.platform == "win32", "Only for building on Win32 with SSL and zlib"
 
 
-CURL_DIR = r"c:\src\build\pycurl\curl-7.13.2-ssl"
-OPENSSL_DIR = r"c:\src\build\pycurl\openssl-0.9.7e"
+CURL_DIR = r"c:\src\build\pycurl\curl-7.14.0-ssl"
+OPENSSL_DIR = r"c:\src\build\pycurl\openssl-0.9.7g"
 sys.argv.insert(1, "--curl-dir=" + CURL_DIR)
 
 from setup import *
@@ -23,8 +23,8 @@ pool = "\\" + r"pool\win32\vc6" + "\\"
 if string.find(sys.version, "MSC v.1310") >= 0:
     pool = "\\" + r"pool\win32\vc71" + "\\"
 ext.extra_objects.append(r"c:\src\pool\zlib-1.2.2" + pool + "zlib.lib")
-ext.extra_objects.append(r"c:\src\pool\c-ares-20041212" + pool + "ares.lib")
-ext.extra_objects.append(r"c:\src\pool\libidn-0.5.13" + pool + "idn.lib")
+ext.extra_objects.append(r"c:\src\pool\c-ares-20050411" + pool + "ares.lib")
+ext.extra_objects.append(r"c:\src\pool\libidn-0.5.15" + pool + "idn.lib")
 
 
 if __name__ == "__main__":
diff --git a/src/pycurl.c b/src/pycurl.c
index 03566b6..2a59c0d 100644
--- a/src/pycurl.c
+++ b/src/pycurl.c
@@ -1,4 +1,4 @@
-/* $Id: pycurl.c,v 1.89 2005/03/30 17:35:55 mfx Exp $ */
+/* $Id: pycurl.c,v 1.92 2005/06/08 07:28:54 kjetilja Exp $ */
 
 /* PycURL -- cURL Python module
  *
@@ -14,6 +14,7 @@
  *  Eric S. Raymond <esr at thyrsus.com>
  *  Martin Muenstermann <mamuema at sourceforge.net>
  *  Domenico Andreoli <cavok at libero.it>
+ *  Dominique <curl-and-python at d242.net>
  *
  * See file COPYING for license information.
  *
@@ -1387,6 +1388,7 @@ do_curl_setopt(CurlObject *self, PyObject *args)
                         val = PyLong_AsLong(PyTuple_GET_ITEM(t, j));
                         if (val != CURLFORM_COPYCONTENTS &&
                             val != CURLFORM_FILE &&
+                            val != CURLFORM_FILENAME &&
                             val != CURLFORM_CONTENTTYPE)
                         {
                             PyErr_SetString(PyExc_TypeError, "unsupported option");
@@ -2573,6 +2575,7 @@ initpycurl(void)
     insint_c(d, "FORM_CONTENTS", CURLFORM_COPYCONTENTS);
     insint_c(d, "FORM_FILE", CURLFORM_FILE);
     insint_c(d, "FORM_CONTENTTYPE", CURLFORM_CONTENTTYPE);
+    insint_c(d, "FORM_FILENAME", CURLFORM_FILENAME);
 
     /* CURLoption: symbolic constants for setopt() */
 /* FIXME: reorder these to match <curl/curl.h> */
diff --git a/tests/test_multi_vs_thread.py b/tests/test_multi_vs_thread.py
index a6030cc..3890fea 100644
--- a/tests/test_multi_vs_thread.py
+++ b/tests/test_multi_vs_thread.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: iso-8859-1 -*-
 # vi:ts=4:et
-# $Id: test_multi_vs_thread.py,v 1.15 2004/12/26 17:31:53 mfx Exp $
+# $Id: test_multi_vs_thread.py,v 1.16 2005/04/12 03:39:01 mfx Exp $
 
 import os, sys, time
 from threading import Thread, RLock
@@ -90,7 +90,7 @@ def test_multi():
 
     # get data
     while num_handles:
-        m.select()
+        m.select(1.0)
         while 1:
             ret, num_handles = m.perform()
             if ret != pycurl.E_CALL_MULTI_PERFORM:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pycurl.git



More information about the Python-modules-commits mailing list