summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandymccurdy <andy@andymccurdy.com>2010-02-16 14:45:13 -0800
committerandymccurdy <andy@andymccurdy.com>2010-02-16 14:45:13 -0800
commit6d3269b19a5929398c3d1b2faad6a3fb372733a5 (patch)
tree47de335cd7b543a69ea7de13ab70c03e3dd4ed8a
parent62fd846e4a6bf540400447e9be62982c22f412d8 (diff)
downloadredis-py-6d3269b19a5929398c3d1b2faad6a3fb372733a5.tar.gz
added accessors for host/port/db information off the current connection
-rw-r--r--redis/client.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/redis/client.py b/redis/client.py
index d16250a..6bbda2c 100644
--- a/redis/client.py
+++ b/redis/client.py
@@ -193,6 +193,19 @@ class Redis(object):
self.errors = errors
self.select(host, port, db, password)
+ #### Legacty accessors of connection information ####
+ def _get_host(self):
+ return self.connection.host
+ host = property(_get_host)
+
+ def _get_port(self):
+ return self.connection.port
+ port = property(_get_port)
+
+ def _get_db(self):
+ return self.connection.db
+ db = property(_get_db)
+
def pipeline(self):
return Pipeline(self.connection, self.encoding, self.errors)