Ticket #832: create_plugin.py.patch
File create_plugin.py.patch, 1.6 KB (added by Ghent, 15 years ago) |
---|
-
create_plugin.py
9 9 10 10 from optparse import OptionParser 11 11 import os 12 import deluge.common 12 13 parser = OptionParser() 13 14 parser.add_option("-n", "--name", dest="name",help="plugin name") 14 15 parser.add_option("-p", "--basepath", dest="path",help="base path") 15 16 parser.add_option("-a", "--author-name", dest="author_name",help="author name,for the GPL header") 16 17 parser.add_option("-e", "--author-email", dest="author_email",help="author email,for the GPL header") 17 18 parser.add_option("-u", "--url", dest="url", help="Homepage URL") 19 parser.add_option("-c", "--config", dest="configdir", help="location of deluge configuration") 18 20 19 21 20 22 (options, args) = parser.parse_args() … … 41 43 print "basepath does not exist" 42 44 return 43 45 46 if not options.configdir: 47 options.configdir = deluge.common.get_default_config_dir() 48 44 49 name = options.name.replace(" ", "_") 45 50 safe_name = name.lower() 46 51 plugin_base = os.path.realpath(os.path.join(options.path, name)) … … 58 63 "safe_name":safe_name, 59 64 "filename":filename, 60 65 "plugin_base":plugin_base, 61 "url": options.url 66 "url": options.url, 67 "configdir": options.configdir 62 68 } 63 69 64 70 filename = os.path.join(path, filename) … … 307 313 mkdir temp 308 314 export PYTHONPATH=./temp 309 315 python setup.py build develop --install-dir ./temp 310 cp ./temp/%(name)s.egg-link ~/.config/deluge/plugins316 cp ./temp/%(name)s.egg-link %(configdir)s/plugins 311 317 rm -fr ./temp 312 318 """ 313 319