diff options
| -rw-r--r-- | python/examples/config | 9 | ||||
| -rw-r--r-- | python/examples/console-help.txt | 34 | ||||
| -rw-r--r-- | python/examples/console.py | 4 | ||||
| -rw-r--r-- | python/examples/start-console.sh | 8 | 
4 files changed, 55 insertions, 0 deletions
| diff --git a/python/examples/config b/python/examples/config new file mode 100644 index 0000000..1c73645 --- /dev/null +++ b/python/examples/config @@ -0,0 +1,9 @@ +sessionname pubnub-console +screen -t output tail -f ./pubnub-console.log +split +focus down +screen -t console  python console.py "set_output_file" +split -v +focus down +screen -t help vi ./console-help.txt +focus up diff --git a/python/examples/console-help.txt b/python/examples/console-help.txt new file mode 100644 index 0000000..55debd2 --- /dev/null +++ b/python/examples/console-help.txt @@ -0,0 +1,34 @@ +********************** HELP ****************************** + +TO EXIT  .   Ctrl-A \  followed by y +TO MOVE BETWEEN PANES  . Ctrl-A  TAB + +********************************************************** + +PUBLISH + +Usage: publish [options] arg + +Options: +  -h, --help            show this help message and exit +  -c CHANNEL, --channel=CHANNEL +                        Channel on which to publish + +Examples: +   (1)  publish -c hello_world  hi how r u +   (2)  pub -c hello_world  [1,2] + + + +SUBSCRIBE + +Usage: subscribe [options] arg + +Options: +  -h, --help            show this help message and exit +  -c CHANNEL, --channel=CHANNEL +                        Channel for subscribe + +Examples: +   (1)  subscribe -c hello_world +   (2)  sub -c hello_world
\ No newline at end of file diff --git a/python/examples/console.py b/python/examples/console.py index 8a3ab3b..e96b4e5 100644 --- a/python/examples/console.py +++ b/python/examples/console.py @@ -5,6 +5,7 @@  ## Copyright (c) 2010 Stephen Blum  ## http://www.pubnub.com/ +  import sys  from Pubnub import PubnubAsync as Pubnub  import threading @@ -19,6 +20,9 @@ import os  import readline  import rlcompleter +if sys.argv[0] == "screen": +    print "screen" +  historyPath = os.path.expanduser("~/.pubnub_console_history")  def save_history(historyPath=historyPath): diff --git a/python/examples/start-console.sh b/python/examples/start-console.sh new file mode 100644 index 0000000..df4fd6e --- /dev/null +++ b/python/examples/start-console.sh @@ -0,0 +1,8 @@ +if ! type "screen" > /dev/null; then +    echo "[ERROR] Screen is not installed. Please install screen to use this utility ." +    exit +fi +rm ./pubnub-console.log +touch ./pubnub-console.log +set PYTHONPATH=../.. +screen -c config | 
