diff options
author | Damien Churchill <damoc@gmail.com> | 2009-03-06 17:18:48 +0000 |
---|---|---|
committer | Damien Churchill <damoc@gmail.com> | 2009-03-06 17:18:48 +0000 |
commit | f2a3ebf4864a013a34f8828f723cad0ccc1d84d8 (patch) | |
tree | 36aa7af1bac25e2c69a1771d6b7b305857ffe265 | |
parent | ffcb1643b998a7b48af007588bc23a4d6b08e118 (diff) | |
download | deluge-f2a3ebf4864a013a34f8828f723cad0ccc1d84d8.tar.gz deluge-f2a3ebf4864a013a34f8828f723cad0ccc1d84d8.tar.bz2 deluge-f2a3ebf4864a013a34f8828f723cad0ccc1d84d8.zip |
apply Ghents patch to allow for specifying your deluge config dir whilst
creating a plugin
-rw-r--r-- | deluge/scripts/create_plugin.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/deluge/scripts/create_plugin.py b/deluge/scripts/create_plugin.py index d2999b5be..dac6c02ae 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) @@ -350,7 +356,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 """ |