aboutsummaryrefslogtreecommitdiffstats
path: root/Pubnub.py
diff options
context:
space:
mode:
authorDevendra2014-04-25 23:46:57 +0530
committerDevendra2014-04-25 23:46:57 +0530
commit7568c30242ae3a9f4163248a29a596fab5902601 (patch)
tree4e6dd23221f73223f27bb3661917110e2f70e2e5 /Pubnub.py
parent2b72900bab9af06f37bd024c4aad8da3513a2430 (diff)
downloadpubnub-python-7568c30242ae3a9f4163248a29a596fab5902601.tar.bz2
adding sync async mode to console
Diffstat (limited to 'Pubnub.py')
-rw-r--r--Pubnub.py34
1 files changed, 17 insertions, 17 deletions
diff --git a/Pubnub.py b/Pubnub.py
index cefe50b..6c082dc 100644
--- a/Pubnub.py
+++ b/Pubnub.py
@@ -340,7 +340,7 @@ class PubnubBase(object):
sha256
).digest())
- def _pam_auth(self, query, apicode=0, callback=None):
+ def _pam_auth(self, query, apicode=0, callback=None, error=None):
"""Issue an authenticated request."""
if 'timestamp' not in query:
@@ -364,7 +364,6 @@ class PubnubBase(object):
apitype="audit" if (apicode) else "grant",
params=params
)
-
query['signature'] = self._pam_sign(sign_input)
return self._request({"urlcomponents": [
@@ -372,10 +371,11 @@ class PubnubBase(object):
'sub-key',
self.subscribe_key
], 'urlparams': query},
- self._return_wrapped_callback(callback))
+ self._return_wrapped_callback(callback),
+ self._return_wrapped_callback(error))
def grant(self, channel, authkey=False, read=True,
- write=True, ttl=5, callback=None):
+ write=True, ttl=5, callback=None, error=None):
"""Grant Access on a Channel."""
return self._pam_auth({
@@ -384,9 +384,9 @@ class PubnubBase(object):
"r": read and 1 or 0,
"w": write and 1 or 0,
"ttl": ttl
- }, callback=callback)
+ }, callback=callback, error=error)
- def revoke(self, channel, authkey=False, ttl=1, callback=None):
+ def revoke(self, channel, authkey=False, ttl=1, callback=None, error=None):
"""Revoke Access on a Channel."""
return self._pam_auth({
@@ -395,13 +395,13 @@ class PubnubBase(object):
"r": 0,
"w": 0,
"ttl": ttl
- }, callback=callback)
+ }, callback=callback, error=error)
- def audit(self, channel=False, authkey=False, callback=None):
+ def audit(self, channel=False, authkey=False, callback=None, error=None):
return self._pam_auth({
"channel": channel,
"auth": authkey
- }, 1, callback=callback)
+ }, 1, callback=callback, error=error)
def encrypt(self, message):
if self.cipher_key:
@@ -627,8 +627,8 @@ class PubnubCoreAsync(PubnubBase):
self,
publish_key,
subscribe_key,
- secret_key=False,
- cipher_key=False,
+ secret_key=None,
+ cipher_key=None,
auth_key=None,
ssl_on=False,
origin='pubsub.pubnub.com',
@@ -910,8 +910,8 @@ class PubnubCore(PubnubCoreAsync):
self,
publish_key,
subscribe_key,
- secret_key=False,
- cipher_key=False,
+ secret_key=None,
+ cipher_key=None,
auth_key=None,
ssl_on=False,
origin='pubsub.pubnub.com',
@@ -1111,8 +1111,8 @@ class PubnubAsync(PubnubCoreAsync):
self,
publish_key,
subscribe_key,
- secret_key=False,
- cipher_key=False,
+ secret_key=None,
+ cipher_key=None,
auth_key=None,
ssl_on=False,
origin='pubsub.pubnub.com',
@@ -1231,8 +1231,8 @@ class PubnubTwisted(PubnubCoreAsync):
self,
publish_key,
subscribe_key,
- secret_key=False,
- cipher_key=False,
+ secret_key=None,
+ cipher_key=None,
auth_key=None,
ssl_on=False,
origin='pubsub.pubnub.com'