aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevendra2014-05-08 04:12:28 +0530
committerDevendra2014-05-08 04:12:28 +0530
commit1607828ef5d2ef6c3ce357f83f53ea109be02182 (patch)
tree5abde41566f2a2fc4eccdfdb07a3eee9e970de0d
parent09dbc7589b35963be1835ed58dcfd09d4d5c3ccc (diff)
downloadpubnub-python-1607828ef5d2ef6c3ce357f83f53ea109be02182.tar.bz2
updating package urls
-rw-r--r--Pubnub.py23
-rw-r--r--dist/pubnub-3.5.0-beta.tar.gzbin9447 -> 9451 bytes
-rw-r--r--python/examples/pubnub-console/dist/pubnub-console-3.5.0-beta.tar.gzbin4627 -> 4647 bytes
-rw-r--r--python/examples/pubnub-console/setup.py2
-rw-r--r--setup.py2
5 files changed, 15 insertions, 12 deletions
diff --git a/Pubnub.py b/Pubnub.py
index 4ae27ab..e00ebb7 100644
--- a/Pubnub.py
+++ b/Pubnub.py
@@ -115,6 +115,13 @@ except ImportError:
#######################################
+def get_data_for_user(data):
+ if 'message' in data and 'payload' in data:
+ return {'message': data['message'], 'payload': data['payload']}
+ else:
+ return data
+
+
class PubnubCrypto2():
"""
#**
@@ -757,9 +764,9 @@ class PubnubCoreAsync(PubnubBase):
def _invoke(func, msg=None, channel=None):
if func is not None:
if msg is not None and channel is not None:
- func(msg, channel)
+ func(get_data_for_user(msg), channel)
elif msg is not None:
- func(msg)
+ func(get_data_for_user(msg))
else:
func()
@@ -1065,7 +1072,7 @@ class HTTPClient:
def _invoke(func, data):
if func is not None:
- func(data)
+ func(get_data_for_user(data))
if self._urllib_func is None:
return
@@ -1132,15 +1139,11 @@ def _requests_request(url, timeout=320):
try:
resp = s.get(url, timeout=timeout)
except requests.exceptions.HTTPError as http_error:
- print http_error
resp = http_error
except requests.exceptions.ConnectionError as error:
- print error
msg = str(error)
return (json.dumps(msg), 0)
except requests.exceptions.Timeout as error:
- print(error)
- #print('timeout');
msg = str(error)
return (json.dumps(msg), 0)
return (resp.text, resp.status_code)
@@ -1242,7 +1245,7 @@ class PubnubAsync(PubnubCoreAsync):
def _request(self, request, callback=None, error=None, single=False):
if callback is None:
- return self._request_sync(request)
+ return get_data_for_user(self._request_sync(request))
else:
self._request_async(request, callback, error, single=single)
@@ -1313,7 +1316,7 @@ class PubnubTwisted(PubnubCoreAsync):
def _invoke(func, data):
if func is not None:
- func(data)
+ func(get_data_for_user(data))
## Build URL
@@ -1418,7 +1421,7 @@ class PubnubTornado(PubnubCoreAsync):
def _invoke(func, data):
if func is not None:
- func(data)
+ func(get_data_for_user(data))
url = self.getUrl(request)
request = tornado.httpclient.HTTPRequest(
diff --git a/dist/pubnub-3.5.0-beta.tar.gz b/dist/pubnub-3.5.0-beta.tar.gz
index 6201683..3ed2de3 100644
--- a/dist/pubnub-3.5.0-beta.tar.gz
+++ b/dist/pubnub-3.5.0-beta.tar.gz
Binary files differ
diff --git a/python/examples/pubnub-console/dist/pubnub-console-3.5.0-beta.tar.gz b/python/examples/pubnub-console/dist/pubnub-console-3.5.0-beta.tar.gz
index 39540f6..278e9fa 100644
--- a/python/examples/pubnub-console/dist/pubnub-console-3.5.0-beta.tar.gz
+++ b/python/examples/pubnub-console/dist/pubnub-console-3.5.0-beta.tar.gz
Binary files differ
diff --git a/python/examples/pubnub-console/setup.py b/python/examples/pubnub-console/setup.py
index 1ef09be..d46314e 100644
--- a/python/examples/pubnub-console/setup.py
+++ b/python/examples/pubnub-console/setup.py
@@ -6,7 +6,7 @@ setup(
description='PubNub Developer Console',
author='Stephen Blum',
author_email='support@pubnub.com',
- url='http://pubnub.s3.amazonaws.com/pip/pubnub-3.3.5.tar.gz',
+ url='https://github.com/pubnub/python/raw/async/python/examples/pubnub-console/dist/pubnub-console-3.5.0-beta.tar.gz',
scripts=['pubnub-console'],
license='MIT',
classifiers=(
diff --git a/setup.py b/setup.py
index c98ee99..373efde 100644
--- a/setup.py
+++ b/setup.py
@@ -6,7 +6,7 @@ setup(
description='PubNub Real-time push service in the cloud',
author='Stephen Blum',
author_email='support@pubnub.com',
- url='http://pubnub.s3.amazonaws.com/pip/pubnub-3.3.5.tar.gz',
+ url='https://github.com/pubnub/python/raw/async/dist/pubnub-3.5.0-beta.tar.gz',
py_modules=['Pubnub'],
license='MIT',
classifiers=(