Merge pull request #2093 from davebx/move_scripts

Move scripts out of lib/tool_shed.
This commit is contained in:
John Chilton
2016-04-08 09:54:44 -04:00
22 changed files with 22 additions and 23 deletions
@@ -4,7 +4,7 @@ import sys
import urllib
import urllib2
sys.path.insert(1, os.path.join( os.path.dirname( __file__ ), os.pardir, os.pardir, os.pardir ) )
sys.path.insert( 1, os.path.join( os.path.dirname( __file__ ), os.pardir, os.pardir, os.pardir, 'lib' ) )
from tool_shed.util import hg_util
from galaxy import util
@@ -13,7 +13,7 @@ import sys
import tempfile
import urllib2
sys.path.insert(1, os.path.join( os.path.dirname( __file__ ), os.pardir, os.pardir, os.pardir ) )
sys.path.insert( 1, os.path.join( os.path.dirname( __file__ ), os.pardir, os.pardir, os.pardir, 'lib' ) )
from tool_shed.util import basic_util
from common import display, submit
@@ -23,9 +23,8 @@ Here is a working example of how to use this script.
import argparse
import os
import sys
import urllib
sys.path.insert(1, os.path.join( os.path.dirname( __file__ ), os.pardir, os.pardir, os.pardir ) )
sys.path.insert( 1, os.path.join( os.path.dirname( __file__ ), os.pardir, os.pardir, os.pardir, 'lib' ) )
from galaxy.util import asbool
from tool_shed.util import hg_util
@@ -44,14 +43,14 @@ def main( options ):
test_install_error = str( options.test_install_error )
tools_functionally_correct = str( options.tools_functionally_correct )
parts = [ 'repository_revisions' ]
params = urllib.urlencode( dict( do_not_test=do_not_test,
downloadable=downloadable,
includes_tools=includes_tools,
malicious=malicious,
missing_test_components=missing_test_components,
skip_tool_test=skip_tool_test,
test_install_error=test_install_error,
tools_functionally_correct=tools_functionally_correct ) )
params = dict( do_not_test=do_not_test,
downloadable=downloadable,
includes_tools=includes_tools,
malicious=malicious,
missing_test_components=missing_test_components,
skip_tool_test=skip_tool_test,
test_install_error=test_install_error,
tools_functionally_correct=tools_functionally_correct )
api_url = get_api_url( base=base_tool_shed_url, parts=parts, params=params )
baseline_repository_dicts, error_message = json_from_url( api_url )
if baseline_repository_dicts is None or error_message:
@@ -11,15 +11,15 @@ stop_err() {
exit 1
}
tool_shed=`./lib/tool_shed/scripts/bootstrap_tool_shed/parse_run_sh_args.sh $@`
tool_shed=`./scripts/tool_shed/bootstrap_tool_shed/parse_run_sh_args.sh $@`
if [ $? -ne 0 ] ; then
exit 0
fi
log_file="lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap.log"
log_file="scripts/tool_shed/bootstrap_tool_shed/bootstrap.log"
database_result=`python ./lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap_util.py --execute check_db --config_file ${TOOL_SHED_CONFIG_FILE}`
database_result=`python ./scripts/tool_shed/bootstrap_tool_shed/bootstrap_util.py --execute check_db --config_file ${TOOL_SHED_CONFIG_FILE}`
if [ $? -ne 0 ] ; then
stop_err "Unable to bootstrap tool shed. $database_result"
@@ -36,8 +36,8 @@ else
fi
if [ $? -eq 0 ] ; then
user_auth=`python ./lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap_util.py --execute admin_user_info --config_file ${TOOL_SHED_CONFIG_FILE}`
local_shed_url=`python ./lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap_util.py --execute get_url --config_file ${TOOL_SHED_CONFIG_FILE}`
user_auth=`python ./scripts/tool_shed/bootstrap_tool_shed/bootstrap_util.py --execute admin_user_info --config_file ${TOOL_SHED_CONFIG_FILE}`
local_shed_url=`python ./scripts/tool_shed/bootstrap_tool_shed/bootstrap_util.py --execute get_url --config_file ${TOOL_SHED_CONFIG_FILE}`
fi
admin_user_name=`echo $user_auth | awk 'BEGIN { FS="__SEP__" } ; { print \$1 }'`
@@ -46,7 +46,7 @@ admin_user_password=`echo $user_auth | awk 'BEGIN { FS="__SEP__" } ; { print \$3
echo -n "Creating user '$admin_user_name' with email address '$admin_user_email'..."
python ./lib/tool_shed/scripts/bootstrap_tool_shed/create_user_with_api_key.py -c ${TOOL_SHED_CONFIG_FILE} >> $log_file
python ./scripts/tool_shed/bootstrap_tool_shed/create_user_with_api_key.py -c ${TOOL_SHED_CONFIG_FILE} >> $log_file
echo " done."
@@ -94,10 +94,10 @@ echo " done."
if [ $? -eq 0 ] ; then
echo -n "Creating users... "
python lib/tool_shed/scripts/api/create_users.py -a $api_key -f $tool_shed -t $local_shed_url >> $log_file
python scripts/tool_shed/api/create_users.py -a $api_key -f $tool_shed -t $local_shed_url >> $log_file
echo "done."
echo -n "Creating categories... "
python lib/tool_shed/scripts/api/create_categories.py -a $api_key -f $tool_shed -t $local_shed_url >> $log_file
python scripts/tool_shed/api/create_categories.py -a $api_key -f $tool_shed -t $local_shed_url >> $log_file
echo "done."
else
stop_err "Error getting API key from local tool shed."
@@ -4,7 +4,7 @@ import ConfigParser
import os
import sys
sys.path.insert(1, os.path.join( os.path.dirname( __file__ ), os.pardir, os.pardir, os.pardir ) )
sys.path.insert( 1, os.path.join( os.path.dirname( __file__ ), os.pardir, os.pardir, os.pardir, 'lib' ) )
from sqlalchemy.exc import OperationalError, ProgrammingError
@@ -69,7 +69,7 @@ def check_db( config_parser ):
def admin_user_info( ):
user_info_config = os.path.abspath( os.path.join( os.getcwd(), 'lib/tool_shed/scripts/bootstrap_tool_shed', 'user_info.xml' ) )
user_info_config = os.path.abspath( os.path.join( os.getcwd(), 'scripts/tool_shed/bootstrap_tool_shed', 'user_info.xml' ) )
tree, error_message = xml_util.parse_xml( user_info_config )
username = None
email = None
@@ -7,7 +7,7 @@ import re
import sys
import optparse
sys.path.insert(1, os.path.join( os.path.dirname( __file__ ), os.pardir, os.pardir, os.pardir ) )
sys.path.insert(1, os.path.join( os.path.dirname( __file__ ), os.pardir, os.pardir, os.pardir, 'lib' ) )
sys.path.insert(1, os.path.join( os.path.dirname( __file__ ) ) )
import galaxy.webapps.tool_shed.config as tool_shed_config