summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES11
-rw-r--r--README.md8
-rw-r--r--redis/__init__.py2
-rw-r--r--redis/client.py12
-rw-r--r--setup.py16
-rw-r--r--tests/server_commands.py1
6 files changed, 28 insertions, 22 deletions
diff --git a/CHANGES b/CHANGES
index ea91ee0..4a7c8d1 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,14 @@
+* 2.2.2
+ * Fixed a bug in ZREVRANK where retriving the rank of a value not in
+ the zset would raise an error.
+ * Fixed a bug in Connection.send where the errno import was getting
+ overwritten by a local variable.
+ * Fixed a bug in SLAVEOF when promoting an existing slave to a master.
+ * Reverted change of download URL back to redis-VERSION.tar.gz. 2.2.1's
+ change of this actually broke Pypi for Pip installs. Sorry!
+* 2.2.1
+ * Changed archive name to redis-py-VERSION.tar.gz to not conflict
+ with the Redis server archive.
* 2.2.0
* Implemented SLAVEOF
* Implemented CONFIG as config_get and config_set
diff --git a/README.md b/README.md
index d1971ba..aa0cef3 100644
--- a/README.md
+++ b/README.md
@@ -19,12 +19,11 @@ http://code.google.com/p/redis/wiki/CommandReference
Installation
------------
-
- $ sudo easy-install redis
+ $ sudo pip install redis
alternatively:
- $ sudo pip install redis
+ $ sudo easy_install redis
From sources:
@@ -402,6 +401,9 @@ API Reference
Unsubscribe from _channels_. If empty, unsubscribe
from all channels
+### watch(self, name):
+ Watches the value at key _name_.
+
### zadd(self, name, value, score)
Add member _value_ with score _score_ to sorted set _name_
diff --git a/redis/__init__.py b/redis/__init__.py
index 7c3aa0d..437f20c 100644
--- a/redis/__init__.py
+++ b/redis/__init__.py
@@ -3,7 +3,7 @@ from redis.client import Redis, ConnectionPool
from redis.exceptions import RedisError, ConnectionError, AuthenticationError
from redis.exceptions import ResponseError, InvalidResponse, InvalidData
-__version__ = '2.2.0'
+__version__ = '2.2.2'
__all__ = [
'Redis', 'ConnectionPool',
diff --git a/redis/client.py b/redis/client.py
index 93607d0..b80707e 100644
--- a/redis/client.py
+++ b/redis/client.py
@@ -101,11 +101,11 @@ class Connection(object):
if e.args[0] == errno.EPIPE:
self.disconnect()
if isinstance(e.args, basestring):
- errno, errmsg = 'UNKNOWN', e.args
+ _errno, errmsg = 'UNKNOWN', e.args
else:
- errno, errmsg = e.args
+ _errno, errmsg = e.args
raise ConnectionError("Error %s while writing to socket. %s." % \
- (errno, errmsg))
+ (_errno, errmsg))
def read(self, length=None):
"""
@@ -244,7 +244,7 @@ class Redis(threading.local):
string_keys_to_dict(
'DECRBY GETBIT HLEN INCRBY LINSERT LLEN LPUSHX RPUSHX SCARD '
'SDIFFSTORE SETBIT SETRANGE SINTERSTORE STRLEN SUNIONSTORE ZCARD '
- 'ZREMRANGEBYRANK ZREMRANGEBYSCORE ZREVRANK',
+ 'ZREMRANGEBYRANK ZREMRANGEBYSCORE',
int
),
string_keys_to_dict(
@@ -263,6 +263,7 @@ class Redis(threading.local):
lambda r: r and set(r) or set()
),
string_keys_to_dict('ZRANGE ZRANGEBYSCORE ZREVRANGE', zset_score_pairs),
+ string_keys_to_dict('ZRANK ZREVRANK', int_or_none),
{
'BGREWRITEAOF': lambda r: \
r == 'Background rewriting of AOF file started',
@@ -275,7 +276,6 @@ class Redis(threading.local):
'PING': lambda r: r == 'PONG',
'RANDOMKEY': lambda r: r and r or None,
'TTL': lambda r: r != -1 and r or None,
- 'ZRANK': int_or_none,
}
)
@@ -575,7 +575,7 @@ class Redis(threading.local):
instance is promoted to a master instead.
"""
if host is None and port is None:
- return self.execute_command("SLAVEOF NO ONE")
+ return self.execute_command("SLAVEOF", "NO", "ONE")
return self.execute_command("SLAVEOF", host, port)
#### BASIC KEY COMMANDS ####
diff --git a/setup.py b/setup.py
index bb5ec0e..fb9ea54 100644
--- a/setup.py
+++ b/setup.py
@@ -1,21 +1,13 @@
#!/usr/bin/env python
-
-"""
-@file setup.py
-@author Andy McCurdy
-@date 2/12/2010
-@brief Setuptools configuration for redis client
-"""
-
-version = '2.2.0'
+from redis import __version__
sdict = {
'name' : 'redis',
- 'version' : version,
+ 'version' : __version__,
'description' : 'Python client for Redis key-value store',
'long_description' : 'Python client for Redis key-value store',
'url': 'http://github.com/andymccurdy/redis-py',
- 'download_url' : 'http://cloud.github.com/downloads/andymccurdy/redis-py/redis-%s.tar.gz' % version,
+ 'download_url' : 'http://cloud.github.com/downloads/andymccurdy/redis-py/redis-%s.tar.gz' % __version__,
'author' : 'Andy McCurdy',
'author_email' : 'sedrik@gmail.com',
'maintainer' : 'Andy McCurdy',
@@ -25,7 +17,7 @@ sdict = {
'packages' : ['redis'],
'test_suite' : 'tests.all_tests',
'classifiers' : [
- 'Development Status :: 4 - Beta',
+ 'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
diff --git a/tests/server_commands.py b/tests/server_commands.py
index 5e96dcf..f213321 100644
--- a/tests/server_commands.py
+++ b/tests/server_commands.py
@@ -893,6 +893,7 @@ class ServerCommandsTestCase(unittest.TestCase):
self.assertEquals(self.client.zrevrank('a', 'a3'), 2)
self.assertEquals(self.client.zrevrank('a', 'a4'), 3)
self.assertEquals(self.client.zrevrank('a', 'a5'), 4)
+ self.assertEquals(self.client.zrevrank('a', 'b'), None)
def test_zscore(self):
# key is not a zset