diff options
| author | Devendra | 2014-04-25 19:42:21 +0530 |
|---|---|---|
| committer | Devendra | 2014-04-25 19:42:21 +0530 |
| commit | 44aee82f3eadea1241ac4350b4f9f34daf58eb87 (patch) | |
| tree | 1fb58322b718074b7b2e2e967ac52eaeafdd424a /Pubnub.py | |
| parent | 9e4032331721539d2b1e74b87b86ac5c66ccc4af (diff) | |
| download | pubnub-python-44aee82f3eadea1241ac4350b4f9f34daf58eb87.tar.bz2 | |
improvements to console
Diffstat (limited to 'Pubnub.py')
| -rw-r--r-- | Pubnub.py | 41 |
1 files changed, 21 insertions, 20 deletions
@@ -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): |
