diff options
| author | Devendra | 2014-04-25 23:46:57 +0530 | 
|---|---|---|
| committer | Devendra | 2014-04-25 23:46:57 +0530 | 
| commit | 7568c30242ae3a9f4163248a29a596fab5902601 (patch) | |
| tree | 4e6dd23221f73223f27bb3661917110e2f70e2e5 /Pubnub.py | |
| parent | 2b72900bab9af06f37bd024c4aad8da3513a2430 (diff) | |
| download | pubnub-python-7568c30242ae3a9f4163248a29a596fab5902601.tar.bz2 | |
adding sync async mode to console
Diffstat (limited to 'Pubnub.py')
| -rw-r--r-- | Pubnub.py | 34 | 
1 files changed, 17 insertions, 17 deletions
| @@ -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' | 
