aboutsummaryrefslogtreecommitdiffstats
path: root/Pubnub.py
diff options
context:
space:
mode:
authorDevendra2014-04-25 19:42:21 +0530
committerDevendra2014-04-25 19:42:21 +0530
commit44aee82f3eadea1241ac4350b4f9f34daf58eb87 (patch)
tree1fb58322b718074b7b2e2e967ac52eaeafdd424a /Pubnub.py
parent9e4032331721539d2b1e74b87b86ac5c66ccc4af (diff)
downloadpubnub-python-44aee82f3eadea1241ac4350b4f9f34daf58eb87.tar.bz2
improvements to console
Diffstat (limited to 'Pubnub.py')
-rw-r--r--Pubnub.py41
1 files changed, 21 insertions, 20 deletions
diff --git a/Pubnub.py b/Pubnub.py
index 62a401d..cefe50b 100644
--- a/Pubnub.py
+++ b/Pubnub.py
@@ -22,6 +22,7 @@ import hashlib
import uuid
import sys
from base64 import urlsafe_b64encode
+from base64 import encodestring, decodestring
import hmac
from Crypto.Cipher import AES
from Crypto.Hash import MD5
@@ -85,6 +86,26 @@ try:
pnconn_pool.maxPersistentPerHost = 100000
pnconn_pool.cachedConnectionTimeout = 15
pnconn_pool.retryAutomatically = True
+
+ class WebClientContextFactory(ClientContextFactory):
+ def getContext(self, hostname, port):
+ return ClientContextFactory.getContext(self)
+
+
+ class PubNubPamResponse(Protocol):
+ def __init__(self, finished):
+ self.finished = finished
+
+ def dataReceived(self, bytes):
+ self.finished.callback(bytes)
+
+
+ class PubNubResponse(Protocol):
+ def __init__(self, finished):
+ self.finished = finished
+
+ def dataReceived(self, bytes):
+ self.finished.callback(bytes)
except ImportError:
pass
@@ -1297,26 +1318,6 @@ class PubnubTwisted(PubnubCoreAsync):
return abort
-class WebClientContextFactory(ClientContextFactory):
- def getContext(self, hostname, port):
- return ClientContextFactory.getContext(self)
-
-
-class PubNubPamResponse(Protocol):
- def __init__(self, finished):
- self.finished = finished
-
- def dataReceived(self, bytes):
- self.finished.callback(bytes)
-
-
-class PubNubResponse(Protocol):
- def __init__(self, finished):
- self.finished = finished
-
- def dataReceived(self, bytes):
- self.finished.callback(bytes)
-
# PubnubTornado
class PubnubTornado(PubnubCoreAsync):