diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/examples/audit.py | 2 | ||||
| -rw-r--r-- | python/examples/console.py | 2 | ||||
| -rw-r--r-- | python/examples/cr.py | 2 | ||||
| -rwxr-xr-x | python/examples/dev-console.py | 2 | ||||
| -rw-r--r-- | python/examples/grant.py | 2 | ||||
| -rw-r--r-- | python/examples/here-now.py | 2 | ||||
| -rw-r--r-- | python/examples/history.py | 2 | ||||
| -rw-r--r-- | python/examples/presence.py | 2 | ||||
| -rw-r--r-- | python/examples/publish.py | 4 | ||||
| -rw-r--r-- | python/examples/pubnub-console/pubnub-console | 2 | ||||
| -rw-r--r-- | python/examples/revoke.py | 2 | ||||
| -rw-r--r-- | python/examples/subscribe.py | 9 | ||||
| -rw-r--r-- | python/examples/subscribe_group.py | 2 | ||||
| -rwxr-xr-x | python/tests/subscribe-test.py | 2 | ||||
| -rw-r--r-- | python/tests/test_cg.py | 2 | ||||
| -rw-r--r-- | python/tests/test_grant.py | 2 | ||||
| -rw-r--r-- | python/tests/test_grant_async.py | 2 | ||||
| -rw-r--r-- | python/tests/test_publish_async.py | 2 |
18 files changed, 24 insertions, 21 deletions
diff --git a/python/examples/audit.py b/python/examples/audit.py index ebf31af..c53c2bd 100644 --- a/python/examples/audit.py +++ b/python/examples/audit.py @@ -7,7 +7,7 @@ import sys -from Pubnub import Pubnub +from pubnub import Pubnub publish_key = len(sys.argv) > 1 and sys.argv[1] or 'pam' subscribe_key = len(sys.argv) > 2 and sys.argv[2] or 'pam' diff --git a/python/examples/console.py b/python/examples/console.py index bfa4486..a1915ed 100644 --- a/python/examples/console.py +++ b/python/examples/console.py @@ -7,7 +7,7 @@ import sys -from Pubnub import Pubnub +from pubnub import Pubnub import threading from datetime import datetime diff --git a/python/examples/cr.py b/python/examples/cr.py index c537780..f63e6d2 100644 --- a/python/examples/cr.py +++ b/python/examples/cr.py @@ -7,7 +7,7 @@ import sys -from Pubnub import Pubnub +from pubnub import Pubnub publish_key = len(sys.argv) > 1 and sys.argv[1] or 'pam' subscribe_key = len(sys.argv) > 2 and sys.argv[2] or 'pam' diff --git a/python/examples/dev-console.py b/python/examples/dev-console.py index 134d2e7..8527307 100755 --- a/python/examples/dev-console.py +++ b/python/examples/dev-console.py @@ -6,7 +6,7 @@ ## http://www.pubnub.com/ import sys -from Pubnub import Pubnub +from pubnub import Pubnub from optparse import OptionParser diff --git a/python/examples/grant.py b/python/examples/grant.py index af9352e..b0832e4 100644 --- a/python/examples/grant.py +++ b/python/examples/grant.py @@ -7,7 +7,7 @@ import sys -from Pubnub import Pubnub +from pubnub import Pubnub publish_key = len(sys.argv) > 1 and sys.argv[1] or 'pam' subscribe_key = len(sys.argv) > 2 and sys.argv[2] or 'pam' diff --git a/python/examples/here-now.py b/python/examples/here-now.py index 9640cc5..4c2dc4c 100644 --- a/python/examples/here-now.py +++ b/python/examples/here-now.py @@ -7,7 +7,7 @@ import sys -from Pubnub import Pubnub +from pubnub import Pubnub publish_key = len(sys.argv) > 1 and sys.argv[1] or 'demo' subscribe_key = len(sys.argv) > 2 and sys.argv[2] or 'demo' diff --git a/python/examples/history.py b/python/examples/history.py index 603a0f8..5b92828 100644 --- a/python/examples/history.py +++ b/python/examples/history.py @@ -7,7 +7,7 @@ import sys -from Pubnub import Pubnub +from pubnub import Pubnub publish_key = len(sys.argv) > 1 and sys.argv[1] or 'demo' subscribe_key = len(sys.argv) > 2 and sys.argv[2] or 'demo' diff --git a/python/examples/presence.py b/python/examples/presence.py index ab91321..7d9af3b 100644 --- a/python/examples/presence.py +++ b/python/examples/presence.py @@ -7,7 +7,7 @@ import sys -from Pubnub import Pubnub +from pubnub import Pubnub publish_key = len(sys.argv) > 1 and sys.argv[1] or 'demo' subscribe_key = len(sys.argv) > 2 and sys.argv[2] or 'demo' diff --git a/python/examples/publish.py b/python/examples/publish.py index 594e7c4..3bc5e8f 100644 --- a/python/examples/publish.py +++ b/python/examples/publish.py @@ -7,7 +7,7 @@ import sys -from Pubnub import Pubnub +from pubnub import Pubnub publish_key = len(sys.argv) > 1 and sys.argv[1] or 'demo' subscribe_key = len(sys.argv) > 2 and sys.argv[2] or 'demo' @@ -19,7 +19,7 @@ ssl_on = len(sys.argv) > 5 and bool(sys.argv[5]) or False ## Initiate Pubnub State ## ----------------------------------------------------------------------- pubnub = Pubnub(publish_key=publish_key, subscribe_key=subscribe_key, - secret_key=secret_key, cipher_key=cipher_key, ssl_on=ssl_on) + secret_key=secret_key, cipher_key=cipher_key, ssl_on=ssl_on, pooling=False) channel = 'hello_world' message = 'Hello World !!!' diff --git a/python/examples/pubnub-console/pubnub-console b/python/examples/pubnub-console/pubnub-console index bfa4486..a1915ed 100644 --- a/python/examples/pubnub-console/pubnub-console +++ b/python/examples/pubnub-console/pubnub-console @@ -7,7 +7,7 @@ import sys -from Pubnub import Pubnub +from pubnub import Pubnub import threading from datetime import datetime diff --git a/python/examples/revoke.py b/python/examples/revoke.py index 437e5b5..9bee010 100644 --- a/python/examples/revoke.py +++ b/python/examples/revoke.py @@ -7,7 +7,7 @@ import sys -from Pubnub import Pubnub +from pubnub import Pubnub publish_key = len(sys.argv) > 1 and sys.argv[1] or 'pam' subscribe_key = len(sys.argv) > 2 and sys.argv[2] or 'pam' diff --git a/python/examples/subscribe.py b/python/examples/subscribe.py index 9b8b223..489c7c1 100644 --- a/python/examples/subscribe.py +++ b/python/examples/subscribe.py @@ -7,7 +7,7 @@ import sys -from Pubnub import Pubnub +from pubnub import Pubnub publish_key = len(sys.argv) > 1 and sys.argv[1] or 'demo' subscribe_key = len(sys.argv) > 2 and sys.argv[2] or 'demo' @@ -19,7 +19,7 @@ ssl_on = len(sys.argv) > 5 and bool(sys.argv[5]) or False ## Initiate Pubnub State ## ----------------------------------------------------------------------- pubnub = Pubnub(publish_key=publish_key, subscribe_key=subscribe_key, - secret_key=secret_key, cipher_key=cipher_key, ssl_on=ssl_on) + secret_key=secret_key, cipher_key=cipher_key, ssl_on=ssl_on, daemon=True) channel = 'a' @@ -45,5 +45,8 @@ def disconnect(message): print("DISCONNECTED") -pubnub.subscribe(channel, callback=callback, error=callback, +pubnub.subscribe(channels=channel, callback=callback, error=callback, connect=connect, reconnect=reconnect, disconnect=disconnect) +import time +while True: + time.sleep(10) diff --git a/python/examples/subscribe_group.py b/python/examples/subscribe_group.py index ee8e190..c6dcf67 100644 --- a/python/examples/subscribe_group.py +++ b/python/examples/subscribe_group.py @@ -7,7 +7,7 @@ import sys -from Pubnub import Pubnub as Pubnub +from pubnub import Pubnub as Pubnub publish_key = len(sys.argv) > 1 and sys.argv[1] or 'demo' subscribe_key = len(sys.argv) > 2 and sys.argv[2] or 'demo' diff --git a/python/tests/subscribe-test.py b/python/tests/subscribe-test.py index a1b1826..7a4b723 100755 --- a/python/tests/subscribe-test.py +++ b/python/tests/subscribe-test.py @@ -11,7 +11,7 @@ import sys import datetime -from Pubnub import PubnubAsync as Pubnub +from pubnub import PubnubAsync as Pubnub from functools import partial from threading import current_thread import threading diff --git a/python/tests/test_cg.py b/python/tests/test_cg.py index a823e44..f4a1080 100644 --- a/python/tests/test_cg.py +++ b/python/tests/test_cg.py @@ -1,4 +1,4 @@ -from Pubnub import Pubnub +from pubnub import Pubnub import time import random diff --git a/python/tests/test_grant.py b/python/tests/test_grant.py index 9ecafdf..57f0b14 100644 --- a/python/tests/test_grant.py +++ b/python/tests/test_grant.py @@ -1,6 +1,6 @@ -from Pubnub import Pubnub +from pubnub import Pubnub import time pubnub = Pubnub("demo","demo") diff --git a/python/tests/test_grant_async.py b/python/tests/test_grant_async.py index 4d38a0a..07c8a2c 100644 --- a/python/tests/test_grant_async.py +++ b/python/tests/test_grant_async.py @@ -1,6 +1,6 @@ -from Pubnub import Pubnub +from pubnub import Pubnub import time pubnub = Pubnub("demo","demo") diff --git a/python/tests/test_publish_async.py b/python/tests/test_publish_async.py index 7270727..cf0811e 100644 --- a/python/tests/test_publish_async.py +++ b/python/tests/test_publish_async.py @@ -1,6 +1,6 @@ -from Pubnub import Pubnub +from pubnub import Pubnub import time pubnub = Pubnub("demo","demo") |
