[wwwsearch-commits] r21668 - in wwwsearch/mechanize/trunk: . mechanize

jjlee at codespeak.net jjlee at codespeak.net
Tue Jan 3 03:04:26 CET 2006


Author: jjlee
Date: Tue Jan  3 03:04:24 2006
New Revision: 21668

Modified:
   wwwsearch/mechanize/trunk/README.html.in
   wwwsearch/mechanize/trunk/mechanize/_mechanize.py
   wwwsearch/mechanize/trunk/setup.py
Log:
Return independent response objects from .response()

Modified: wwwsearch/mechanize/trunk/README.html.in
==============================================================================
--- wwwsearch/mechanize/trunk/README.html.in	(original)
+++ wwwsearch/mechanize/trunk/README.html.in	Tue Jan  3 03:04:24 2006
@@ -153,15 +153,10 @@
 
 <h3>Specific to mechanize</h3>
 <ul>
-  <li>Fix <code>.response()</code> method (each call should return independently
-    .seek()-able pointer to same data).  Want to be able to clone responses,
-    too, so can process HTML.  Needs some careful thought: want to clean up the
-    multiple layers of response objects in ClientCookie and the standard
-    library (why hasn't Guido blessed interfaces yet??).
+  <li>History cache expiration / pluggable History implementations.
   <li>Perhaps extend <code>mechanize.UserAgent</code> with a way to give it
     handler instances to use.
   <li>Add more functional tests.
-  <li>History cache expiration / pluggable History implementations.
   <li>Add <code>Browser.load_response()</code> method.
   <li>Add <code>Browser.form_as_string()</code> and
     <code>Browser.__str__()</code> methods.
@@ -183,8 +178,9 @@
   <li>Unicode support in general (not sure yet how/when/whether this will
     happen).
   <li>Provide per-connection access to timeouts (ClientCookie).
-  <li>Persistent connections / pipelining.
+  <li>Keep-alive / connection caching
   <li>Work on auth / proxies (yawn).
+  <li>Pipelining??
 </ul>
 
 

Modified: wwwsearch/mechanize/trunk/mechanize/_mechanize.py
==============================================================================
--- wwwsearch/mechanize/trunk/mechanize/_mechanize.py	(original)
+++ wwwsearch/mechanize/trunk/mechanize/_mechanize.py	Tue Jan  3 03:04:24 2006
@@ -18,7 +18,7 @@
 
 from __future__ import generators
 
-import urllib2, socket, urlparse, urllib, re, sys, htmlentitydefs
+import urllib2, socket, urlparse, urllib, re, sys, htmlentitydefs, copy
 from urlparse import urljoin
 
 import ClientCookie
@@ -567,9 +567,7 @@
 
     def response(self):
         """Return last response (as return value of urllib2.urlopen())."""
-        # XXX This is currently broken: responses returned by this method
-        # all share the same seek position.
-        return self._response
+        return copy.copy(self._response)
 
     def geturl(self):
         """Get URL of current document."""

Modified: wwwsearch/mechanize/trunk/setup.py
==============================================================================
--- wwwsearch/mechanize/trunk/setup.py	(original)
+++ wwwsearch/mechanize/trunk/setup.py	Tue Jan  3 03:04:24 2006
@@ -41,7 +41,7 @@
 VERSION = "0.0.12a"
 INSTALL_REQUIRES = [
     "ClientForm>=0.2.2, ==dev",
-    "ClientCookie>=1.1.0, ==dev",
+    "ClientCookie>=1.1.1, ==dev",
     "pullparser>=0.0.8, ==dev"]
 NAME = "mechanize"
 PACKAGE = True


More information about the wwwsearch-commits mailing list