From fe002092bf87300548862f5ec737e990a8a01980 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Fri, 6 Mar 2009 17:18:48 +0000 Subject: [PATCH] apply Ghents patch to allow for specifying your deluge config dir whilst creating a plugin --- deluge/scripts/create_plugin.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/deluge/scripts/create_plugin.py b/deluge/scripts/create_plugin.py index 47985eca4..dd2bedc9d 100644 --- a/deluge/scripts/create_plugin.py +++ b/deluge/scripts/create_plugin.py @@ -9,12 +9,14 @@ python create_plugin.py --name MyPlugin2 --basepath . --author-name "Your Name" from optparse import OptionParser import os +import deluge.common parser = OptionParser() parser.add_option("-n", "--name", dest="name",help="plugin name") parser.add_option("-p", "--basepath", dest="path",help="base path") parser.add_option("-a", "--author-name", dest="author_name",help="author name,for the GPL header") parser.add_option("-e", "--author-email", dest="author_email",help="author email,for the GPL header") parser.add_option("-u", "--url", dest="url", help="Homepage URL") +parser.add_option("-c", "--config", dest="configdir", help="location of deluge configuration") (options, args) = parser.parse_args() @@ -41,6 +43,9 @@ def create_plugin(): print "basepath does not exist" return + if not options.configdir: + options.configdir = deluge.common.get_default_config_dir() + name = options.name.replace(" ", "_") safe_name = name.lower() plugin_base = os.path.realpath(os.path.join(options.path, name)) @@ -58,7 +63,8 @@ def create_plugin(): "safe_name":safe_name, "filename":filename, "plugin_base":plugin_base, - "url": options.url + "url": options.url, + "configdir": options.configdir } filename = os.path.join(path, filename) @@ -307,7 +313,7 @@ cd %(plugin_base)s mkdir temp export PYTHONPATH=./temp python setup.py build develop --install-dir ./temp -cp ./temp/%(name)s.egg-link ~/.config/deluge/plugins +cp ./temp/%(name)s.egg-link %(configdir)s/plugins rm -fr ./temp """