aboutsummaryrefslogtreecommitdiffstats
path: root/python-twisted/examples/subscribe.py
diff options
context:
space:
mode:
authorDevendra2014-05-07 12:13:17 +0530
committerDevendra2014-05-07 12:13:17 +0530
commit1b49e712e12ba833f460324b95969b162d464edf (patch)
treeaefbb53635e8e3ae60c3892bf5c27eff0175b0f9 /python-twisted/examples/subscribe.py
parenta38e680ae11453c2f3d5082c2ad39004366a9ad7 (diff)
downloadpubnub-python-1b49e712e12ba833f460324b95969b162d464edf.tar.bz2
console changes and pep8 compliance
Diffstat (limited to 'python-twisted/examples/subscribe.py')
-rw-r--r--python-twisted/examples/subscribe.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/python-twisted/examples/subscribe.py b/python-twisted/examples/subscribe.py
index 1462a69..9c73439 100644
--- a/python-twisted/examples/subscribe.py
+++ b/python-twisted/examples/subscribe.py
@@ -21,28 +21,31 @@ ssl_on = len(sys.argv) > 5 and bool(sys.argv[5]) or False
pubnub = Pubnub(publish_key=publish_key, subscribe_key=subscribe_key,
secret_key=secret_key, cipher_key=cipher_key, ssl_on=ssl_on)
-channel = 'a'
-
+channel = 'a'
# Asynchronous usage
-
def callback(message, channel):
print(message)
+
def error(message):
print("ERROR : " + str(message))
+
def connect(message):
print("CONNECTED")
+
def reconnect(message):
print("RECONNECTED")
+
def disconnect(message):
print("DISCONNECTED")
-pubnub.subscribe(channel, callback=callback, error=callback, connect=connect, reconnect=reconnect, disconnect=disconnect)
+pubnub.subscribe(channel, callback=callback, error=callback,
+ connect=connect, reconnect=reconnect, disconnect=disconnect)
pubnub.start()