diff options
| author | Devendra | 2015-06-19 00:52:43 +0530 | 
|---|---|---|
| committer | Devendra | 2015-06-19 00:52:43 +0530 | 
| commit | 74953cb311e46636f9ce4903e41acac9bfc7f6ba (patch) | |
| tree | f56371901d681cc1704e7ffd901a404facaf13c3 /python/examples | |
| parent | 589a28dbf9495c3d2d904d3ffd46947278eb0a7b (diff) | |
| parent | df1ed365a2f490b3823fa785818e30c2eecf7dbb (diff) | |
| download | pubnub-python-74953cb311e46636f9ce4903e41acac9bfc7f6ba.tar.bz2 | |
merging develop
Diffstat (limited to 'python/examples')
| -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 | 
13 files changed, 19 insertions, 16 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' | 
