Fix 2107 : create_plugin.py call correct version of python
This commit is contained in:
parent
b67bae31ba
commit
e43e4e2ee0
|
@ -10,6 +10,7 @@ python create_plugin.py --name MyPlugin2 --basepath . --author-name "Your Name"
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import deluge.common
|
import deluge.common
|
||||||
parser = OptionParser()
|
parser = OptionParser()
|
||||||
parser.add_option("-n", "--name", dest="name",help="plugin name")
|
parser.add_option("-n", "--name", dest="name",help="plugin name")
|
||||||
|
@ -60,6 +61,7 @@ def create_plugin():
|
||||||
plugins_namespace = os.path.join(deluge_namespace, "plugins")
|
plugins_namespace = os.path.join(deluge_namespace, "plugins")
|
||||||
src = os.path.join(plugins_namespace, safe_name)
|
src = os.path.join(plugins_namespace, safe_name)
|
||||||
data_dir = os.path.join(src, "data")
|
data_dir = os.path.join(src, "data")
|
||||||
|
python_path = sys.executable
|
||||||
|
|
||||||
if os.path.exists(plugin_base):
|
if os.path.exists(plugin_base):
|
||||||
print "the directory %s already exists, delete it first" % plugin_base
|
print "the directory %s already exists, delete it first" % plugin_base
|
||||||
|
@ -73,6 +75,7 @@ def create_plugin():
|
||||||
"safe_name": safe_name,
|
"safe_name": safe_name,
|
||||||
"filename": filename,
|
"filename": filename,
|
||||||
"plugin_base": plugin_base,
|
"plugin_base": plugin_base,
|
||||||
|
"python_path": python_path,
|
||||||
"url": options.url,
|
"url": options.url,
|
||||||
"configdir": options.configdir,
|
"configdir": options.configdir,
|
||||||
"current_year": datetime.utcnow().year
|
"current_year": datetime.utcnow().year
|
||||||
|
@ -414,7 +417,7 @@ CONFIG_DIR=$( test -z $1 && echo "%(configdir)s" || echo "$1")
|
||||||
cd $BASEDIR
|
cd $BASEDIR
|
||||||
test -d $BASEDIR/temp || mkdir $BASEDIR/temp
|
test -d $BASEDIR/temp || mkdir $BASEDIR/temp
|
||||||
export PYTHONPATH=$BASEDIR/temp
|
export PYTHONPATH=$BASEDIR/temp
|
||||||
python setup.py build develop --install-dir $BASEDIR/temp
|
%(python_path)s setup.py build develop --install-dir $BASEDIR/temp
|
||||||
cp $BASEDIR/temp/*.egg-link $CONFIG_DIR/plugins
|
cp $BASEDIR/temp/*.egg-link $CONFIG_DIR/plugins
|
||||||
rm -fr $BASEDIR/temp
|
rm -fr $BASEDIR/temp
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue