aboutsummaryrefslogtreecommitdiffstats
path: root/python-twisted
diff options
context:
space:
mode:
authorDevendra2014-04-24 00:16:57 +0530
committerDevendra2014-04-24 00:16:57 +0530
commit493e29a108255eb3ae3166dc920f40e2f4e5c4c4 (patch)
treebce73bc6014e0b10820ebc1393515f7e3e521b88 /python-twisted
parentf7b89bfafae34fa22509c1d1c59d1284ec62c5df (diff)
downloadpubnub-python-493e29a108255eb3ae3166dc920f40e2f4e5c4c4.tar.bz2
adding single file for all platforms
Diffstat (limited to 'python-twisted')
-rw-r--r--python-twisted/Pubnub.py7
-rw-r--r--python-twisted/unassembled/Platform.py7
2 files changed, 6 insertions, 8 deletions
diff --git a/python-twisted/Pubnub.py b/python-twisted/Pubnub.py
index 94d2624..efbbfd9 100644
--- a/python-twisted/Pubnub.py
+++ b/python-twisted/Pubnub.py
@@ -868,10 +868,9 @@ from twisted.python.compat import (
pnconn_pool = HTTPConnectionPool(reactor, persistent=True)
pnconn_pool.maxPersistentPerHost = 100000
-pnconn_pool.cachedConnectionTimeout = 310
+pnconn_pool.cachedConnectionTimeout = 15
pnconn_pool.retryAutomatically = True
-
class Pubnub(PubnubCoreAsync):
def start(self):
@@ -937,11 +936,11 @@ class Pubnub(PubnubCoreAsync):
def received(response):
if not isinstance(response, twisted.web._newclient.Response):
- _invoke(error, {"message": "Not Found"})
+ _invoke(error, {"message" : "Not Found"})
return
finished = Deferred()
- if response.code in [401, 403]:
+ if response.code in [401,403]:
response.deliverBody(PubNubPamResponse(finished))
else:
response.deliverBody(PubNubResponse(finished))
diff --git a/python-twisted/unassembled/Platform.py b/python-twisted/unassembled/Platform.py
index a9e811b..b220257 100644
--- a/python-twisted/unassembled/Platform.py
+++ b/python-twisted/unassembled/Platform.py
@@ -21,10 +21,9 @@ from twisted.python.compat import (
pnconn_pool = HTTPConnectionPool(reactor, persistent=True)
pnconn_pool.maxPersistentPerHost = 100000
-pnconn_pool.cachedConnectionTimeout = 310
+pnconn_pool.cachedConnectionTimeout = 15
pnconn_pool.retryAutomatically = True
-
class Pubnub(PubnubCoreAsync):
def start(self):
@@ -90,11 +89,11 @@ class Pubnub(PubnubCoreAsync):
def received(response):
if not isinstance(response, twisted.web._newclient.Response):
- _invoke(error, {"message": "Not Found"})
+ _invoke(error, {"message" : "Not Found"})
return
finished = Deferred()
- if response.code in [401, 403]:
+ if response.code in [401,403]:
response.deliverBody(PubNubPamResponse(finished))
else:
response.deliverBody(PubNubResponse(finished))