[patch] python api touchup

Evan Martin martine@danga.com
Sun, 10 Aug 2003 12:22:08 -0700


--Apple-Mail-14-631750345
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed

Most importantly: I renamed a class and missed a place where it was 
referenced, which means it dies inappropriately if a host goes down.


--Apple-Mail-14-631750345
Content-Disposition: attachment;
	filename=memcached-python.patch
Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="memcached-python.patch"

diff -ur --exclude=CVS memcached-bsd/api/python/ChangeLog memcached-pyfix/api/python/ChangeLog
--- memcached-bsd/api/python/ChangeLog	Sun Aug 10 12:16:41 2003
+++ memcached-pyfix/api/python/ChangeLog	Sun Aug 10 12:20:17 2003
@@ -1,3 +1,9 @@
+Thu, 10 Aug 2003 12:17:50 -0700  Evan Martin  <martine@danga.com>
+
+	* Slightly more verbose self-test output.
+	* Fix mark_dead() to use proper classname.
+	* Make pooltest.py run from the test directory.
+
 Thu, 07 Aug 2003 16:32:32 -0700  Evan Martin  <martine@danga.com>
 
 	* Add incr, decr, and delete.
diff -ur --exclude=CVS memcached-bsd/api/python/memcache.py memcached-pyfix/api/python/memcache.py
--- memcached-bsd/api/python/memcache.py	Sun Aug 10 12:16:44 2003
+++ memcached-pyfix/api/python/memcache.py	Sun Aug 10 12:15:50 2003
@@ -445,7 +445,7 @@
 
     def mark_dead(self, reason):
         print "MemCache: %s: %s.  Marking dead." % (self, reason)
-        self.deaduntil = time.time() + Host._DEAD_RETRY
+        self.deaduntil = time.time() + _Host._DEAD_RETRY
         self.close_socket()
         
     def _get_socket(self):
@@ -508,7 +508,7 @@
             d = " (dead until %d)" % self.deaduntil
         return "%s:%d%s" % (self.ip, self.port, d)
 
-def _test():
+def _doctest():
     import doctest, memcache
     servers = ["127.0.0.1:11211"]
     mc = Client(servers, debug=1)
@@ -516,7 +516,8 @@
     return doctest.testmod(memcache, globs=globs)
 
 if __name__ == "__main__":
-    _test()
+    print "Testing docstrings..."
+    _doctest()
     print "Running tests:"
     print
     #servers = ["127.0.0.1:11211", "127.0.0.1:11212"]
Only in memcached-pyfix/api/python: memcache.pyc
Only in memcached-pyfix/api/python: slow.py
diff -ur --exclude=CVS memcached-bsd/api/python/tests/pooltest.py memcached-pyfix/api/python/tests/pooltest.py
--- memcached-bsd/api/python/tests/pooltest.py	Sun Aug 10 12:16:44 2003
+++ memcached-pyfix/api/python/tests/pooltest.py	Sun Aug 10 12:15:50 2003
@@ -5,6 +5,8 @@
 Bring up two memcaches on :11211 and :11212.  Try killing one or both.
 If this code raises any exceptions, it's a bug."""
 
+import sys
+sys.path.append("..")
 import memcache
 import time
 

--Apple-Mail-14-631750345--