diff options
| -rw-r--r-- | Makefile | 24 | ||||
| -rw-r--r-- | common/PubnubBase.py | 2 | ||||
| -rw-r--r-- | common/PubnubCore.py | 2 | ||||
| -rw-r--r-- | common/PubnubCoreAsync.py | 13 | ||||
| -rw-r--r-- | common/PubnubCrypto.py | 2 | ||||
| -rw-r--r-- | common/unit-test-async.py | 1 | ||||
| -rw-r--r-- | python-tornado/Makefile | 1 | ||||
| -rw-r--r-- | python-tornado/Pubnub.py | 4 | ||||
| -rw-r--r-- | python-twisted/Makefile | 2 | ||||
| -rw-r--r-- | python-twisted/Pubnub.py | 5 | 
10 files changed, 24 insertions, 32 deletions
| @@ -1,19 +1,13 @@  SUBDIRS = common python python-twisted python-tornado -.PHONY: all -all: -	for dir in $(SUBDIRS); do \ -    	$(MAKE) -C $$dir;     \ -	done +.PHONY: all test +all test: $(SUBDIRS) -.PHONY: clean -clean: -	for dir in $(SUBDIRS); do \ -		$(MAKE) clean -C $$dir; \ -	done  +all: TARG=all +test: TARG=test -.PHONY: test -test: -	for dir in $(SUBDIRS); do \ -		$(MAKE) test -C $$dir; \ -	done  +$(SUBDIRS): force +	@ $(MAKE) -C $@ $(TARG) + +.PHONY: force +force :; diff --git a/common/PubnubBase.py b/common/PubnubBase.py index b5da9fa..0c4efef 100644 --- a/common/PubnubBase.py +++ b/common/PubnubBase.py @@ -6,7 +6,7 @@  ## http://www.pubnub.com/  ## ----------------------------------- -## PubNub 3.3.2 Real-time Push Cloud API +## PubNub 3.3.4 Real-time Push Cloud API  ## -----------------------------------  try: import json diff --git a/common/PubnubCore.py b/common/PubnubCore.py index 9b32de7..5965740 100644 --- a/common/PubnubCore.py +++ b/common/PubnubCore.py @@ -6,7 +6,7 @@  ## http://www.pubnub.com/  ## ----------------------------------- -## PubNub 3.3.2 Real-time Push Cloud API +## PubNub 3.3.4 Real-time Push Cloud API  ## -----------------------------------  try: import json diff --git a/common/PubnubCoreAsync.py b/common/PubnubCoreAsync.py index 5b8d130..8150bde 100644 --- a/common/PubnubCoreAsync.py +++ b/common/PubnubCoreAsync.py @@ -6,7 +6,7 @@  ## http://www.pubnub.com/  ## ----------------------------------- -## PubNub 3.3.2 Real-time Push Cloud API +## PubNub 3.3.4 Real-time Push Cloud API  ## -----------------------------------  import sys  import json @@ -142,16 +142,15 @@ class PubnubCoreAsync(PubnubBase):                  return              def sub_callback(response): -                print response -                response = json.loads(response) +                if not self.subscriptions[channel]['first'] : +                    self.subscriptions[channel]['first'] = True +                    connectcb() +                  ## STOP CONNECTION?                  if not self.subscriptions[channel]['connected']:                      return -                ## CONNECTED CALLBACK -                if not self.subscriptions[channel]['first'] : -                    self.subscriptions[channel]['first'] = True -                    connectcb() +                  ## PROBLEM?                  if not response: diff --git a/common/PubnubCrypto.py b/common/PubnubCrypto.py index b452765..b91e2d9 100644 --- a/common/PubnubCrypto.py +++ b/common/PubnubCrypto.py @@ -6,7 +6,7 @@  ## http://www.pubnub.com/  ## ----------------------------------- -## PubNub 3.3.2 Real-time Push Cloud API +## PubNub 3.3.4 Real-time Push Cloud API  ## -----------------------------------  from Crypto.Cipher import AES diff --git a/common/unit-test-async.py b/common/unit-test-async.py index 258bf6a..89a828e 100644 --- a/common/unit-test-async.py +++ b/common/unit-test-async.py @@ -93,7 +93,6 @@ def test_subscribe():              'callback' : publish_cb          })      def subscribe_cb(response): -        print response          test(response == message , 'Subscribe Receive Test in subscribe Callback')      pubnub.subscribe({          'channel' : crazy, diff --git a/python-tornado/Makefile b/python-tornado/Makefile index 2c33cf3..13a5e5a 100644 --- a/python-tornado/Makefile +++ b/python-tornado/Makefile @@ -14,4 +14,5 @@ clean:  .PHONY: test  test: +	python ../common/unit-test-async.py diff --git a/python-tornado/Pubnub.py b/python-tornado/Pubnub.py index 55ca7ca..f22aecc 100644 --- a/python-tornado/Pubnub.py +++ b/python-tornado/Pubnub.py @@ -6,7 +6,7 @@  ## http://www.pubnub.com/  ## ----------------------------------- -## PubNub 3.3.2 Real-time Push Cloud API +## PubNub 3.3.4 Real-time Push Cloud API  ## -----------------------------------  import sys  from PubnubCoreAsync import PubnubCoreAsync @@ -67,7 +67,7 @@ class Pubnub(PubnubCoreAsync):          #print self.headers          request = tornado.httpclient.HTTPRequest( url, 'GET', self.headers, connect_timeout=310, request_timeout=310 )           def responseCallback(response): -            callback(response._get_body()) +            callback(eval(response._get_body()))          self.http.fetch(              request, diff --git a/python-twisted/Makefile b/python-twisted/Makefile index 4cd9305..13a5e5a 100644 --- a/python-twisted/Makefile +++ b/python-twisted/Makefile @@ -14,5 +14,5 @@ clean:  .PHONY: test  test: -	python tests/unit-test.py +	python ../common/unit-test-async.py diff --git a/python-twisted/Pubnub.py b/python-twisted/Pubnub.py index e317a9c..8b29236 100644 --- a/python-twisted/Pubnub.py +++ b/python-twisted/Pubnub.py @@ -6,7 +6,7 @@  ## http://www.pubnub.com/  ## ----------------------------------- -## PubNub 3.3.2 Real-time Push Cloud API +## PubNub 3.3.4 Real-time Push Cloud API  ## -----------------------------------  import sys  import json @@ -84,13 +84,12 @@ class Pubnub(PubnubCoreAsync):          request     = agent.request( 'GET', url, Headers(self.headers), None )          def received(response): -            #print response              finished = Deferred()              response.deliverBody(PubNubResponse(finished))              return finished          def complete(data): -            callback(data) +            callback(eval(data))          request.addCallback(received)          request.addBoth(complete) | 
