From d703c34d918a75a4d5a984143c8fbd5049931b1a Mon Sep 17 00:00:00 2001 From: Devendra Date: Tue, 29 Apr 2014 03:11:45 +0530 Subject: adding start console script and helper files --- python/examples/start-console.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 python/examples/start-console.sh (limited to 'python/examples/start-console.sh') 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 -- cgit v1.2.3 From 8395a9a3922e345608aa1e49b4aa27b9d5927a0d Mon Sep 17 00:00:00 2001 From: Devendra Date: Wed, 30 Apr 2014 00:43:56 +0530 Subject: making tweaks to run on osx --- python/examples/start-console.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'python/examples/start-console.sh') diff --git a/python/examples/start-console.sh b/python/examples/start-console.sh index df4fd6e..e842427 100644 --- a/python/examples/start-console.sh +++ b/python/examples/start-console.sh @@ -1,3 +1,4 @@ +#!/bin/bash if ! type "screen" > /dev/null; then echo "[ERROR] Screen is not installed. Please install screen to use this utility ." exit @@ -5,4 +6,11 @@ fi rm ./pubnub-console.log touch ./pubnub-console.log set PYTHONPATH=../.. -screen -c config +screen -X -S pubnub-console quit 2>&1 > /dev/null +OS="`uname`" +case $OS in + 'darwin') + screen -c config_osx + ;; + *) screen -c config;; +esac -- cgit v1.2.3 From e2ccbc05b6ed2696dd8d2d2134b2023c528e1b70 Mon Sep 17 00:00:00 2001 From: Devendra Date: Wed, 30 Apr 2014 00:59:26 +0530 Subject: fixing start script for osx --- python/examples/start-console.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'python/examples/start-console.sh') diff --git a/python/examples/start-console.sh b/python/examples/start-console.sh index e842427..2df3f77 100644 --- a/python/examples/start-console.sh +++ b/python/examples/start-console.sh @@ -9,8 +9,8 @@ set PYTHONPATH=../.. screen -X -S pubnub-console quit 2>&1 > /dev/null OS="`uname`" case $OS in - 'darwin') + [dD]'arwin') screen -c config_osx ;; - *) screen -c config;; + *) screen -c config ;; esac -- cgit v1.2.3 From 57d27fe29751f9cbd14a26d2a4ee8402168bfe8b Mon Sep 17 00:00:00 2001 From: Devendra Date: Fri, 2 May 2014 23:14:10 +0530 Subject: fixing start-console.sh --- python/examples/start-console.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python/examples/start-console.sh') diff --git a/python/examples/start-console.sh b/python/examples/start-console.sh index 2df3f77..128a20e 100644 --- a/python/examples/start-console.sh +++ b/python/examples/start-console.sh @@ -5,7 +5,7 @@ if ! type "screen" > /dev/null; then fi rm ./pubnub-console.log touch ./pubnub-console.log -set PYTHONPATH=../.. +export PYTHONPATH=../.. screen -X -S pubnub-console quit 2>&1 > /dev/null OS="`uname`" case $OS in -- cgit v1.2.3 From fc9ef45293540a2a5ff8f6dde5481442f4349f0c Mon Sep 17 00:00:00 2001 From: Devendra Date: Sat, 3 May 2014 00:23:55 +0530 Subject: adding virtualenv creation and installation of dependencies to start-console --- python/examples/start-console.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) mode change 100644 => 100755 python/examples/start-console.sh (limited to 'python/examples/start-console.sh') diff --git a/python/examples/start-console.sh b/python/examples/start-console.sh old mode 100644 new mode 100755 index 128a20e..a928cb3 --- a/python/examples/start-console.sh +++ b/python/examples/start-console.sh @@ -1,4 +1,26 @@ #!/bin/bash + +#!/bin/bash -e + +BASEDIR=. + +if [ ! -d "$BASEDIR/ve" ]; then + virtualenv -q $BASEDIR/ve --no-site-packages + $BASEDIR/ve/bin/activate + echo "Virtualenv created." +fi + +chmod 755 $BASEDIR/ve/bin/activate +$BASEDIR/ve/bin/activate + +if [ ! -f "$BASEDIR/ve/updated" -o $BASEDIR/requirements.pip -nt $BASEDIR/ve/updated ]; then + pip install -r $BASEDIR/requirements.pip -E $BASEDIR/ve + touch $BASEDIR/ve/updated + echo "Requirements installed." +fi + + + if ! type "screen" > /dev/null; then echo "[ERROR] Screen is not installed. Please install screen to use this utility ." exit -- cgit v1.2.3