From 90224d02e5f2400fb277217342ffa5cd4a7cb2c6 Mon Sep 17 00:00:00 2001 From: Devendra Date: Sun, 24 Feb 2013 03:23:01 +0530 Subject: saving work --- python-twisted/examples/publish-example.py | 1 + 1 file changed, 1 insertion(+) (limited to 'python-twisted/examples/publish-example.py') diff --git a/python-twisted/examples/publish-example.py b/python-twisted/examples/publish-example.py index 4a5baf6..9c3be60 100644 --- a/python-twisted/examples/publish-example.py +++ b/python-twisted/examples/publish-example.py @@ -12,6 +12,7 @@ import sys from twisted.internet import reactor sys.path.append('../') +sys.path.append('../../') from Pubnub import Pubnub publish_key = len(sys.argv) > 1 and sys.argv[1] or 'demo' -- cgit v1.2.3 From 2238067fbbe3fa6154150095f8a3b4b317a7c7dd Mon Sep 17 00:00:00 2001 From: Devendra Date: Mon, 25 Feb 2013 21:58:57 +0530 Subject: refactoring --- python-twisted/examples/publish-example.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'python-twisted/examples/publish-example.py') diff --git a/python-twisted/examples/publish-example.py b/python-twisted/examples/publish-example.py index 9c3be60..d09ad8d 100644 --- a/python-twisted/examples/publish-example.py +++ b/python-twisted/examples/publish-example.py @@ -48,11 +48,14 @@ pubnub.publish({ 'callback' : publish_complete }) +def done_cb(info): + publish_complete(info) + reactor.stop() ## Publish Dictionary Object pubnub.publish({ 'channel' : crazy, 'message' : { 'some_key' : 'some_val' }, - 'callback' : publish_complete + 'callback' : done_cb }) ## ----------------------------------------------------------------------- -- cgit v1.2.3