aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/PubnubBase.py8
-rw-r--r--python-tornado/Pubnub.py14
-rw-r--r--python-twisted/Pubnub.py14
-rw-r--r--python/Pubnub.py8
-rwxr-xr-xpython/examples/dev-console.py1
5 files changed, 30 insertions, 15 deletions
diff --git a/common/PubnubBase.py b/common/PubnubBase.py
index aa71577..585be70 100644
--- a/common/PubnubBase.py
+++ b/common/PubnubBase.py
@@ -66,8 +66,12 @@ class PubnubBase(object):
self.python_version = 2
self.pc = PubnubCrypto2()
else:
- self.python_version = 3
- self.pc = PubnubCrypto3()
+ if sys.version_info.major == 2:
+ self.python_version = 2
+ self.pc = PubnubCrypto2()
+ else:
+ self.python_version = 3
+ self.pc = PubnubCrypto3()
if not isinstance(self.uuid, str):
raise AttributeError("pres_uuid must be a string")
diff --git a/python-tornado/Pubnub.py b/python-tornado/Pubnub.py
index 757cdd7..2c6c98f 100644
--- a/python-tornado/Pubnub.py
+++ b/python-tornado/Pubnub.py
@@ -237,8 +237,12 @@ class PubnubBase(object):
self.python_version = 2
self.pc = PubnubCrypto2()
else:
- self.python_version = 3
- self.pc = PubnubCrypto3()
+ if sys.version_info.major == 2:
+ self.python_version = 2
+ self.pc = PubnubCrypto2()
+ else:
+ self.python_version = 3
+ self.pc = PubnubCrypto3()
if not isinstance(self.uuid, str):
raise AttributeError("pres_uuid must be a string")
@@ -318,14 +322,14 @@ class PubnubBase(object):
"ttl" : ttl
}, callback=callback)
- def revoke( self, channel, authkey=False, read=False, write=False, ttl=1, callback=None):
+ def revoke( self, channel, authkey=False, ttl=1, callback=None):
"""Revoke Access on a Channel."""
return self._pam_auth({
"channel" : channel,
"auth" : authkey,
- "r" : read and 1 or 0,
- "w" : write and 1 or 0,
+ "r" : 0,
+ "w" : 0,
"ttl" : ttl
}, callback=callback)
diff --git a/python-twisted/Pubnub.py b/python-twisted/Pubnub.py
index b9e6b52..99eda47 100644
--- a/python-twisted/Pubnub.py
+++ b/python-twisted/Pubnub.py
@@ -237,8 +237,12 @@ class PubnubBase(object):
self.python_version = 2
self.pc = PubnubCrypto2()
else:
- self.python_version = 3
- self.pc = PubnubCrypto3()
+ if sys.version_info.major == 2:
+ self.python_version = 2
+ self.pc = PubnubCrypto2()
+ else:
+ self.python_version = 3
+ self.pc = PubnubCrypto3()
if not isinstance(self.uuid, str):
raise AttributeError("pres_uuid must be a string")
@@ -318,14 +322,14 @@ class PubnubBase(object):
"ttl" : ttl
}, callback=callback)
- def revoke( self, channel, authkey=False, read=False, write=False, ttl=1, callback=None):
+ def revoke( self, channel, authkey=False, ttl=1, callback=None):
"""Revoke Access on a Channel."""
return self._pam_auth({
"channel" : channel,
"auth" : authkey,
- "r" : read and 1 or 0,
- "w" : write and 1 or 0,
+ "r" : 0,
+ "w" : 0,
"ttl" : ttl
}, callback=callback)
diff --git a/python/Pubnub.py b/python/Pubnub.py
index 64bc14b..7af2e92 100644
--- a/python/Pubnub.py
+++ b/python/Pubnub.py
@@ -237,8 +237,12 @@ class PubnubBase(object):
self.python_version = 2
self.pc = PubnubCrypto2()
else:
- self.python_version = 3
- self.pc = PubnubCrypto3()
+ if sys.version_info.major == 2:
+ self.python_version = 2
+ self.pc = PubnubCrypto2()
+ else:
+ self.python_version = 3
+ self.pc = PubnubCrypto3()
if not isinstance(self.uuid, str):
raise AttributeError("pres_uuid must be a string")
diff --git a/python/examples/dev-console.py b/python/examples/dev-console.py
index 33ec39f..08e08d9 100755
--- a/python/examples/dev-console.py
+++ b/python/examples/dev-console.py
@@ -10,7 +10,6 @@
## -----------------------------------
import sys
-from twisted.internet import reactor
sys.path.append('../')
sys.path.append('../../')
from Pubnub import Pubnub