Module: deluge
Branch: chunked-sessionproxy-and-gtkui-speedups
Commit: 4c3d068f0c32717cd344322aefe66e56825fe28b

Author: Pedro Algarvio <[email protected]>
Date:   Fri Dec 10 04:08:36 2010 +0000

Improve `create_plugin.py` and the generated `create_dev_link.sh`.

---

 deluge/plugins/FreeSpace/create_dev_link.sh     |   16 ++++++++++------
 deluge/plugins/notifications/create_dev_link.sh |   16 ++++++++++------
 deluge/plugins/stats/create_dev_link.sh         |   15 ++++++++++-----
 deluge/plugins/webui/create_dev_link.sh         |   16 ++++++++++------
 deluge/scripts/create_plugin.py                 |    5 ++++-
 5 files changed, 44 insertions(+), 24 deletions(-)

diff --git a/deluge/plugins/FreeSpace/create_dev_link.sh 
b/deluge/plugins/FreeSpace/create_dev_link.sh
index be73dca..5e04057 100755
--- a/deluge/plugins/FreeSpace/create_dev_link.sh
+++ b/deluge/plugins/FreeSpace/create_dev_link.sh
@@ -1,7 +1,11 @@
 #!/bin/bash
-cd /home/vampas/projects/DelugeNotify/deluge/plugins/freespace
-mkdir temp
-export PYTHONPATH=./temp
-python setup.py build develop --install-dir ./temp
-cp ./temp/FreeSpace.egg-link .config/plugins
-rm -fr ./temp
+BASEDIR=$(cd `dirname $0` && pwd)
+CONFIG_DIR=$( test -z $1 && echo "" || echo "$1")
+[ -d "$CONFIG_DIR/plugins" ] || echo "Config dir "$CONFIG_DIR" is either not a 
directory or is not a proper deluge config directory. Exiting"
+[ -d "$CONFIG_DIR/plugins" ] || exit 1
+cd $BASEDIR
+test -d $BASEDIR/temp || mkdir $BASEDIR/temp
+export PYTHONPATH=$BASEDIR/temp
+python setup.py build develop --install-dir $BASEDIR/temp
+cp $BASEDIR/temp/*.egg-link $CONFIG_DIR/plugins
+rm -fr $BASEDIR/temp
diff --git a/deluge/plugins/notifications/create_dev_link.sh 
b/deluge/plugins/notifications/create_dev_link.sh
index fddef34..5e04057 100755
--- a/deluge/plugins/notifications/create_dev_link.sh
+++ b/deluge/plugins/notifications/create_dev_link.sh
@@ -1,7 +1,11 @@
 #!/bin/bash
-cd /home/vampas/projects/DelugeNotify/deluge/plugins/notifications
-mkdir temp
-export PYTHONPATH=./temp
-python setup.py build develop --install-dir ./temp
-cp ./temp/Notifications.egg-link .config//plugins
-rm -fr ./temp
+BASEDIR=$(cd `dirname $0` && pwd)
+CONFIG_DIR=$( test -z $1 && echo "" || echo "$1")
+[ -d "$CONFIG_DIR/plugins" ] || echo "Config dir "$CONFIG_DIR" is either not a 
directory or is not a proper deluge config directory. Exiting"
+[ -d "$CONFIG_DIR/plugins" ] || exit 1
+cd $BASEDIR
+test -d $BASEDIR/temp || mkdir $BASEDIR/temp
+export PYTHONPATH=$BASEDIR/temp
+python setup.py build develop --install-dir $BASEDIR/temp
+cp $BASEDIR/temp/*.egg-link $CONFIG_DIR/plugins
+rm -fr $BASEDIR/temp
diff --git a/deluge/plugins/stats/create_dev_link.sh 
b/deluge/plugins/stats/create_dev_link.sh
index 35e5c2a..5e04057 100755
--- a/deluge/plugins/stats/create_dev_link.sh
+++ b/deluge/plugins/stats/create_dev_link.sh
@@ -1,6 +1,11 @@
 #!/bin/bash
-mkdir temp
-export PYTHONPATH=./temp
-python setup.py develop --install-dir ./temp
-cp ./temp/Stats.egg-link ~/.config/deluge/plugins
-rm -fr ./temp
+BASEDIR=$(cd `dirname $0` && pwd)
+CONFIG_DIR=$( test -z $1 && echo "" || echo "$1")
+[ -d "$CONFIG_DIR/plugins" ] || echo "Config dir "$CONFIG_DIR" is either not a 
directory or is not a proper deluge config directory. Exiting"
+[ -d "$CONFIG_DIR/plugins" ] || exit 1
+cd $BASEDIR
+test -d $BASEDIR/temp || mkdir $BASEDIR/temp
+export PYTHONPATH=$BASEDIR/temp
+python setup.py build develop --install-dir $BASEDIR/temp
+cp $BASEDIR/temp/*.egg-link $CONFIG_DIR/plugins
+rm -fr $BASEDIR/temp
diff --git a/deluge/plugins/webui/create_dev_link.sh 
b/deluge/plugins/webui/create_dev_link.sh
index 6d3af26..f4d60d2 100755
--- a/deluge/plugins/webui/create_dev_link.sh
+++ b/deluge/plugins/webui/create_dev_link.sh
@@ -1,7 +1,11 @@
 #!/bin/bash
-cd /home/damien/Projects/deluge/deluge/plugins/webui
-mkdir temp
-export PYTHONPATH=./temp
-python setup.py build develop --install-dir ./temp
-cp ./temp/WebUi.egg-link /home/damien/.config/deluge/plugins
-rm -fr ./temp
+BASEDIR=$(cd `dirname $0` && pwd)
+CONFIG_DIR=$( test -z $1 && echo "/home/damien/.config/deluge/" || echo "$1")
+[ -d "$CONFIG_DIR/plugins" ] || echo "Config dir "$CONFIG_DIR" is either not a 
directory or is not a proper deluge config directory. Exiting"
+[ -d "$CONFIG_DIR/plugins" ] || exit 1
+cd $BASEDIR
+test -d $BASEDIR/temp || mkdir $BASEDIR/temp
+export PYTHONPATH=$BASEDIR/temp
+python setup.py build develop --install-dir $BASEDIR/temp
+cp $BASEDIR/temp/*.egg-link $CONFIG_DIR/plugins
+rm -fr $BASEDIR/temp
diff --git a/deluge/scripts/create_plugin.py b/deluge/scripts/create_plugin.py
index 0087c33..7c6006f 100644
--- a/deluge/scripts/create_plugin.py
+++ b/deluge/scripts/create_plugin.py
@@ -398,11 +398,14 @@ pkg_resources.declare_namespace(__name__)
 
 CREATE_DEV_LINK = """#!/bin/bash
 BASEDIR=$(cd `dirname $0` && pwd)
+CONFIG_DIR=$( test -z $1 && echo "%(configdir)s" || echo "$1")
+[ -d "$CONFIG_DIR/plugins" ] || echo "Config dir \"$CONFIG_DIR\" is either not 
a directory or is not a proper deluge config directory. Exiting"
+[ -d "$CONFIG_DIR/plugins" ] || exit 1
 cd $BASEDIR
 test -d $BASEDIR/temp || mkdir $BASEDIR/temp
 export PYTHONPATH=$BASEDIR/temp
 python setup.py build develop --install-dir $BASEDIR/temp
-cp $BASEDIR/temp/*.egg-link %(configdir)s/plugins
+cp $BASEDIR/temp/*.egg-link $CONFIG_DIR/plugins
 rm -fr $BASEDIR/temp
 """
 

-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to