summaryrefslogtreecommitdiff
path: root/redis/connection.py
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2011-05-12 03:02:14 -0700
committerAndy McCurdy <andy@andymccurdy.com>2011-05-12 03:02:14 -0700
commitf64c4ad7ed9a2d87a92415c3490edf8e9b757d84 (patch)
tree9bd298d0b8d684d7dc071be88e117df64def2538 /redis/connection.py
parent1685fd2f3e780c17c3bcb866ea60b6e94d8efec1 (diff)
downloadredis-py-f64c4ad7ed9a2d87a92415c3490edf8e9b757d84.tar.gz
make a formal hook so other types of connections don't have to repeat the same connection setup logic
Diffstat (limited to 'redis/connection.py')
-rw-r--r--redis/connection.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/redis/connection.py b/redis/connection.py
index 5bca883..d5e4165 100644
--- a/redis/connection.py
+++ b/redis/connection.py
@@ -131,12 +131,12 @@ class Connection(object):
raise ConnectionError(error_message)
self._sock = sock
- self._parser.on_connect(self)
+ self.on_connect()
- self.setup_connection()
+ def on_connect(self):
+ "Initialize the connection, authenticate and select a database"
+ self._parser.on_connect(self)
- def setup_connection(self):
- "Authenticates and Selects the appropriate database"
# if a password is specified, authenticate
if self.password:
self.send_command('AUTH', self.password)