From 1f2f3bb965db6ea35e5ceded22351b77ad7b1801 Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Mon, 9 Sep 2013 22:57:28 -0400 Subject: [PATCH] add auto_connect __init__ parameter --- riakcached/client.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/riakcached/client.py b/riakcached/client.py index 040813b..49479e1 100644 --- a/riakcached/client.py +++ b/riakcached/client.py @@ -21,13 +21,12 @@ class RiakClient(object): "url", ] - def __init__(self, bucket, url="http://127.0.0.1:8098", timeout=2): + def __init__(self, bucket, url="http://127.0.0.1:8098", timeout=2, auto_connect=True): """ """ self.bucket = bucket self.url = url.strip("/") self._timeout = timeout - self._connect() self._serializers = { "application/json": json.dumps, } @@ -35,6 +34,9 @@ class RiakClient(object): "application/json": json.loads, } + if auto_connect: + self._connect() + def setup_serializer(self, content_type, serializer, deserializer): """ """