| 1 | *** create_plugin_original.py Sat May 26 22:14:29 2012 |
|---|
| 2 | --- create_plugin.py Sat May 26 22:16:36 2012 |
|---|
| 3 | *************** |
|---|
| 4 | *** 9,14 **** |
|---|
| 5 | --- 9,15 ---- |
|---|
| 6 | |
|---|
| 7 | from optparse import OptionParser |
|---|
| 8 | import os |
|---|
| 9 | + import sys |
|---|
| 10 | import deluge.common |
|---|
| 11 | parser = OptionParser() |
|---|
| 12 | parser.add_option("-n", "--name", dest="name",help="plugin name") |
|---|
| 13 | *************** |
|---|
| 14 | *** 51,56 **** |
|---|
| 15 | --- 52,58 ---- |
|---|
| 16 | plugin_base = os.path.realpath(os.path.join(options.path, safe_name)) |
|---|
| 17 | src = os.path.join(plugin_base, safe_name) |
|---|
| 18 | data_dir = os.path.join(src, "data") |
|---|
| 19 | + python_path = sys.executable |
|---|
| 20 | |
|---|
| 21 | if os.path.exists(plugin_base): |
|---|
| 22 | print "the directory %s already exists, delete it first" % plugin_base |
|---|
| 23 | *************** |
|---|
| 24 | *** 63,68 **** |
|---|
| 25 | --- 65,71 ---- |
|---|
| 26 | "safe_name":safe_name, |
|---|
| 27 | "filename":filename, |
|---|
| 28 | "plugin_base":plugin_base, |
|---|
| 29 | + "python_path":python_path, |
|---|
| 30 | "url": options.url, |
|---|
| 31 | "configdir": options.configdir |
|---|
| 32 | } |
|---|
| 33 | *************** |
|---|
| 34 | *** 380,386 **** |
|---|
| 35 | cd %(plugin_base)s |
|---|
| 36 | mkdir temp |
|---|
| 37 | export PYTHONPATH=./temp |
|---|
| 38 | ! python setup.py build develop --install-dir ./temp |
|---|
| 39 | cp ./temp/%(name)s.egg-link %(configdir)s/plugins |
|---|
| 40 | rm -fr ./temp |
|---|
| 41 | """ |
|---|
| 42 | --- 384,390 ---- |
|---|
| 43 | cd %(plugin_base)s |
|---|
| 44 | mkdir temp |
|---|
| 45 | export PYTHONPATH=./temp |
|---|
| 46 | ! %(python_path)s setup.py build develop --install-dir ./temp |
|---|
| 47 | cp ./temp/%(name)s.egg-link %(configdir)s/plugins |
|---|
| 48 | rm -fr ./temp |
|---|
| 49 | """ |
|---|