galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
May 2014
- 1 participants
- 242 discussions
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/cbd0a239259b/
Changeset: cbd0a239259b
Branch: next-stable
User: davebgx
Date: 2014-05-23 16:00:33
Summary: Fix server error when registering a new account.
Affected #: 1 file
diff -r 2b0cdcea282b2ea92b649df9a5d63f40b2bd545f -r cbd0a239259b694afadfc62bdde820eef0c30b4f lib/galaxy/webapps/galaxy/controllers/user.py
--- a/lib/galaxy/webapps/galaxy/controllers/user.py
+++ b/lib/galaxy/webapps/galaxy/controllers/user.py
@@ -1144,9 +1144,9 @@
return "A public user name is required in the tool shed."
if username in [ 'repos' ]:
return "The term <b>%s</b> is a reserved word in the tool shed, so it cannot be used as a public user name." % username
- message = "\n".join(validate_email( trans, email ),
- validate_password( trans, password, confirm ),
- validate_publicname( trans, username ))
+ message = "\n".join( [ validate_email( trans, email ),
+ validate_password( trans, password, confirm ),
+ validate_publicname( trans, username ) ] ).rstrip()
if not message:
if trans.webapp.name == 'galaxy':
if self.get_all_forms( trans,
https://bitbucket.org/galaxy/galaxy-central/commits/89bdb65761f6/
Changeset: 89bdb65761f6
User: davebgx
Date: 2014-05-23 16:01:07
Summary: Merge with next-stable.
Affected #: 1 file
diff -r af76f0273d3de8ccc38f78dfb0aae9974574aa7b -r 89bdb65761f631921d3a21cfd2335103715de5bb lib/galaxy/webapps/galaxy/controllers/user.py
--- a/lib/galaxy/webapps/galaxy/controllers/user.py
+++ b/lib/galaxy/webapps/galaxy/controllers/user.py
@@ -1144,9 +1144,9 @@
return "A public user name is required in the tool shed."
if username in [ 'repos' ]:
return "The term <b>%s</b> is a reserved word in the tool shed, so it cannot be used as a public user name." % username
- message = "\n".join(validate_email( trans, email ),
- validate_password( trans, password, confirm ),
- validate_publicname( trans, username ))
+ message = "\n".join( [ validate_email( trans, email ),
+ validate_password( trans, password, confirm ),
+ validate_publicname( trans, username ) ] ).rstrip()
if not message:
if trans.webapp.name == 'galaxy':
if self.get_all_forms( trans,
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: Charts: Allow chart groups to have different number of rows
by commits-noreply@bitbucket.org 22 May '14
by commits-noreply@bitbucket.org 22 May '14
22 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/47810c6ec62c/
Changeset: 47810c6ec62c
User: guerler
Date: 2014-05-22 23:16:52
Summary: Charts: Allow chart groups to have different number of rows
Affected #: 1 file
diff -r e959799971fc33d0490973c6b28673049d8ece61 -r 47810c6ec62c258423ea4527cf3214326a9b417b config/plugins/visualizations/charts/static/library/datasets.js
--- a/config/plugins/visualizations/charts/static/library/datasets.js
+++ b/config/plugins/visualizations/charts/static/library/datasets.js
@@ -142,16 +142,25 @@
// log
console.debug('Datasets::_fill_from_cache() - Filling request from cache.');
- // get dataset
- var dataset = this.list[request_dictionary.id];
- if (!dataset) {
- console.debug('FAILED - Datasets::_fill_from_cache() - Dataset not found.');
+ // identify start of request
+ var start = request_dictionary.start;
+
+ // identify end of request
+ var limit = 0;
+ for (var i in request_dictionary.groups) {
+ var group = request_dictionary.groups[i];
+ for (var key in group.columns) {
+ var column = group.columns[key];
+ var block_id = this._block_id(request_dictionary, column.index);
+ var column_data = this.cache[block_id];
+ if (column_data) {
+ limit = Math.max(limit, column_data.length);
+ }
+ }
}
- // identify start/end of request
- var start = request_dictionary.start;
- var end = Math.min(request_dictionary.end, dataset.metadata_data_lines);
- if (end - start <= 0) {
+ // check length
+ if (limit == 0) {
console.debug('FAILED - Datasets::_fill_from_cache() - Invalid range.');
}
@@ -164,7 +173,7 @@
group.values = [];
// add values
- for (var j = 0; j < end - start; j++) {
+ for (var j = 0; j < limit; j++) {
// add default x values
group.values[j] = {
x : parseInt(j) + start
@@ -184,7 +193,7 @@
// check if auto block is requested
if (column.index == 'auto') {
- for (var j = start; j < end; j++) {
+ for (var j = 0; j < limit; j++) {
// get value dictionary
var value = group.values[j];
@@ -197,7 +206,7 @@
var column_data = this.cache[block_id];
// go through column
- for (var j = start; j < end; j++) {
+ for (var j = 0; j < limit; j++) {
// get value dictionary
var value = group.values[j];
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/1830e34c80c0/
Changeset: 1830e34c80c0
Branch: next-stable
User: davebgx
Date: 2014-05-22 16:59:18
Summary: Enable running the create_users and create_categories scripts via run_tool_shed.sh
Affected #: 7 files
diff -r f0a5e3666e844d907e7ef3c7fc4e23a443ba65d1 -r 1830e34c80c086696f83383871b6027f3b44ea8b lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap_tool_shed.sh
--- /dev/null
+++ b/lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap_tool_shed.sh
@@ -0,0 +1,100 @@
+#!/bin/bash
+
+stop_err() {
+ echo $1
+ python ./scripts/paster.py serve tool_shed_wsgi.ini --pid-file=tool_shed_bootstrap.pid --log-file=tool_shed_bootstrap.log --stop-daemon
+ exit 1
+}
+
+tool_shed=`./lib/tool_shed/scripts/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"
+
+database_result=`python ./lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap_util.py --execute check_db --config_file tool_shed_wsgi.ini`
+
+if [ $? -ne 0 ] ; then
+ stop_err "Unable to bootstrap tool shed. $database_result"
+fi
+
+echo "Bootstrapping from tool shed at $tool_shed."
+echo -n "Creating database... "
+python scripts/create_db.py tool_shed
+
+if [ $? -eq 0 ] ; then
+ echo "done."
+else
+ stop_err "failed."
+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_wsgi.ini`
+ local_shed_url=`python ./lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap_util.py --execute get_url --config_file tool_shed_wsgi.ini`
+fi
+
+admin_user_name=`echo $user_auth | awk 'BEGIN { FS="__SEP__" } ; { print \$1 }'`
+admin_user_email=`echo $user_auth | awk 'BEGIN { FS="__SEP__" } ; { print \$2 }'`
+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 tool_shed_wsgi.ini >> $log_file
+
+echo " done."
+
+sed -i "s/#admin_users = user1@example.org,user2@example.org/admin_users = $admin_user_email/" tool_shed_wsgi.ini
+echo -n "Starting tool shed in order to populate users and categories... "
+
+if [ -f tool_shed_bootstrap.pid ] ; then
+ stop_err "A bootstrap process is already running."
+fi
+
+python ./scripts/paster.py serve tool_shed_wsgi.ini --pid-file=tool_shed_bootstrap.pid --log-file=tool_shed_bootstrap.log --daemon > /dev/null
+
+shed_pid=`cat tool_shed_bootstrap.pid`
+
+while : ; do
+ tail -n 1 tool_shed_bootstrap.log | grep -q "Removing PID file tool_shed_webapp.pid"
+ if [ $? -eq 0 ] ; then
+ echo "failed."
+ echo "More information about this failure may be found in the following log snippet from tool_shed_bootstrap.log:"
+ echo "========================================"
+ tail -n 40 tool_shed_bootstrap.log
+ echo "========================================"
+ stop_err " "
+ fi
+ tail -n 2 tool_shed_bootstrap.log | grep -q "Starting server in PID $shed_pid"
+ if [ $? -eq 0 ] ; then
+ echo "done."
+ break
+ fi
+done
+
+echo -n "Retrieving admin user's API key..."
+api_key_json=`curl -s --user $admin_user_email:$admin_user_password $local_shed_url/api/authenticate/baseauth/`
+api_key=`echo $api_key_json | grep api_key | awk 'BEGIN { FS="\"" } ; { print \$4 }' | sed 's/\\s\+//'`
+
+if [[ -z $api_key && ${api_key+x} ]] ; then
+ stop_err "Error getting API key for user $admin_user_email."
+fi
+
+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
+ 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
+ echo "done."
+else
+ stop_err "Error getting API key from local tool shed."
+fi
+
+echo "Bootstrap complete, shutting down temporary tool shed process. A log has been saved to tool_shed_bootstrap.log"
+python ./scripts/paster.py serve tool_shed_wsgi.ini --pid-file=tool_shed_bootstrap.pid --log-file=tool_shed_bootstrap.log --stop-daemon
+
+exit 0
\ No newline at end of file
diff -r f0a5e3666e844d907e7ef3c7fc4e23a443ba65d1 -r 1830e34c80c086696f83383871b6027f3b44ea8b lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap_util.py
--- /dev/null
+++ b/lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap_util.py
@@ -0,0 +1,130 @@
+#!/usr/bin/python
+import argparse
+import ConfigParser
+import os
+import sys
+
+new_path = [ os.path.join( os.getcwd(), "lib" ) ]
+new_path.extend( sys.path[1:] )
+sys.path = new_path
+
+from galaxy import eggs
+eggs.require( "SQLAlchemy >= 0.4" )
+import galaxy.webapps.tool_shed.model.mapping as tool_shed_model
+from sqlalchemy.exc import ProgrammingError
+from sqlalchemy.exc import OperationalError
+
+from tool_shed.util import xml_util
+
+def check_db( config_parser ):
+ dburi = None
+
+ if config_parser.has_option( 'app:main', 'database_connection' ):
+ dburi = config_parser.get( 'app:main', 'database_connection' )
+ elif config_parser.has_option( 'app:main', 'database_file' ):
+ db_file = config_parser.get( 'app:main', 'database_file' )
+ dburi = "sqlite:///%s?isolation_level=IMMEDIATE" % db_file
+ else:
+ print 'The database configuration setting is missing from the tool_shed_wsgi.ini file. Add this setting before attempting to bootstrap.'
+ exit(1)
+
+ sa_session = None
+
+ database_exists_message = 'The database configured for this Tool Shed is not new, so bootstrapping is not allowed. '
+ database_exists_message += 'Create a new database that has not been migrated before attempting to bootstrap.'
+
+ try:
+ model = tool_shed_model.init( config_parser.get( 'app:main', 'file_path' ), dburi, engine_options={}, create_tables=False )
+ sa_session = model.context.current
+ print database_exists_message
+ exit(1)
+ except ProgrammingError, e:
+ pass
+ except OperationalError, e:
+ pass
+
+ try:
+ if sa_session is not None:
+ result = sa_session.execute( 'SELECT version FROM migrate_version' ).first()
+ if result[0] >= 2:
+ print database_exists_message
+ exit(1)
+ else:
+ pass
+ except ProgrammingError, e:
+ pass
+
+ if config_parser.has_option( 'app:main', 'hgweb_config_dir' ):
+ hgweb_config_parser = ConfigParser.ConfigParser()
+ hgweb_dir = config_parser.get( 'app:main', 'hgweb_config_dir' )
+ hgweb_config_file = os.path.join( hgweb_dir, 'hgweb.config' )
+ if not os.path.exists( hgweb_config_file ):
+ exit(0)
+ hgweb_config_parser.read( hgweb_config_file )
+ configured_repos = hgweb_config_parser.items( 'paths' )
+ if len( configured_repos ) >= 1:
+ message = "This Tool Shed's hgweb.config file contains entries, so bootstrapping is not allowed. Delete"
+ message += " the current hgweb.config file along with all associated repositories in the configured "
+ message += "location before attempting to boostrap."
+ print
+ exit(1)
+ else:
+ exit(0)
+ else:
+ exit(0)
+
+ exit(0)
+
+def admin_user_info( config_parser ):
+ user_info_config = os.path.abspath( os.path.join( os.getcwd(), 'lib/tool_shed/scripts/bootstrap_tool_shed', 'user_info.xml' ) )
+ tree, error_message = xml_util.parse_xml( user_info_config )
+ if tree is None:
+ print "The XML file ", user_info_config, " seems to be invalid, using defaults."
+ email = 'admin(a)test.org'
+ password = 'testuser'
+ username = 'admin'
+ else:
+ root = tree.getroot()
+ for elem in root:
+ if elem.tag == 'email':
+ email = elem.text
+ elif elem.tag == 'password':
+ password = elem.text
+ elif elem.tag == 'username':
+ username = elem.text
+ print '%s__SEP__%s__SEP__%s' % ( username, email, password )
+ return 0
+
+def get_local_tool_shed_url( config_parser ):
+ port = '9009'
+ if config_parser.has_section( 'server:main' ):
+ if config_parser.has_option( 'server:main', 'port' ):
+ port = config_parser.get( 'server:main', 'port' )
+ host = '127.0.0.1'
+ print 'http://%s:%s' % ( host, port )
+ return 0
+
+def main( args ):
+ config_parser = ConfigParser.ConfigParser()
+
+ if os.path.exists( args.config ):
+ config_parser.read( args.config )
+ else:
+ return 1
+
+ if args.method == 'check_db':
+ return check_db( config_parser )
+ elif args.method == 'admin_user_info':
+ return admin_user_info( config_parser )
+ elif args.method == 'get_url':
+ return get_local_tool_shed_url( config_parser )
+ else:
+ return 1
+
+parser = argparse.ArgumentParser()
+parser.add_argument( '-c', '--config_file', dest='config', action='store', default='tool_shed_wsgi.ini' )
+parser.add_argument( '-e', '--execute', dest='method', action='store', default='check_db' )
+args = parser.parse_args()
+
+if __name__ == '__main__':
+ exit( main( args ) )
\ No newline at end of file
diff -r f0a5e3666e844d907e7ef3c7fc4e23a443ba65d1 -r 1830e34c80c086696f83383871b6027f3b44ea8b lib/tool_shed/scripts/bootstrap_tool_shed/create_user_with_api_key.py
--- a/lib/tool_shed/scripts/bootstrap_tool_shed/create_user_with_api_key.py
+++ b/lib/tool_shed/scripts/bootstrap_tool_shed/create_user_with_api_key.py
@@ -125,7 +125,7 @@
return ''
def validate_publicname( username ):
- """""Validates the public username."""
+ """Validates the public username."""
if len( username ) < 3:
return "Public name must be at least 3 characters in length"
if len( username ) > 255:
@@ -154,5 +154,7 @@
if user is not None:
api_key = create_api_key( app, user )
print "Created new user with public username '", user.username, ". An API key was also created and associated with the user."
+ exit(0)
else:
print "Problem creating a new user and an associated API key."
+ exit(1)
diff -r f0a5e3666e844d907e7ef3c7fc4e23a443ba65d1 -r 1830e34c80c086696f83383871b6027f3b44ea8b lib/tool_shed/scripts/bootstrap_tool_shed/parse_run_sh_args.sh
--- /dev/null
+++ b/lib/tool_shed/scripts/bootstrap_tool_shed/parse_run_sh_args.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+while (( $# )) ; do
+ case "$1" in
+ -bootstrap_from_tool_shed|--bootstrap_from_tool_shed)
+ bootstrap="true"
+ tool_shed=$2
+ echo $tool_shed
+ exit 0
+ break
+ ;;
+ esac
+ shift 1
+done
+exit 1
\ No newline at end of file
diff -r f0a5e3666e844d907e7ef3c7fc4e23a443ba65d1 -r 1830e34c80c086696f83383871b6027f3b44ea8b run.sh
--- a/run.sh
+++ b/run.sh
@@ -5,41 +5,7 @@
python ./scripts/check_python.py
[ $? -ne 0 ] && exit 1
-SAMPLES="
- community_wsgi.ini.sample
- datatypes_conf.xml.sample
- external_service_types_conf.xml.sample
- migrated_tools_conf.xml.sample
- reports_wsgi.ini.sample
- shed_tool_conf.xml.sample
- tool_conf.xml.sample
- shed_tool_data_table_conf.xml.sample
- tool_data_table_conf.xml.sample
- tool_sheds_conf.xml.sample
- data_manager_conf.xml.sample
- shed_data_manager_conf.xml.sample
- openid_conf.xml.sample
- job_metrics_conf.xml.sample
- universe_wsgi.ini.sample
- tool-data/shared/ncbi/builds.txt.sample
- tool-data/shared/ensembl/builds.txt.sample
- tool-data/shared/ucsc/builds.txt.sample
- tool-data/shared/ucsc/publicbuilds.txt.sample
- tool-data/shared/ucsc/ucsc_build_sites.txt.sample
- tool-data/shared/igv/igv_build_sites.txt.sample
- tool-data/shared/rviewer/rviewer_build_sites.txt.sample
- tool-data/*.sample
- static/welcome.html.sample
-"
-
-# Create any missing config/location files
-for sample in $SAMPLES; do
- file=`echo $sample | sed -e 's/\.sample$//'`
- if [ ! -f "$file" -a -f "$sample" ]; then
- echo "Initializing $file from `basename $sample`"
- cp $sample $file
- fi
-done
+./scripts/copy_sample_files.sh
if [ -n "$GALAXY_UNIVERSE_CONFIG_DIR" ]; then
python ./scripts/build_universe_config.py "$GALAXY_UNIVERSE_CONFIG_DIR"
diff -r f0a5e3666e844d907e7ef3c7fc4e23a443ba65d1 -r 1830e34c80c086696f83383871b6027f3b44ea8b run_tool_shed.sh
--- a/run_tool_shed.sh
+++ b/run_tool_shed.sh
@@ -2,37 +2,14 @@
cd `dirname $0`
-SAMPLES="
- tool_shed_wsgi.ini.sample
- datatypes_conf.xml.sample
- external_service_types_conf.xml.sample
- migrated_tools_conf.xml.sample
- reports_wsgi.ini.sample
- shed_tool_conf.xml.sample
- tool_conf.xml.sample
- shed_tool_data_table_conf.xml.sample
- tool_data_table_conf.xml.sample
- tool_sheds_conf.xml.sample
- openid_conf.xml.sample
- universe_wsgi.ini.sample
- lib/tool_shed/scripts/bootstrap_tool_shed/user_info.xml.sample
- tool-data/shared/ncbi/builds.txt.sample
- tool-data/shared/ensembl/builds.txt.sample
- tool-data/shared/ucsc/builds.txt.sample
- tool-data/shared/ucsc/publicbuilds.txt.sample
- tool-data/shared/igv/igv_build_sites.txt.sample
- tool-data/shared/rviewer/rviewer_build_sites.txt.sample
- tool-data/*.sample
- static/welcome.html.sample
-"
+./scripts/copy_sample_files.sh
-# Create any missing config/location files
-for sample in $SAMPLES; do
- file=`echo $sample | sed -e 's/\.sample$//'`
- if [ ! -f "$file" -a -f "$sample" ]; then
- echo "Initializing $file from `basename $sample`"
- cp $sample $file
- fi
-done
+tool_shed=`./lib/tool_shed/scripts/bootstrap_tool_shed/parse_run_sh_args.sh $@`
+args=$@
-python ./scripts/paster.py serve tool_shed_wsgi.ini --pid-file=tool_shed_webapp.pid --log-file=tool_shed_webapp.log $@
+if [ $? -eq 0 ] ; then
+ bash ./lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap_tool_shed.sh $@
+ args=`echo $@ | sed "s#-\?-bootstrap_from_tool_shed $tool_shed##"`
+fi
+
+python ./scripts/paster.py serve tool_shed_wsgi.ini --pid-file=tool_shed_webapp.pid --log-file=tool_shed_webapp.log $args
diff -r f0a5e3666e844d907e7ef3c7fc4e23a443ba65d1 -r 1830e34c80c086696f83383871b6027f3b44ea8b scripts/copy_sample_files.sh
--- /dev/null
+++ b/scripts/copy_sample_files.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+SAMPLES="
+ tool_shed_wsgi.ini.sample
+ datatypes_conf.xml.sample
+ external_service_types_conf.xml.sample
+ migrated_tools_conf.xml.sample
+ reports_wsgi.ini.sample
+ shed_tool_conf.xml.sample
+ tool_conf.xml.sample
+ shed_tool_data_table_conf.xml.sample
+ tool_data_table_conf.xml.sample
+ tool_sheds_conf.xml.sample
+ data_manager_conf.xml.sample
+ shed_data_manager_conf.xml.sample
+ openid_conf.xml.sample
+ job_metrics_conf.xml.sample
+ universe_wsgi.ini.sample
+ lib/tool_shed/scripts/bootstrap_tool_shed/user_info.xml.sample
+ tool-data/shared/ncbi/builds.txt.sample
+ tool-data/shared/ensembl/builds.txt.sample
+ tool-data/shared/ucsc/builds.txt.sample
+ tool-data/shared/ucsc/publicbuilds.txt.sample
+ tool-data/shared/ucsc/ucsc_build_sites.txt.sample
+ tool-data/shared/igv/igv_build_sites.txt.sample
+ tool-data/shared/rviewer/rviewer_build_sites.txt.sample
+ tool-data/*.sample
+ static/welcome.html.sample
+"
+
+# Create any missing config/location files
+for sample in $SAMPLES; do
+ file=${sample%.sample}
+ if [ ! -f "$file" -a -f "$sample" ]; then
+ echo "Initializing $file from `basename $sample`"
+ cp $sample $file
+ fi
+done
+
https://bitbucket.org/galaxy/galaxy-central/commits/e959799971fc/
Changeset: e959799971fc
User: davebgx
Date: 2014-05-22 18:41:13
Summary: Merge next-stable.
Affected #: 0 files
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8e0034733cf9/
Changeset: 8e0034733cf9
Branch: next-stable
User: jmchilton
Date: 2014-05-22 18:01:04
Summary: Fix GUI for f24bb5d.
Affected #: 1 file
diff -r 316db249f068ded4e541415232b480250c7cdd56 -r 8e0034733cf936643078de18f77394256e55001d static/scripts/mvc/dataset/hda-model.js
--- a/static/scripts/mvc/dataset/hda-model.js
+++ b/static/scripts/mvc/dataset/hda-model.js
@@ -667,8 +667,8 @@
if( ids.length != 2 ){
// TODO: Do something...
}
- element_identifiers.push( { name: "left", src: "hda", id: ids[ 0 ] } );
- element_identifiers.push( { name: "right", src: "hda", id: ids[ 1 ] } );
+ element_identifiers.push( { name: "forward", src: "hda", id: ids[ 0 ] } );
+ element_identifiers.push( { name: "reverse", src: "hda", id: ids[ 1 ] } );
name = "New Dataset Pair";
}
options.data = {type: "dataset_collection",
https://bitbucket.org/galaxy/galaxy-central/commits/f0a5e3666e84/
Changeset: f0a5e3666e84
Branch: next-stable
User: jmchilton
Date: 2014-05-22 18:02:05
Summary: Pack scripts.
Affected #: 1 file
diff -r 8e0034733cf936643078de18f77394256e55001d -r f0a5e3666e844d907e7ef3c7fc4e23a443ba65d1 static/scripts/packed/mvc/dataset/hda-model.js
--- a/static/scripts/packed/mvc/dataset/hda-model.js
+++ b/static/scripts/packed/mvc/dataset/hda-model.js
@@ -1,1 +1,1 @@
-define(["mvc/base-mvc","utils/localization"],function(e,c){var a=Backbone.Model.extend(e.LoggableMixin).extend({urlRoot:galaxy_config.root+"api/histories/",url:function(){return this.urlRoot+this.get("history_id")+"/contents/"+this.get("history_content_type")+"s/"+this.get("id")},hidden:function(){return !this.get("visible")},"delete":function f(m){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},m)},undelete:function i(m){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},m)},hide:function d(m){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},m)},unhide:function h(m){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},m)},isVisible:function(n,o){var m=true;if((!n)&&(this.get("deleted")||this.get("purged"))){m=false}if((!o)&&(!this.get("visible"))){m=false}return m},searchAttribute:function(o,m){var n=this.get(o);if(!m||(n===undefined||n===null)){return false}if(_.isArray(n)){return this._searchArrayAttribute(n,m)}return(n.toString().toLowerCase().indexOf(m.toLowerCase())!==-1)},_searchArrayAttribute:function(n,m){m=m.toLowerCase();return _.any(n,function(o){return(o.toString().toLowerCase().indexOf(m.toLowerCase())!==-1)})},search:function(m){var n=this;return _.filter(this.searchAttributes,function(o){return n.searchAttribute(o,m)})},matches:function(n){var p="=",m=n.split(p);if(m.length>=2){var o=m[0];o=this.searchAliases[o]||o;return this.searchAttribute(o,m[1])}return !!this.search(n).length},matchesAll:function(n){var m=this;n=n.match(/(".*"|\w*=".*"|\S*)/g).filter(function(o){return !!o});return _.all(n,function(o){o=o.replace(/"/g,"");return m.matches(o)})}});var l=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",history_content_type:"dataset",hid:0,id:null,name:"(unnamed dataset)",state:"new",deleted:false,visible:true,accessible:true,purged:false,data_type:"",file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",tags:[],annotation:""},urls:function(){var n=this.get("id");if(!n){return{}}var m={purge:galaxy_config.root+"datasets/"+n+"/purge_async",display:galaxy_config.root+"datasets/"+n+"/display/?preview=True",edit:galaxy_config.root+"datasets/"+n+"/edit",download:galaxy_config.root+"datasets/"+n+"/display?to_ext="+this.get("file_ext"),report_error:galaxy_config.root+"dataset/errors?id="+n,rerun:galaxy_config.root+"tool_runner/rerun?id="+n,show_params:galaxy_config.root+"datasets/"+n+"/show_params",visualization:galaxy_config.root+"visualization",annotation:{get:galaxy_config.root+"dataset/get_annotation_async?id="+n,set:galaxy_config.root+"dataset/annotate_async?id="+n},meta_download:galaxy_config.root+"dataset/get_metadata_file?hda_id="+n+"&metadata_name="};return m},initialize:function(m){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",l.STATES.NOT_VIEWABLE)}this._setUpListeners()},_setUpListeners:function(){this.on("change:state",function(n,m){this.log(this+" has changed state:",n,m);if(this.inReadyState()){this.trigger("state:ready",n,m,this.previous("state"))}})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},inReadyState:function(){var m=_.contains(l.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||m)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function f(m){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},m)},undelete:function i(m){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},m)},hide:function d(m){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},m)},unhide:function h(m){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},m)},purge:function g(m){if(this.get("purged")){return jQuery.when()}m=m||{};m.url=galaxy_config.root+"datasets/"+this.get("id")+"/purge_async";var n=this,o=jQuery.ajax(m);o.done(function(r,p,q){n.set({deleted:true,purged:true})});o.fail(function(t,p,s){var q=c("Unable to purge dataset");var r=("Removal of datasets by users is not allowed in this Galaxy instance");if(t.responseJSON&&t.responseJSON.error){q=t.responseJSON.error}else{if(t.responseText.indexOf(r)!==-1){q=r}}t.responseText=q;n.trigger("error",n,t,m,c(q),{error:q})});return o},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},toString:function(){var m=this.get("id")||"";if(this.get("name")){m=this.get("hid")+' :"'+this.get("name")+'",'+m}return"HDA("+m+")"}});l.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};l.READY_STATES=[l.STATES.OK,l.STATES.EMPTY,l.STATES.PAUSED,l.STATES.FAILED_METADATA,l.STATES.NOT_VIEWABLE,l.STATES.DISCARDED,l.STATES.ERROR];l.NOT_READY_STATES=[l.STATES.UPLOAD,l.STATES.QUEUED,l.STATES.RUNNING,l.STATES.SETTING_METADATA,l.STATES.NEW];var b=Backbone.Collection.extend(e.LoggableMixin).extend({model:function(n,m){if(n.history_content_type=="dataset"){return new l(n,m)}else{if(n.history_content_type=="dataset_collection"){return new j(n,m)}else{}}},urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(n,m){m=m||{};this.historyId=m.historyId},ids:function(){return this.map(function(m){return m.id})},notReady:function(){return this.filter(function(m){return !m.inReadyState()})},running:function(){var m=[];this.each(function(n){if(!n.inReadyState()){m.push(n.get("id"))}});return m},getByHid:function(m){return _.first(this.filter(function(n){return n.get("hid")===m}))},getVisible:function(m,p,o){o=o||[];var n=new b(this.filter(function(q){return q.isVisible(m,p)}));_.each(o,function(q){if(!_.isFunction(q)){return}n=new b(n.filter(q))});return n},haveDetails:function(){return this.all(function(m){return m.hasDetails()})},fetchAllDetails:function(n){n=n||{};var m={details:"all"};n.data=(n.data)?(_.extend(n.data,m)):(m);return this.fetch(n)},ajaxQueue:function(p,o){var n=jQuery.Deferred(),m=this.length,r=[];if(!m){n.resolve([]);return n}var q=this.chain().reverse().map(function(t,s){return function(){var u=p.call(t,o);u.done(function(v){n.notify({curr:s,total:m,response:v,model:t})});u.always(function(v){r.push(v);if(q.length){q.shift()()}else{n.resolve(r)}})}}).value();q.shift()();return n},matches:function(m){return this.filter(function(n){return n.matches(m)})},set:function(o,m){var n=this;o=_.map(o,function(q){var r=n.get(q.id);if(!r){return q}var p=r.toJSON();_.extend(p,q);return p});Backbone.Collection.prototype.set.call(this,o,m)},promoteToHistoryDatasetCollection:function k(r,p,n){n=n||{};n.url=this.url();n.type="POST";var t=p;var q=[],m=null;if(p=="list"){this.chain().each(function(w){var u=w.attributes.name;var x=w.id;var v=w.attributes.history_content_type;if(v=="dataset"){if(t!="list"){console.log("Invalid collection type")}q.push({name:u,src:"hda",id:x})}else{if(t=="list"){t="list:"+w.attributes.collection_type}else{if(t!="list:"+w.attributes.collection_type){console.log("Invalid collection type")}}q.push({name:u,src:"hdca",id:x})}});m="New Dataset List"}else{if(p=="paired"){var o=this.ids();if(o.length!=2){}q.push({name:"left",src:"hda",id:o[0]});q.push({name:"right",src:"hda",id:o[1]});m="New Dataset Pair"}}n.data={type:"dataset_collection",name:m,collection_type:t,element_identifiers:JSON.stringify(q),};var s=jQuery.ajax(n);s.done(function(w,u,v){r.refresh()});s.fail(function(w,u,v){if(w.responseJSON&&w.responseJSON.error){error=w.responseJSON.error}else{error=w.responseJSON}w.responseText=error});return s},toString:function(){return(["HDACollection(",[this.historyId,this.length].join(),")"].join(""))}});var j=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetCollectionAssociation",history_content_type:"dataset_collection",hid:0,id:null,name:"(unnamed dataset collection)",state:"ok",accessible:true,deleted:false,visible:true,purged:false,tags:[],annotation:""},urls:function(){},inReadyState:function(){return true},searchAttributes:["name"],searchAliases:{title:"name"},});return{HistoryDatasetAssociation:l,HDACollection:b}});
\ No newline at end of file
+define(["mvc/base-mvc","utils/localization"],function(e,c){var a=Backbone.Model.extend(e.LoggableMixin).extend({urlRoot:galaxy_config.root+"api/histories/",url:function(){return this.urlRoot+this.get("history_id")+"/contents/"+this.get("history_content_type")+"s/"+this.get("id")},hidden:function(){return !this.get("visible")},"delete":function f(m){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},m)},undelete:function i(m){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},m)},hide:function d(m){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},m)},unhide:function h(m){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},m)},isVisible:function(n,o){var m=true;if((!n)&&(this.get("deleted")||this.get("purged"))){m=false}if((!o)&&(!this.get("visible"))){m=false}return m},searchAttribute:function(o,m){var n=this.get(o);if(!m||(n===undefined||n===null)){return false}if(_.isArray(n)){return this._searchArrayAttribute(n,m)}return(n.toString().toLowerCase().indexOf(m.toLowerCase())!==-1)},_searchArrayAttribute:function(n,m){m=m.toLowerCase();return _.any(n,function(o){return(o.toString().toLowerCase().indexOf(m.toLowerCase())!==-1)})},search:function(m){var n=this;return _.filter(this.searchAttributes,function(o){return n.searchAttribute(o,m)})},matches:function(n){var p="=",m=n.split(p);if(m.length>=2){var o=m[0];o=this.searchAliases[o]||o;return this.searchAttribute(o,m[1])}return !!this.search(n).length},matchesAll:function(n){var m=this;n=n.match(/(".*"|\w*=".*"|\S*)/g).filter(function(o){return !!o});return _.all(n,function(o){o=o.replace(/"/g,"");return m.matches(o)})}});var l=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",history_content_type:"dataset",hid:0,id:null,name:"(unnamed dataset)",state:"new",deleted:false,visible:true,accessible:true,purged:false,data_type:"",file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",tags:[],annotation:""},urls:function(){var n=this.get("id");if(!n){return{}}var m={purge:galaxy_config.root+"datasets/"+n+"/purge_async",display:galaxy_config.root+"datasets/"+n+"/display/?preview=True",edit:galaxy_config.root+"datasets/"+n+"/edit",download:galaxy_config.root+"datasets/"+n+"/display?to_ext="+this.get("file_ext"),report_error:galaxy_config.root+"dataset/errors?id="+n,rerun:galaxy_config.root+"tool_runner/rerun?id="+n,show_params:galaxy_config.root+"datasets/"+n+"/show_params",visualization:galaxy_config.root+"visualization",annotation:{get:galaxy_config.root+"dataset/get_annotation_async?id="+n,set:galaxy_config.root+"dataset/annotate_async?id="+n},meta_download:galaxy_config.root+"dataset/get_metadata_file?hda_id="+n+"&metadata_name="};return m},initialize:function(m){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",l.STATES.NOT_VIEWABLE)}this._setUpListeners()},_setUpListeners:function(){this.on("change:state",function(n,m){this.log(this+" has changed state:",n,m);if(this.inReadyState()){this.trigger("state:ready",n,m,this.previous("state"))}})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},inReadyState:function(){var m=_.contains(l.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||m)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function f(m){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},m)},undelete:function i(m){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},m)},hide:function d(m){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},m)},unhide:function h(m){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},m)},purge:function g(m){if(this.get("purged")){return jQuery.when()}m=m||{};m.url=galaxy_config.root+"datasets/"+this.get("id")+"/purge_async";var n=this,o=jQuery.ajax(m);o.done(function(r,p,q){n.set({deleted:true,purged:true})});o.fail(function(t,p,s){var q=c("Unable to purge dataset");var r=("Removal of datasets by users is not allowed in this Galaxy instance");if(t.responseJSON&&t.responseJSON.error){q=t.responseJSON.error}else{if(t.responseText.indexOf(r)!==-1){q=r}}t.responseText=q;n.trigger("error",n,t,m,c(q),{error:q})});return o},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},toString:function(){var m=this.get("id")||"";if(this.get("name")){m=this.get("hid")+' :"'+this.get("name")+'",'+m}return"HDA("+m+")"}});l.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};l.READY_STATES=[l.STATES.OK,l.STATES.EMPTY,l.STATES.PAUSED,l.STATES.FAILED_METADATA,l.STATES.NOT_VIEWABLE,l.STATES.DISCARDED,l.STATES.ERROR];l.NOT_READY_STATES=[l.STATES.UPLOAD,l.STATES.QUEUED,l.STATES.RUNNING,l.STATES.SETTING_METADATA,l.STATES.NEW];var b=Backbone.Collection.extend(e.LoggableMixin).extend({model:function(n,m){if(n.history_content_type=="dataset"){return new l(n,m)}else{if(n.history_content_type=="dataset_collection"){return new j(n,m)}else{}}},urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(n,m){m=m||{};this.historyId=m.historyId},ids:function(){return this.map(function(m){return m.id})},notReady:function(){return this.filter(function(m){return !m.inReadyState()})},running:function(){var m=[];this.each(function(n){if(!n.inReadyState()){m.push(n.get("id"))}});return m},getByHid:function(m){return _.first(this.filter(function(n){return n.get("hid")===m}))},getVisible:function(m,p,o){o=o||[];var n=new b(this.filter(function(q){return q.isVisible(m,p)}));_.each(o,function(q){if(!_.isFunction(q)){return}n=new b(n.filter(q))});return n},haveDetails:function(){return this.all(function(m){return m.hasDetails()})},fetchAllDetails:function(n){n=n||{};var m={details:"all"};n.data=(n.data)?(_.extend(n.data,m)):(m);return this.fetch(n)},ajaxQueue:function(p,o){var n=jQuery.Deferred(),m=this.length,r=[];if(!m){n.resolve([]);return n}var q=this.chain().reverse().map(function(t,s){return function(){var u=p.call(t,o);u.done(function(v){n.notify({curr:s,total:m,response:v,model:t})});u.always(function(v){r.push(v);if(q.length){q.shift()()}else{n.resolve(r)}})}}).value();q.shift()();return n},matches:function(m){return this.filter(function(n){return n.matches(m)})},set:function(o,m){var n=this;o=_.map(o,function(q){var r=n.get(q.id);if(!r){return q}var p=r.toJSON();_.extend(p,q);return p});Backbone.Collection.prototype.set.call(this,o,m)},promoteToHistoryDatasetCollection:function k(r,p,n){n=n||{};n.url=this.url();n.type="POST";var t=p;var q=[],m=null;if(p=="list"){this.chain().each(function(w){var u=w.attributes.name;var x=w.id;var v=w.attributes.history_content_type;if(v=="dataset"){if(t!="list"){console.log("Invalid collection type")}q.push({name:u,src:"hda",id:x})}else{if(t=="list"){t="list:"+w.attributes.collection_type}else{if(t!="list:"+w.attributes.collection_type){console.log("Invalid collection type")}}q.push({name:u,src:"hdca",id:x})}});m="New Dataset List"}else{if(p=="paired"){var o=this.ids();if(o.length!=2){}q.push({name:"forward",src:"hda",id:o[0]});q.push({name:"reverse",src:"hda",id:o[1]});m="New Dataset Pair"}}n.data={type:"dataset_collection",name:m,collection_type:t,element_identifiers:JSON.stringify(q),};var s=jQuery.ajax(n);s.done(function(w,u,v){r.refresh()});s.fail(function(w,u,v){if(w.responseJSON&&w.responseJSON.error){error=w.responseJSON.error}else{error=w.responseJSON}w.responseText=error});return s},toString:function(){return(["HDACollection(",[this.historyId,this.length].join(),")"].join(""))}});var j=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetCollectionAssociation",history_content_type:"dataset_collection",hid:0,id:null,name:"(unnamed dataset collection)",state:"ok",accessible:true,deleted:false,visible:true,purged:false,tags:[],annotation:""},urls:function(){},inReadyState:function(){return true},searchAttributes:["name"],searchAliases:{title:"name"},});return{HistoryDatasetAssociation:l,HDACollection:b}});
\ No newline at end of file
https://bitbucket.org/galaxy/galaxy-central/commits/cc19c4caa043/
Changeset: cc19c4caa043
User: jmchilton
Date: 2014-05-22 18:02:17
Summary: Merge next-stable.
Affected #: 2 files
diff -r 21a66ac74e37c80fe6d5a7c44988f83db5413d87 -r cc19c4caa0434bd871b390a64113ad735c4ba223 static/scripts/mvc/dataset/hda-model.js
--- a/static/scripts/mvc/dataset/hda-model.js
+++ b/static/scripts/mvc/dataset/hda-model.js
@@ -667,8 +667,8 @@
if( ids.length != 2 ){
// TODO: Do something...
}
- element_identifiers.push( { name: "left", src: "hda", id: ids[ 0 ] } );
- element_identifiers.push( { name: "right", src: "hda", id: ids[ 1 ] } );
+ element_identifiers.push( { name: "forward", src: "hda", id: ids[ 0 ] } );
+ element_identifiers.push( { name: "reverse", src: "hda", id: ids[ 1 ] } );
name = "New Dataset Pair";
}
options.data = {type: "dataset_collection",
diff -r 21a66ac74e37c80fe6d5a7c44988f83db5413d87 -r cc19c4caa0434bd871b390a64113ad735c4ba223 static/scripts/packed/mvc/dataset/hda-model.js
--- a/static/scripts/packed/mvc/dataset/hda-model.js
+++ b/static/scripts/packed/mvc/dataset/hda-model.js
@@ -1,1 +1,1 @@
-define(["mvc/base-mvc","utils/localization"],function(e,c){var a=Backbone.Model.extend(e.LoggableMixin).extend({urlRoot:galaxy_config.root+"api/histories/",url:function(){return this.urlRoot+this.get("history_id")+"/contents/"+this.get("history_content_type")+"s/"+this.get("id")},hidden:function(){return !this.get("visible")},"delete":function f(m){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},m)},undelete:function i(m){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},m)},hide:function d(m){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},m)},unhide:function h(m){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},m)},isVisible:function(n,o){var m=true;if((!n)&&(this.get("deleted")||this.get("purged"))){m=false}if((!o)&&(!this.get("visible"))){m=false}return m},searchAttribute:function(o,m){var n=this.get(o);if(!m||(n===undefined||n===null)){return false}if(_.isArray(n)){return this._searchArrayAttribute(n,m)}return(n.toString().toLowerCase().indexOf(m.toLowerCase())!==-1)},_searchArrayAttribute:function(n,m){m=m.toLowerCase();return _.any(n,function(o){return(o.toString().toLowerCase().indexOf(m.toLowerCase())!==-1)})},search:function(m){var n=this;return _.filter(this.searchAttributes,function(o){return n.searchAttribute(o,m)})},matches:function(n){var p="=",m=n.split(p);if(m.length>=2){var o=m[0];o=this.searchAliases[o]||o;return this.searchAttribute(o,m[1])}return !!this.search(n).length},matchesAll:function(n){var m=this;n=n.match(/(".*"|\w*=".*"|\S*)/g).filter(function(o){return !!o});return _.all(n,function(o){o=o.replace(/"/g,"");return m.matches(o)})}});var l=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",history_content_type:"dataset",hid:0,id:null,name:"(unnamed dataset)",state:"new",deleted:false,visible:true,accessible:true,purged:false,data_type:"",file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",tags:[],annotation:""},urls:function(){var n=this.get("id");if(!n){return{}}var m={purge:galaxy_config.root+"datasets/"+n+"/purge_async",display:galaxy_config.root+"datasets/"+n+"/display/?preview=True",edit:galaxy_config.root+"datasets/"+n+"/edit",download:galaxy_config.root+"datasets/"+n+"/display?to_ext="+this.get("file_ext"),report_error:galaxy_config.root+"dataset/errors?id="+n,rerun:galaxy_config.root+"tool_runner/rerun?id="+n,show_params:galaxy_config.root+"datasets/"+n+"/show_params",visualization:galaxy_config.root+"visualization",annotation:{get:galaxy_config.root+"dataset/get_annotation_async?id="+n,set:galaxy_config.root+"dataset/annotate_async?id="+n},meta_download:galaxy_config.root+"dataset/get_metadata_file?hda_id="+n+"&metadata_name="};return m},initialize:function(m){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",l.STATES.NOT_VIEWABLE)}this._setUpListeners()},_setUpListeners:function(){this.on("change:state",function(n,m){this.log(this+" has changed state:",n,m);if(this.inReadyState()){this.trigger("state:ready",n,m,this.previous("state"))}})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},inReadyState:function(){var m=_.contains(l.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||m)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function f(m){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},m)},undelete:function i(m){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},m)},hide:function d(m){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},m)},unhide:function h(m){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},m)},purge:function g(m){if(this.get("purged")){return jQuery.when()}m=m||{};m.url=galaxy_config.root+"datasets/"+this.get("id")+"/purge_async";var n=this,o=jQuery.ajax(m);o.done(function(r,p,q){n.set({deleted:true,purged:true})});o.fail(function(t,p,s){var q=c("Unable to purge dataset");var r=("Removal of datasets by users is not allowed in this Galaxy instance");if(t.responseJSON&&t.responseJSON.error){q=t.responseJSON.error}else{if(t.responseText.indexOf(r)!==-1){q=r}}t.responseText=q;n.trigger("error",n,t,m,c(q),{error:q})});return o},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},toString:function(){var m=this.get("id")||"";if(this.get("name")){m=this.get("hid")+' :"'+this.get("name")+'",'+m}return"HDA("+m+")"}});l.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};l.READY_STATES=[l.STATES.OK,l.STATES.EMPTY,l.STATES.PAUSED,l.STATES.FAILED_METADATA,l.STATES.NOT_VIEWABLE,l.STATES.DISCARDED,l.STATES.ERROR];l.NOT_READY_STATES=[l.STATES.UPLOAD,l.STATES.QUEUED,l.STATES.RUNNING,l.STATES.SETTING_METADATA,l.STATES.NEW];var b=Backbone.Collection.extend(e.LoggableMixin).extend({model:function(n,m){if(n.history_content_type=="dataset"){return new l(n,m)}else{if(n.history_content_type=="dataset_collection"){return new j(n,m)}else{}}},urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(n,m){m=m||{};this.historyId=m.historyId},ids:function(){return this.map(function(m){return m.id})},notReady:function(){return this.filter(function(m){return !m.inReadyState()})},running:function(){var m=[];this.each(function(n){if(!n.inReadyState()){m.push(n.get("id"))}});return m},getByHid:function(m){return _.first(this.filter(function(n){return n.get("hid")===m}))},getVisible:function(m,p,o){o=o||[];var n=new b(this.filter(function(q){return q.isVisible(m,p)}));_.each(o,function(q){if(!_.isFunction(q)){return}n=new b(n.filter(q))});return n},haveDetails:function(){return this.all(function(m){return m.hasDetails()})},fetchAllDetails:function(n){n=n||{};var m={details:"all"};n.data=(n.data)?(_.extend(n.data,m)):(m);return this.fetch(n)},ajaxQueue:function(p,o){var n=jQuery.Deferred(),m=this.length,r=[];if(!m){n.resolve([]);return n}var q=this.chain().reverse().map(function(t,s){return function(){var u=p.call(t,o);u.done(function(v){n.notify({curr:s,total:m,response:v,model:t})});u.always(function(v){r.push(v);if(q.length){q.shift()()}else{n.resolve(r)}})}}).value();q.shift()();return n},matches:function(m){return this.filter(function(n){return n.matches(m)})},set:function(o,m){var n=this;o=_.map(o,function(q){var r=n.get(q.id);if(!r){return q}var p=r.toJSON();_.extend(p,q);return p});Backbone.Collection.prototype.set.call(this,o,m)},promoteToHistoryDatasetCollection:function k(r,p,n){n=n||{};n.url=this.url();n.type="POST";var t=p;var q=[],m=null;if(p=="list"){this.chain().each(function(w){var u=w.attributes.name;var x=w.id;var v=w.attributes.history_content_type;if(v=="dataset"){if(t!="list"){console.log("Invalid collection type")}q.push({name:u,src:"hda",id:x})}else{if(t=="list"){t="list:"+w.attributes.collection_type}else{if(t!="list:"+w.attributes.collection_type){console.log("Invalid collection type")}}q.push({name:u,src:"hdca",id:x})}});m="New Dataset List"}else{if(p=="paired"){var o=this.ids();if(o.length!=2){}q.push({name:"left",src:"hda",id:o[0]});q.push({name:"right",src:"hda",id:o[1]});m="New Dataset Pair"}}n.data={type:"dataset_collection",name:m,collection_type:t,element_identifiers:JSON.stringify(q),};var s=jQuery.ajax(n);s.done(function(w,u,v){r.refresh()});s.fail(function(w,u,v){if(w.responseJSON&&w.responseJSON.error){error=w.responseJSON.error}else{error=w.responseJSON}w.responseText=error});return s},toString:function(){return(["HDACollection(",[this.historyId,this.length].join(),")"].join(""))}});var j=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetCollectionAssociation",history_content_type:"dataset_collection",hid:0,id:null,name:"(unnamed dataset collection)",state:"ok",accessible:true,deleted:false,visible:true,purged:false,tags:[],annotation:""},urls:function(){},inReadyState:function(){return true},searchAttributes:["name"],searchAliases:{title:"name"},});return{HistoryDatasetAssociation:l,HDACollection:b}});
\ No newline at end of file
+define(["mvc/base-mvc","utils/localization"],function(e,c){var a=Backbone.Model.extend(e.LoggableMixin).extend({urlRoot:galaxy_config.root+"api/histories/",url:function(){return this.urlRoot+this.get("history_id")+"/contents/"+this.get("history_content_type")+"s/"+this.get("id")},hidden:function(){return !this.get("visible")},"delete":function f(m){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},m)},undelete:function i(m){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},m)},hide:function d(m){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},m)},unhide:function h(m){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},m)},isVisible:function(n,o){var m=true;if((!n)&&(this.get("deleted")||this.get("purged"))){m=false}if((!o)&&(!this.get("visible"))){m=false}return m},searchAttribute:function(o,m){var n=this.get(o);if(!m||(n===undefined||n===null)){return false}if(_.isArray(n)){return this._searchArrayAttribute(n,m)}return(n.toString().toLowerCase().indexOf(m.toLowerCase())!==-1)},_searchArrayAttribute:function(n,m){m=m.toLowerCase();return _.any(n,function(o){return(o.toString().toLowerCase().indexOf(m.toLowerCase())!==-1)})},search:function(m){var n=this;return _.filter(this.searchAttributes,function(o){return n.searchAttribute(o,m)})},matches:function(n){var p="=",m=n.split(p);if(m.length>=2){var o=m[0];o=this.searchAliases[o]||o;return this.searchAttribute(o,m[1])}return !!this.search(n).length},matchesAll:function(n){var m=this;n=n.match(/(".*"|\w*=".*"|\S*)/g).filter(function(o){return !!o});return _.all(n,function(o){o=o.replace(/"/g,"");return m.matches(o)})}});var l=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",history_content_type:"dataset",hid:0,id:null,name:"(unnamed dataset)",state:"new",deleted:false,visible:true,accessible:true,purged:false,data_type:"",file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",tags:[],annotation:""},urls:function(){var n=this.get("id");if(!n){return{}}var m={purge:galaxy_config.root+"datasets/"+n+"/purge_async",display:galaxy_config.root+"datasets/"+n+"/display/?preview=True",edit:galaxy_config.root+"datasets/"+n+"/edit",download:galaxy_config.root+"datasets/"+n+"/display?to_ext="+this.get("file_ext"),report_error:galaxy_config.root+"dataset/errors?id="+n,rerun:galaxy_config.root+"tool_runner/rerun?id="+n,show_params:galaxy_config.root+"datasets/"+n+"/show_params",visualization:galaxy_config.root+"visualization",annotation:{get:galaxy_config.root+"dataset/get_annotation_async?id="+n,set:galaxy_config.root+"dataset/annotate_async?id="+n},meta_download:galaxy_config.root+"dataset/get_metadata_file?hda_id="+n+"&metadata_name="};return m},initialize:function(m){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",l.STATES.NOT_VIEWABLE)}this._setUpListeners()},_setUpListeners:function(){this.on("change:state",function(n,m){this.log(this+" has changed state:",n,m);if(this.inReadyState()){this.trigger("state:ready",n,m,this.previous("state"))}})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},inReadyState:function(){var m=_.contains(l.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||m)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function f(m){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},m)},undelete:function i(m){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},m)},hide:function d(m){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},m)},unhide:function h(m){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},m)},purge:function g(m){if(this.get("purged")){return jQuery.when()}m=m||{};m.url=galaxy_config.root+"datasets/"+this.get("id")+"/purge_async";var n=this,o=jQuery.ajax(m);o.done(function(r,p,q){n.set({deleted:true,purged:true})});o.fail(function(t,p,s){var q=c("Unable to purge dataset");var r=("Removal of datasets by users is not allowed in this Galaxy instance");if(t.responseJSON&&t.responseJSON.error){q=t.responseJSON.error}else{if(t.responseText.indexOf(r)!==-1){q=r}}t.responseText=q;n.trigger("error",n,t,m,c(q),{error:q})});return o},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},toString:function(){var m=this.get("id")||"";if(this.get("name")){m=this.get("hid")+' :"'+this.get("name")+'",'+m}return"HDA("+m+")"}});l.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};l.READY_STATES=[l.STATES.OK,l.STATES.EMPTY,l.STATES.PAUSED,l.STATES.FAILED_METADATA,l.STATES.NOT_VIEWABLE,l.STATES.DISCARDED,l.STATES.ERROR];l.NOT_READY_STATES=[l.STATES.UPLOAD,l.STATES.QUEUED,l.STATES.RUNNING,l.STATES.SETTING_METADATA,l.STATES.NEW];var b=Backbone.Collection.extend(e.LoggableMixin).extend({model:function(n,m){if(n.history_content_type=="dataset"){return new l(n,m)}else{if(n.history_content_type=="dataset_collection"){return new j(n,m)}else{}}},urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(n,m){m=m||{};this.historyId=m.historyId},ids:function(){return this.map(function(m){return m.id})},notReady:function(){return this.filter(function(m){return !m.inReadyState()})},running:function(){var m=[];this.each(function(n){if(!n.inReadyState()){m.push(n.get("id"))}});return m},getByHid:function(m){return _.first(this.filter(function(n){return n.get("hid")===m}))},getVisible:function(m,p,o){o=o||[];var n=new b(this.filter(function(q){return q.isVisible(m,p)}));_.each(o,function(q){if(!_.isFunction(q)){return}n=new b(n.filter(q))});return n},haveDetails:function(){return this.all(function(m){return m.hasDetails()})},fetchAllDetails:function(n){n=n||{};var m={details:"all"};n.data=(n.data)?(_.extend(n.data,m)):(m);return this.fetch(n)},ajaxQueue:function(p,o){var n=jQuery.Deferred(),m=this.length,r=[];if(!m){n.resolve([]);return n}var q=this.chain().reverse().map(function(t,s){return function(){var u=p.call(t,o);u.done(function(v){n.notify({curr:s,total:m,response:v,model:t})});u.always(function(v){r.push(v);if(q.length){q.shift()()}else{n.resolve(r)}})}}).value();q.shift()();return n},matches:function(m){return this.filter(function(n){return n.matches(m)})},set:function(o,m){var n=this;o=_.map(o,function(q){var r=n.get(q.id);if(!r){return q}var p=r.toJSON();_.extend(p,q);return p});Backbone.Collection.prototype.set.call(this,o,m)},promoteToHistoryDatasetCollection:function k(r,p,n){n=n||{};n.url=this.url();n.type="POST";var t=p;var q=[],m=null;if(p=="list"){this.chain().each(function(w){var u=w.attributes.name;var x=w.id;var v=w.attributes.history_content_type;if(v=="dataset"){if(t!="list"){console.log("Invalid collection type")}q.push({name:u,src:"hda",id:x})}else{if(t=="list"){t="list:"+w.attributes.collection_type}else{if(t!="list:"+w.attributes.collection_type){console.log("Invalid collection type")}}q.push({name:u,src:"hdca",id:x})}});m="New Dataset List"}else{if(p=="paired"){var o=this.ids();if(o.length!=2){}q.push({name:"forward",src:"hda",id:o[0]});q.push({name:"reverse",src:"hda",id:o[1]});m="New Dataset Pair"}}n.data={type:"dataset_collection",name:m,collection_type:t,element_identifiers:JSON.stringify(q),};var s=jQuery.ajax(n);s.done(function(w,u,v){r.refresh()});s.fail(function(w,u,v){if(w.responseJSON&&w.responseJSON.error){error=w.responseJSON.error}else{error=w.responseJSON}w.responseText=error});return s},toString:function(){return(["HDACollection(",[this.historyId,this.length].join(),")"].join(""))}});var j=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetCollectionAssociation",history_content_type:"dataset_collection",hid:0,id:null,name:"(unnamed dataset collection)",state:"ok",accessible:true,deleted:false,visible:true,purged:false,tags:[],annotation:""},urls:function(){},inReadyState:function(){return true},searchAttributes:["name"],searchAliases:{title:"name"},});return{HistoryDatasetAssociation:l,HDACollection:b}});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: davebgx: Enable running the create_users and create_categories scripts via run_tool_shed.sh
by commits-noreply@bitbucket.org 22 May '14
by commits-noreply@bitbucket.org 22 May '14
22 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/21a66ac74e37/
Changeset: 21a66ac74e37
User: davebgx
Date: 2014-05-22 16:59:18
Summary: Enable running the create_users and create_categories scripts via run_tool_shed.sh
Affected #: 7 files
diff -r 581e7c8e353e9348db75d269446651e7122f10ce -r 21a66ac74e37c80fe6d5a7c44988f83db5413d87 lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap_tool_shed.sh
--- /dev/null
+++ b/lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap_tool_shed.sh
@@ -0,0 +1,100 @@
+#!/bin/bash
+
+stop_err() {
+ echo $1
+ python ./scripts/paster.py serve tool_shed_wsgi.ini --pid-file=tool_shed_bootstrap.pid --log-file=tool_shed_bootstrap.log --stop-daemon
+ exit 1
+}
+
+tool_shed=`./lib/tool_shed/scripts/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"
+
+database_result=`python ./lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap_util.py --execute check_db --config_file tool_shed_wsgi.ini`
+
+if [ $? -ne 0 ] ; then
+ stop_err "Unable to bootstrap tool shed. $database_result"
+fi
+
+echo "Bootstrapping from tool shed at $tool_shed."
+echo -n "Creating database... "
+python scripts/create_db.py tool_shed
+
+if [ $? -eq 0 ] ; then
+ echo "done."
+else
+ stop_err "failed."
+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_wsgi.ini`
+ local_shed_url=`python ./lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap_util.py --execute get_url --config_file tool_shed_wsgi.ini`
+fi
+
+admin_user_name=`echo $user_auth | awk 'BEGIN { FS="__SEP__" } ; { print \$1 }'`
+admin_user_email=`echo $user_auth | awk 'BEGIN { FS="__SEP__" } ; { print \$2 }'`
+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 tool_shed_wsgi.ini >> $log_file
+
+echo " done."
+
+sed -i "s/#admin_users = user1@example.org,user2@example.org/admin_users = $admin_user_email/" tool_shed_wsgi.ini
+echo -n "Starting tool shed in order to populate users and categories... "
+
+if [ -f tool_shed_bootstrap.pid ] ; then
+ stop_err "A bootstrap process is already running."
+fi
+
+python ./scripts/paster.py serve tool_shed_wsgi.ini --pid-file=tool_shed_bootstrap.pid --log-file=tool_shed_bootstrap.log --daemon > /dev/null
+
+shed_pid=`cat tool_shed_bootstrap.pid`
+
+while : ; do
+ tail -n 1 tool_shed_bootstrap.log | grep -q "Removing PID file tool_shed_webapp.pid"
+ if [ $? -eq 0 ] ; then
+ echo "failed."
+ echo "More information about this failure may be found in the following log snippet from tool_shed_bootstrap.log:"
+ echo "========================================"
+ tail -n 40 tool_shed_bootstrap.log
+ echo "========================================"
+ stop_err " "
+ fi
+ tail -n 2 tool_shed_bootstrap.log | grep -q "Starting server in PID $shed_pid"
+ if [ $? -eq 0 ] ; then
+ echo "done."
+ break
+ fi
+done
+
+echo -n "Retrieving admin user's API key..."
+api_key_json=`curl -s --user $admin_user_email:$admin_user_password $local_shed_url/api/authenticate/baseauth/`
+api_key=`echo $api_key_json | grep api_key | awk 'BEGIN { FS="\"" } ; { print \$4 }' | sed 's/\\s\+//'`
+
+if [[ -z $api_key && ${api_key+x} ]] ; then
+ stop_err "Error getting API key for user $admin_user_email."
+fi
+
+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
+ 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
+ echo "done."
+else
+ stop_err "Error getting API key from local tool shed."
+fi
+
+echo "Bootstrap complete, shutting down temporary tool shed process. A log has been saved to tool_shed_bootstrap.log"
+python ./scripts/paster.py serve tool_shed_wsgi.ini --pid-file=tool_shed_bootstrap.pid --log-file=tool_shed_bootstrap.log --stop-daemon
+
+exit 0
\ No newline at end of file
diff -r 581e7c8e353e9348db75d269446651e7122f10ce -r 21a66ac74e37c80fe6d5a7c44988f83db5413d87 lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap_util.py
--- /dev/null
+++ b/lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap_util.py
@@ -0,0 +1,130 @@
+#!/usr/bin/python
+import argparse
+import ConfigParser
+import os
+import sys
+
+new_path = [ os.path.join( os.getcwd(), "lib" ) ]
+new_path.extend( sys.path[1:] )
+sys.path = new_path
+
+from galaxy import eggs
+eggs.require( "SQLAlchemy >= 0.4" )
+import galaxy.webapps.tool_shed.model.mapping as tool_shed_model
+from sqlalchemy.exc import ProgrammingError
+from sqlalchemy.exc import OperationalError
+
+from tool_shed.util import xml_util
+
+def check_db( config_parser ):
+ dburi = None
+
+ if config_parser.has_option( 'app:main', 'database_connection' ):
+ dburi = config_parser.get( 'app:main', 'database_connection' )
+ elif config_parser.has_option( 'app:main', 'database_file' ):
+ db_file = config_parser.get( 'app:main', 'database_file' )
+ dburi = "sqlite:///%s?isolation_level=IMMEDIATE" % db_file
+ else:
+ print 'The database configuration setting is missing from the tool_shed_wsgi.ini file. Add this setting before attempting to bootstrap.'
+ exit(1)
+
+ sa_session = None
+
+ database_exists_message = 'The database configured for this Tool Shed is not new, so bootstrapping is not allowed. '
+ database_exists_message += 'Create a new database that has not been migrated before attempting to bootstrap.'
+
+ try:
+ model = tool_shed_model.init( config_parser.get( 'app:main', 'file_path' ), dburi, engine_options={}, create_tables=False )
+ sa_session = model.context.current
+ print database_exists_message
+ exit(1)
+ except ProgrammingError, e:
+ pass
+ except OperationalError, e:
+ pass
+
+ try:
+ if sa_session is not None:
+ result = sa_session.execute( 'SELECT version FROM migrate_version' ).first()
+ if result[0] >= 2:
+ print database_exists_message
+ exit(1)
+ else:
+ pass
+ except ProgrammingError, e:
+ pass
+
+ if config_parser.has_option( 'app:main', 'hgweb_config_dir' ):
+ hgweb_config_parser = ConfigParser.ConfigParser()
+ hgweb_dir = config_parser.get( 'app:main', 'hgweb_config_dir' )
+ hgweb_config_file = os.path.join( hgweb_dir, 'hgweb.config' )
+ if not os.path.exists( hgweb_config_file ):
+ exit(0)
+ hgweb_config_parser.read( hgweb_config_file )
+ configured_repos = hgweb_config_parser.items( 'paths' )
+ if len( configured_repos ) >= 1:
+ message = "This Tool Shed's hgweb.config file contains entries, so bootstrapping is not allowed. Delete"
+ message += " the current hgweb.config file along with all associated repositories in the configured "
+ message += "location before attempting to boostrap."
+ print
+ exit(1)
+ else:
+ exit(0)
+ else:
+ exit(0)
+
+ exit(0)
+
+def admin_user_info( config_parser ):
+ user_info_config = os.path.abspath( os.path.join( os.getcwd(), 'lib/tool_shed/scripts/bootstrap_tool_shed', 'user_info.xml' ) )
+ tree, error_message = xml_util.parse_xml( user_info_config )
+ if tree is None:
+ print "The XML file ", user_info_config, " seems to be invalid, using defaults."
+ email = 'admin(a)test.org'
+ password = 'testuser'
+ username = 'admin'
+ else:
+ root = tree.getroot()
+ for elem in root:
+ if elem.tag == 'email':
+ email = elem.text
+ elif elem.tag == 'password':
+ password = elem.text
+ elif elem.tag == 'username':
+ username = elem.text
+ print '%s__SEP__%s__SEP__%s' % ( username, email, password )
+ return 0
+
+def get_local_tool_shed_url( config_parser ):
+ port = '9009'
+ if config_parser.has_section( 'server:main' ):
+ if config_parser.has_option( 'server:main', 'port' ):
+ port = config_parser.get( 'server:main', 'port' )
+ host = '127.0.0.1'
+ print 'http://%s:%s' % ( host, port )
+ return 0
+
+def main( args ):
+ config_parser = ConfigParser.ConfigParser()
+
+ if os.path.exists( args.config ):
+ config_parser.read( args.config )
+ else:
+ return 1
+
+ if args.method == 'check_db':
+ return check_db( config_parser )
+ elif args.method == 'admin_user_info':
+ return admin_user_info( config_parser )
+ elif args.method == 'get_url':
+ return get_local_tool_shed_url( config_parser )
+ else:
+ return 1
+
+parser = argparse.ArgumentParser()
+parser.add_argument( '-c', '--config_file', dest='config', action='store', default='tool_shed_wsgi.ini' )
+parser.add_argument( '-e', '--execute', dest='method', action='store', default='check_db' )
+args = parser.parse_args()
+
+if __name__ == '__main__':
+ exit( main( args ) )
\ No newline at end of file
diff -r 581e7c8e353e9348db75d269446651e7122f10ce -r 21a66ac74e37c80fe6d5a7c44988f83db5413d87 lib/tool_shed/scripts/bootstrap_tool_shed/create_user_with_api_key.py
--- a/lib/tool_shed/scripts/bootstrap_tool_shed/create_user_with_api_key.py
+++ b/lib/tool_shed/scripts/bootstrap_tool_shed/create_user_with_api_key.py
@@ -125,7 +125,7 @@
return ''
def validate_publicname( username ):
- """""Validates the public username."""
+ """Validates the public username."""
if len( username ) < 3:
return "Public name must be at least 3 characters in length"
if len( username ) > 255:
@@ -154,5 +154,7 @@
if user is not None:
api_key = create_api_key( app, user )
print "Created new user with public username '", user.username, ". An API key was also created and associated with the user."
+ exit(0)
else:
print "Problem creating a new user and an associated API key."
+ exit(1)
diff -r 581e7c8e353e9348db75d269446651e7122f10ce -r 21a66ac74e37c80fe6d5a7c44988f83db5413d87 lib/tool_shed/scripts/bootstrap_tool_shed/parse_run_sh_args.sh
--- /dev/null
+++ b/lib/tool_shed/scripts/bootstrap_tool_shed/parse_run_sh_args.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+while (( $# )) ; do
+ case "$1" in
+ -bootstrap_from_tool_shed|--bootstrap_from_tool_shed)
+ bootstrap="true"
+ tool_shed=$2
+ echo $tool_shed
+ exit 0
+ break
+ ;;
+ esac
+ shift 1
+done
+exit 1
\ No newline at end of file
diff -r 581e7c8e353e9348db75d269446651e7122f10ce -r 21a66ac74e37c80fe6d5a7c44988f83db5413d87 run.sh
--- a/run.sh
+++ b/run.sh
@@ -5,41 +5,7 @@
python ./scripts/check_python.py
[ $? -ne 0 ] && exit 1
-SAMPLES="
- community_wsgi.ini.sample
- datatypes_conf.xml.sample
- external_service_types_conf.xml.sample
- migrated_tools_conf.xml.sample
- reports_wsgi.ini.sample
- shed_tool_conf.xml.sample
- tool_conf.xml.sample
- shed_tool_data_table_conf.xml.sample
- tool_data_table_conf.xml.sample
- tool_sheds_conf.xml.sample
- data_manager_conf.xml.sample
- shed_data_manager_conf.xml.sample
- openid_conf.xml.sample
- job_metrics_conf.xml.sample
- universe_wsgi.ini.sample
- tool-data/shared/ncbi/builds.txt.sample
- tool-data/shared/ensembl/builds.txt.sample
- tool-data/shared/ucsc/builds.txt.sample
- tool-data/shared/ucsc/publicbuilds.txt.sample
- tool-data/shared/ucsc/ucsc_build_sites.txt.sample
- tool-data/shared/igv/igv_build_sites.txt.sample
- tool-data/shared/rviewer/rviewer_build_sites.txt.sample
- tool-data/*.sample
- static/welcome.html.sample
-"
-
-# Create any missing config/location files
-for sample in $SAMPLES; do
- file=`echo $sample | sed -e 's/\.sample$//'`
- if [ ! -f "$file" -a -f "$sample" ]; then
- echo "Initializing $file from `basename $sample`"
- cp $sample $file
- fi
-done
+./scripts/copy_sample_files.sh
if [ -n "$GALAXY_UNIVERSE_CONFIG_DIR" ]; then
python ./scripts/build_universe_config.py "$GALAXY_UNIVERSE_CONFIG_DIR"
diff -r 581e7c8e353e9348db75d269446651e7122f10ce -r 21a66ac74e37c80fe6d5a7c44988f83db5413d87 run_tool_shed.sh
--- a/run_tool_shed.sh
+++ b/run_tool_shed.sh
@@ -2,37 +2,14 @@
cd `dirname $0`
-SAMPLES="
- tool_shed_wsgi.ini.sample
- datatypes_conf.xml.sample
- external_service_types_conf.xml.sample
- migrated_tools_conf.xml.sample
- reports_wsgi.ini.sample
- shed_tool_conf.xml.sample
- tool_conf.xml.sample
- shed_tool_data_table_conf.xml.sample
- tool_data_table_conf.xml.sample
- tool_sheds_conf.xml.sample
- openid_conf.xml.sample
- universe_wsgi.ini.sample
- lib/tool_shed/scripts/bootstrap_tool_shed/user_info.xml.sample
- tool-data/shared/ncbi/builds.txt.sample
- tool-data/shared/ensembl/builds.txt.sample
- tool-data/shared/ucsc/builds.txt.sample
- tool-data/shared/ucsc/publicbuilds.txt.sample
- tool-data/shared/igv/igv_build_sites.txt.sample
- tool-data/shared/rviewer/rviewer_build_sites.txt.sample
- tool-data/*.sample
- static/welcome.html.sample
-"
+./scripts/copy_sample_files.sh
-# Create any missing config/location files
-for sample in $SAMPLES; do
- file=`echo $sample | sed -e 's/\.sample$//'`
- if [ ! -f "$file" -a -f "$sample" ]; then
- echo "Initializing $file from `basename $sample`"
- cp $sample $file
- fi
-done
+tool_shed=`./lib/tool_shed/scripts/bootstrap_tool_shed/parse_run_sh_args.sh $@`
+args=$@
-python ./scripts/paster.py serve tool_shed_wsgi.ini --pid-file=tool_shed_webapp.pid --log-file=tool_shed_webapp.log $@
+if [ $? -eq 0 ] ; then
+ bash ./lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap_tool_shed.sh $@
+ args=`echo $@ | sed "s#-\?-bootstrap_from_tool_shed $tool_shed##"`
+fi
+
+python ./scripts/paster.py serve tool_shed_wsgi.ini --pid-file=tool_shed_webapp.pid --log-file=tool_shed_webapp.log $args
diff -r 581e7c8e353e9348db75d269446651e7122f10ce -r 21a66ac74e37c80fe6d5a7c44988f83db5413d87 scripts/copy_sample_files.sh
--- /dev/null
+++ b/scripts/copy_sample_files.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+SAMPLES="
+ tool_shed_wsgi.ini.sample
+ datatypes_conf.xml.sample
+ external_service_types_conf.xml.sample
+ migrated_tools_conf.xml.sample
+ reports_wsgi.ini.sample
+ shed_tool_conf.xml.sample
+ tool_conf.xml.sample
+ shed_tool_data_table_conf.xml.sample
+ tool_data_table_conf.xml.sample
+ tool_sheds_conf.xml.sample
+ data_manager_conf.xml.sample
+ shed_data_manager_conf.xml.sample
+ openid_conf.xml.sample
+ job_metrics_conf.xml.sample
+ universe_wsgi.ini.sample
+ lib/tool_shed/scripts/bootstrap_tool_shed/user_info.xml.sample
+ tool-data/shared/ncbi/builds.txt.sample
+ tool-data/shared/ensembl/builds.txt.sample
+ tool-data/shared/ucsc/builds.txt.sample
+ tool-data/shared/ucsc/publicbuilds.txt.sample
+ tool-data/shared/ucsc/ucsc_build_sites.txt.sample
+ tool-data/shared/igv/igv_build_sites.txt.sample
+ tool-data/shared/rviewer/rviewer_build_sites.txt.sample
+ tool-data/*.sample
+ static/welcome.html.sample
+"
+
+# Create any missing config/location files
+for sample in $SAMPLES; do
+ file=${sample%.sample}
+ if [ ! -f "$file" -a -f "$sample" ]; then
+ echo "Initializing $file from `basename $sample`"
+ cp $sample $file
+ fi
+done
+
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Add missing import to the Tool Shed's repository grids utility component.
by commits-noreply@bitbucket.org 22 May '14
by commits-noreply@bitbucket.org 22 May '14
22 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/581e7c8e353e/
Changeset: 581e7c8e353e
User: greg
Date: 2014-05-22 14:44:18
Summary: Add missing import to the Tool Shed's repository grids utility component.
Affected #: 1 file
diff -r b38587cb8937d678f2edcd17659fc3ce1724794d -r 581e7c8e353e9348db75d269446651e7122f10ce lib/tool_shed/grids/util.py
--- a/lib/tool_shed/grids/util.py
+++ b/lib/tool_shed/grids/util.py
@@ -5,6 +5,7 @@
from galaxy.web.form_builder import SelectField
from tool_shed.util import hg_util
+from tool_shed.util import shed_util_common as suc
log = logging.getLogger( __name__ )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: Charts: Improve options mapping between different chart types
by commits-noreply@bitbucket.org 22 May '14
by commits-noreply@bitbucket.org 22 May '14
22 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b38587cb8937/
Changeset: b38587cb8937
User: guerler
Date: 2014-05-22 10:45:43
Summary: Charts: Improve options mapping between different chart types
Affected #: 7 files
diff -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe -r b38587cb8937d678f2edcd17659fc3ce1724794d config/plugins/visualizations/charts/static/charts/nvd3_bar_horizontal_stacked/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3_bar_horizontal_stacked/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3_bar_horizontal_stacked/config.js
@@ -9,11 +9,6 @@
}
},
columns : {
- x : {
- title : 'Values for x-axis',
- is_label: true,
- is_auto : true
- },
y : {
title : 'Values for y-axis'
}
diff -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe -r b38587cb8937d678f2edcd17659fc3ce1724794d config/plugins/visualizations/charts/static/charts/nvd3_bar_stacked/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3_bar_stacked/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3_bar_stacked/config.js
@@ -4,11 +4,6 @@
title : 'Stacked',
category : 'Bar diagrams',
columns : {
- x : {
- title : 'Values for x-axis',
- is_label: true,
- is_auto : true
- },
y : {
title : 'Values for y-axis'
}
diff -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe -r b38587cb8937d678f2edcd17659fc3ce1724794d config/plugins/visualizations/charts/static/charts/nvd3_histogram_discrete/wrapper.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3_histogram_discrete/wrapper.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3_histogram_discrete/wrapper.js
@@ -40,7 +40,7 @@
// draw
var nvd3 = new NVD3(this.app, this.options);
nvd3.draw(process_id, nv.models.multiBarChart(), chart, tmp_dict, function(nvd3_model) {
- nvd3_model.options({showControls: true});
+ nvd3_model.options({showControls: false});
});
}
});
diff -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe -r b38587cb8937d678f2edcd17659fc3ce1724794d config/plugins/visualizations/charts/static/library/ui-select.js
--- a/config/plugins/visualizations/charts/static/library/ui-select.js
+++ b/config/plugins/visualizations/charts/static/library/ui-select.js
@@ -5,7 +5,7 @@
var View = Backbone.View.extend(
{
// options
- optionsDefault: {
+ optionsDefault : {
id : '',
cls : '',
empty : 'No data available',
@@ -21,6 +21,9 @@
// configure options
this.options = Utils.merge(options, this.optionsDefault);
+ // initial value
+ this.selected = this.options.value;
+
// create new element
this.setElement(this._template(this.options));
@@ -28,10 +31,7 @@
this.$select = this.$el.find('#select');
this.$icon = this.$el.find('#icon');
- // initial value
- this.selected = this.options.value;
-
- // add change event
+ // add change event. fires only on user activity
var self = this;
this.$select.on('change', function() {
self.value(self.$select.val());
@@ -67,9 +67,9 @@
// get current id/value
var after = this.selected;
- if(after) {
+ if (after) {
// fire onchange
- if ((after != before && this.options.onchange)) {
+ if (after != before && this.options.onchange) {
this.options.onchange(after);
}
}
@@ -78,6 +78,16 @@
return after;
},
+ // first
+ first: function() {
+ var options = this.$select.find('option');
+ if (options.length > 0) {
+ return options.val();
+ } else {
+ return undefined;
+ }
+ },
+
// label
text : function () {
return this.$select.find('option:selected').text();
@@ -147,40 +157,17 @@
this.$select.append(this._templateOption(options[key]));
}
- // select first option if nothing else is selected
- if (!this.selected && options.length > 0) {
- this.value(options[0].value);
- }
-
// refresh
this._refresh();
},
- // force selection to existing value
- force: function() {
- if (!this._exists(this.selected)) {
- // get select options
- var options = this.$select.find('option');
- if (options.length > 0) {
- // get value from options field
- var value = options.val();
-
- // log
- console.debug('Ui-Select()::force() - Forcing value from "' + this.selected + '" to "' + value + '".');
-
- // set value
- this.value(value);
- }
- }
- },
-
// set on change event
- onchange: function(callback) {
+ setOnChange: function(callback) {
this.options.onchange = callback;
},
// check if selected value exists
- _exists: function(value) {
+ exists: function(value) {
return this.$select.find('option[value=' + value + ']').length > 0;
},
@@ -200,11 +187,11 @@
} else {
// enable select field
this.enable();
-
- // update selected value
- if (this.selected) {
- this.$select.val(this.selected);
- }
+ }
+
+ // update value
+ if (this.selected) {
+ this.$select.val(this.selected);
}
},
diff -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe -r b38587cb8937d678f2edcd17659fc3ce1724794d config/plugins/visualizations/charts/static/library/ui-table-form.js
--- a/config/plugins/visualizations/charts/static/library/ui-table-form.js
+++ b/config/plugins/visualizations/charts/static/library/ui-table-form.js
@@ -40,14 +40,6 @@
for (var id in settings) {
this._add(id, settings[id], model);
}
-
- // trigger change
- for (var id in this.list) {
- var onchange = this.list[id].options.onchange;
- if (onchange) {
- onchange();
- }
- }
},
// add table row
@@ -66,8 +58,9 @@
field = new Ui.Input({
id : id,
placeholder : settings_def.placeholder,
- onchange : function() {
- model.set(id, field.value());
+ value : model.get(id),
+ onchange : function(value) {
+ model.set(id, value);
}
});
break;
@@ -76,13 +69,13 @@
field = new Ui.Select.View({
id : id,
data : settings_def.data,
- onchange : function() {
+ value : model.get(id),
+ onchange : function(value) {
// set new value
- var selected = field.value();
- model.set(id, selected);
+ model.set(id, value);
// find selected dictionary
- var dict = _.findWhere(settings_def.data, {value: selected});
+ var dict = _.findWhere(settings_def.data, {value: value});
if (dict) {
if (dict.show) {
self.$el.find('#' + dict.show).fadeIn('fast');
diff -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe -r b38587cb8937d678f2edcd17659fc3ce1724794d config/plugins/visualizations/charts/static/library/ui.js
--- a/config/plugins/visualizations/charts/static/library/ui.js
+++ b/config/plugins/visualizations/charts/static/library/ui.js
@@ -550,13 +550,13 @@
this.$el.hide();
}
- // onchange event handler
+ // onchange event handler. fires on user activity.
var self = this;
- if (this.options.onchange) {
- this.$el.on('input', function() {
- self.options.onchange();
- });
- }
+ this.$el.on('input', function() {
+ if (self.options.onchange) {
+ self.options.onchange(self.$el.val());
+ }
+ });
},
// value
diff -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe -r b38587cb8937d678f2edcd17659fc3ce1724794d config/plugins/visualizations/charts/static/views/group.js
--- a/config/plugins/visualizations/charts/static/views/group.js
+++ b/config/plugins/visualizations/charts/static/views/group.js
@@ -22,8 +22,8 @@
// ui elements
this.group_key = new Ui.Input({
placeholder: 'Data label',
- onchange: function() {
- self.group.set('key', self.group_key.value());
+ onchange: function(value) {
+ self.group.set('key', value);
}
});
this.table = new Table.View({content: 'No data column.'});
@@ -92,8 +92,6 @@
// create select field
var select = new Ui.Select.View({
id : 'select_' + id,
- gid : id,
- value : this.group.get(id),
wait : true
});
@@ -116,48 +114,7 @@
this.app.datasets.request({id : dataset_id}, function(dataset) {
// update select fields
for (var id in list) {
-
- // select
- var select = list[id];
-
- // is a numeric number required
- var is_label = chart_settings.columns[id].is_label;
- var is_auto = chart_settings.columns[id].is_auto;
-
- // configure columns
- var columns = [];
-
- // add auto selection column
- if (is_auto) {
- columns.push({
- 'label' : 'Column: Row Number',
- 'value' : 'auto'
- });
- }
-
- // meta data
- var meta = dataset.metadata_column_types;
- for (var key in meta) {
- // check type
- if ((!is_label && (meta[key] == 'int' || meta[key] == 'float')) || is_label) {
- // add to selection
- columns.push({
- 'label' : 'Column: ' + (parseInt(key) + 1) + ' [' + meta[key] + ']',
- 'value' : key
- });
- }
- }
-
- // add onchange event
- select.onchange(function(value) {
- self.group.set(this.gid, value);
- self.chart.set('modified', true);
- });
-
- // list
- select.update(columns);
- select.force();
- select.show();
+ self._addRow(id, dataset, list[id], chart_settings.columns[id])
}
// loading
@@ -168,6 +125,62 @@
});
},
+ // add row
+ _addRow: function(id, dataset, select, chart_setting) {
+ // is a numeric number required
+ var is_label = chart_setting.is_label;
+ var is_auto = chart_setting.is_auto;
+
+ // configure columns
+ var columns = [];
+
+ // add auto selection column
+ if (is_auto) {
+ columns.push({
+ 'label' : 'Column: Row Number',
+ 'value' : 'auto'
+ });
+ }
+
+ // meta data
+ var meta = dataset.metadata_column_types;
+ for (var key in meta) {
+ // check type
+ if ((!is_label && (meta[key] == 'int' || meta[key] == 'float')) || is_label) {
+ // add to selection
+ columns.push({
+ 'label' : 'Column: ' + (parseInt(key) + 1) + ' [' + meta[key] + ']',
+ 'value' : key
+ });
+ }
+ }
+
+ // update selection list
+ select.update(columns);
+ select.show();
+
+ // update current value
+ if (!select.exists(this.group.get(id))) {
+ // get first value
+ var first = select.first();
+
+ // log
+ console.debug('Group()::_addRow() - Switching model value from "' + this.group.get(id) + '" to "' + first + '".');
+
+ // update model value
+ this.group.set(id, first);
+ }
+ select.value(this.group.get(id));
+
+ // add onchange event
+ var self = this;
+ select.setOnChange(function(value) {
+ // update model value
+ self.group.set(id, value);
+ self.chart.set('modified', true);
+ });
+ },
+
// update
_refreshGroup: function() {
this.group.set('date', Utils.time());
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: Charts: Adds histograms for string columns/bins and generalizes column selection
by commits-noreply@bitbucket.org 21 May '14
by commits-noreply@bitbucket.org 21 May '14
21 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/d18b0f6cac6c/
Changeset: d18b0f6cac6c
User: guerler
Date: 2014-05-22 04:48:11
Summary: Charts: Adds histograms for string columns/bins and generalizes column selection
Affected #: 21 files
diff -r 6c3cc96d1fa7888b7af015dd73c7451df7338ad5 -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe config/plugins/visualizations/charts/static/app.css
--- a/config/plugins/visualizations/charts/static/app.css
+++ b/config/plugins/visualizations/charts/static/app.css
@@ -63,5 +63,6 @@
.charts-viewport .charts-viewport-canvas {
display: block;
width:100%;
+ min-height: 100px;
height: inherit;
}
\ No newline at end of file
diff -r 6c3cc96d1fa7888b7af015dd73c7451df7338ad5 -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js
--- a/config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js
+++ b/config/plugins/visualizations/charts/static/charts/heatmap/heatmap-plugin.js
@@ -285,14 +285,15 @@
}
// prepare indices
+ dataRangeFormat = d3.format('.3f');
var dataRangeMin = 0;
- var dataRangeMid = parseInt((dataRange.length - 1) / 2);
+ var dataRangeMid = '';
var dataRangeMax = dataRange.length - 1;
// add labels
- dataRange[dataRangeMin] = this.min;
+ dataRange[dataRangeMin] = dataRangeFormat(this.min);
dataRange[dataRangeMid] = this.mid;
- dataRange[dataRangeMax] = this.max;
+ dataRange[dataRangeMax] = dataRangeFormat(this.max);
// create legend
var legend = this.svg.selectAll('.legend')
diff -r 6c3cc96d1fa7888b7af015dd73c7451df7338ad5 -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe config/plugins/visualizations/charts/static/charts/nvd3/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3/config.js
@@ -5,12 +5,7 @@
category : '',
library : 'nvd3.js',
tag : 'svg',
- columns : {
- y : {
- title : 'Values for y-axis'
- }
- },
- settings : {
+ settings : {
separator_label : {
title : 'X axis',
type : 'separator'
diff -r 6c3cc96d1fa7888b7af015dd73c7451df7338ad5 -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe config/plugins/visualizations/charts/static/charts/nvd3/nvd3.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3/nvd3.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3/nvd3.js
@@ -34,11 +34,13 @@
nvd3_model.options({showControls: false});
// legend
- var legend_visible = true;
- if (chart.settings.get('show_legend') == 'false') {
- legend_visible = false;
+ if (nvd3_model.showLegend) {
+ var legend_visible = true;
+ if (chart.settings.get('show_legend') == 'false') {
+ legend_visible = false;
+ }
+ nvd3_model.showLegend(legend_visible);
}
- nvd3_model.showLegend(legend_visible);
// custom callback
if (callback) {
diff -r 6c3cc96d1fa7888b7af015dd73c7451df7338ad5 -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe config/plugins/visualizations/charts/static/charts/nvd3_bar/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3_bar/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3_bar/config.js
@@ -2,7 +2,17 @@
return $.extend(true, {}, nvd3_config, {
title : 'Regular',
- category : 'Bar diagrams'
+ category : 'Bar diagrams',
+ columns : {
+ x : {
+ title : 'Values for x-axis',
+ is_label: true,
+ is_auto : true
+ },
+ y : {
+ title : 'Values for y-axis'
+ }
+ }
});
});
\ No newline at end of file
diff -r 6c3cc96d1fa7888b7af015dd73c7451df7338ad5 -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe config/plugins/visualizations/charts/static/charts/nvd3_bar_horizontal/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3_bar_horizontal/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3_bar_horizontal/config.js
@@ -3,6 +3,16 @@
return $.extend(true, {}, nvd3_config, {
title : 'Horizontal',
category : 'Bar diagrams',
+ columns : {
+ x : {
+ title : 'Values for x-axis',
+ is_label: true,
+ is_auto : true
+ },
+ y : {
+ title : 'Values for y-axis'
+ }
+ },
settings : {
x_axis_type : {
init : 'hide'
diff -r 6c3cc96d1fa7888b7af015dd73c7451df7338ad5 -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe config/plugins/visualizations/charts/static/charts/nvd3_bar_horizontal_stacked/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3_bar_horizontal_stacked/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3_bar_horizontal_stacked/config.js
@@ -7,6 +7,16 @@
x_axis_type : {
init : 'hide'
}
+ },
+ columns : {
+ x : {
+ title : 'Values for x-axis',
+ is_label: true,
+ is_auto : true
+ },
+ y : {
+ title : 'Values for y-axis'
+ }
}
});
diff -r 6c3cc96d1fa7888b7af015dd73c7451df7338ad5 -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe config/plugins/visualizations/charts/static/charts/nvd3_bar_stacked/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3_bar_stacked/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3_bar_stacked/config.js
@@ -2,7 +2,17 @@
return $.extend(true, {}, nvd3_config, {
title : 'Stacked',
- category : 'Bar diagrams'
+ category : 'Bar diagrams',
+ columns : {
+ x : {
+ title : 'Values for x-axis',
+ is_label: true,
+ is_auto : true
+ },
+ y : {
+ title : 'Values for y-axis'
+ }
+ }
});
});
\ No newline at end of file
diff -r 6c3cc96d1fa7888b7af015dd73c7451df7338ad5 -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe config/plugins/visualizations/charts/static/charts/nvd3_histogram_discrete/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3_histogram_discrete/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3_histogram_discrete/config.js
@@ -5,7 +5,7 @@
category : 'Data processing (requires \'charts\' tool from Toolshed)',
execute : 'histogramdiscrete',
columns : {
- y : {
+ x : {
title : 'Observations',
is_label : true
}
diff -r 6c3cc96d1fa7888b7af015dd73c7451df7338ad5 -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe config/plugins/visualizations/charts/static/charts/nvd3_histogram_discrete/wrapper.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3_histogram_discrete/wrapper.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3_histogram_discrete/wrapper.js
@@ -15,24 +15,33 @@
{
// configure request
var index = 1;
- for (var i in request_dictionary.groups) {
- var group = request_dictionary.groups[i];
- group.columns = {
- x: {
- index: 0
- },
- y: {
- index: index++
- },
- }
+ var tmp_dict = {
+ id : request_dictionary.id,
+ groups : []
+ };
+
+ // configure groups
+ for (var group_index in request_dictionary.groups) {
+ var group = request_dictionary.groups[group_index];
+ tmp_dict.groups.push({
+ key : group.key,
+ columns : {
+ x: {
+ index : 0,
+ is_label : true
+ },
+ y: {
+ index : index++
+ }
+ }
+ });
}
- // link this
- var self = this;
-
- // load nvd3
+ // draw
var nvd3 = new NVD3(this.app, this.options);
- nvd3.draw(process_id, nv.models.multiBarChart(), chart, request_dictionary);
+ nvd3.draw(process_id, nv.models.multiBarChart(), chart, tmp_dict, function(nvd3_model) {
+ nvd3_model.options({showControls: true});
+ });
}
});
diff -r 6c3cc96d1fa7888b7af015dd73c7451df7338ad5 -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe config/plugins/visualizations/charts/static/charts/nvd3_line/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3_line/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3_line/config.js
@@ -2,7 +2,16 @@
return $.extend(true, {}, nvd3_config, {
title : 'Line chart',
- category : 'Others'
+ category : 'Others',
+ columns : {
+ x : {
+ title : 'Values for x-axis',
+ is_auto : true
+ },
+ y : {
+ title : 'Values for y-axis'
+ }
+ }
});
});
\ No newline at end of file
diff -r 6c3cc96d1fa7888b7af015dd73c7451df7338ad5 -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe config/plugins/visualizations/charts/static/charts/nvd3_line_focus/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3_line_focus/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3_line_focus/config.js
@@ -2,7 +2,12 @@
return $.extend(true, {}, nvd3_config, {
title : 'Line with focus',
- category : 'Others'
+ category : 'Others',
+ columns : {
+ y : {
+ title : 'Values for y-axis'
+ }
+ }
});
});
\ No newline at end of file
diff -r 6c3cc96d1fa7888b7af015dd73c7451df7338ad5 -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe config/plugins/visualizations/charts/static/charts/nvd3_pie/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3_pie/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3_pie/config.js
@@ -9,7 +9,8 @@
columns : {
label : {
title : 'Labels',
- is_label : true
+ is_label : true,
+ is_auto : true
},
y : {
title : 'Values'
diff -r 6c3cc96d1fa7888b7af015dd73c7451df7338ad5 -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe config/plugins/visualizations/charts/static/charts/nvd3_scatter/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3_scatter/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3_scatter/config.js
@@ -6,6 +6,9 @@
columns : {
x : {
title : 'Values for x-axis'
+ },
+ y : {
+ title : 'Values for y-axis'
}
}
});
diff -r 6c3cc96d1fa7888b7af015dd73c7451df7338ad5 -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe config/plugins/visualizations/charts/static/charts/nvd3_stackedarea/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3_stackedarea/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3_stackedarea/config.js
@@ -2,7 +2,12 @@
return $.extend(true, {}, nvd3_config, {
title : 'Regular',
- category : 'Area charts'
+ category : 'Area charts',
+ columns : {
+ y : {
+ title : 'Values for y-axis'
+ }
+ }
});
});
\ No newline at end of file
diff -r 6c3cc96d1fa7888b7af015dd73c7451df7338ad5 -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe config/plugins/visualizations/charts/static/charts/nvd3_stackedarea_full/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3_stackedarea_full/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3_stackedarea_full/config.js
@@ -2,7 +2,12 @@
return $.extend(true, {}, nvd3_config, {
title : 'Expanded',
- category : 'Area charts'
+ category : 'Area charts',
+ columns : {
+ y : {
+ title : 'Values for y-axis'
+ }
+ }
});
});
\ No newline at end of file
diff -r 6c3cc96d1fa7888b7af015dd73c7451df7338ad5 -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe config/plugins/visualizations/charts/static/charts/nvd3_stackedarea_stream/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3_stackedarea_stream/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3_stackedarea_stream/config.js
@@ -2,7 +2,12 @@
return $.extend(true, {}, nvd3_config, {
title : 'Stream',
- category : 'Area charts'
+ category : 'Area charts',
+ columns : {
+ y : {
+ title : 'Values for y-axis'
+ }
+ }
});
});
\ No newline at end of file
diff -r 6c3cc96d1fa7888b7af015dd73c7451df7338ad5 -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe config/plugins/visualizations/charts/static/charts/types.js
--- a/config/plugins/visualizations/charts/static/charts/types.js
+++ b/config/plugins/visualizations/charts/static/charts/types.js
@@ -48,7 +48,7 @@
'nvd3_scatter' : nvd3_scatter,
'nvd3_pie' : nvd3_pie,
'nvd3_histogram' : nvd3_histogram,
- //'nvd3_histogram_discrete' : nvd3_histogram_discrete,
+ 'nvd3_histogram_discrete' : nvd3_histogram_discrete,
'highcharts_boxplot' : highcharts_boxplot,
'heatmap' : heatmap
}
diff -r 6c3cc96d1fa7888b7af015dd73c7451df7338ad5 -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe config/plugins/visualizations/charts/static/library/datasets.js
--- a/config/plugins/visualizations/charts/static/library/datasets.js
+++ b/config/plugins/visualizations/charts/static/library/datasets.js
@@ -27,29 +27,37 @@
// check if column data is requested
if (request_dictionary.groups) {
- this._get(request_dictionary, success);
+ this._get_dataset(request_dictionary.id, function() {
+ self._get(request_dictionary, success);
+ });
} else {
- // check if dataset is available from cache
- var dataset = this.list[request_dictionary.id];
- if (dataset) {
- success(dataset);
- return;
+ this._get_dataset(request_dictionary.id, success, error)
+ }
+ },
+
+ // get dataset
+ _get_dataset: function(id, success, error) {
+ // check if dataset is available from cache
+ var dataset = this.list[id];
+ if (dataset) {
+ success(dataset);
+ return;
+ }
+
+ // request dataset
+ var self = this;
+ Utils.request('GET', config.root + 'api/datasets/' + id, {}, function(dataset) {
+ switch (dataset.state) {
+ case 'error':
+ if (error) {
+ error(dataset);
+ }
+ break;
+ default:
+ self.list[id] = dataset;
+ success(dataset);
}
-
- // request dataset
- Utils.request('GET', config.root + 'api/datasets/' + request_dictionary.id, {}, function(dataset) {
- switch (dataset.state) {
- case 'error':
- if (error) {
- error(dataset);
- }
- break;
- default:
- self.list[request_dictionary.id] = dataset;
- success(dataset);
- }
- });
- }
+ });
},
// get block id
@@ -78,7 +86,7 @@
// check if column is in cache
var block_id = this._block_id(request_dictionary, column);
- if (this.cache[block_id]) {
+ if (this.cache[block_id] || column === 'auto') {
continue;
}
@@ -134,45 +142,74 @@
// log
console.debug('Datasets::_fill_from_cache() - Filling request from cache.');
+ // get dataset
+ var dataset = this.list[request_dictionary.id];
+ if (!dataset) {
+ console.debug('FAILED - Datasets::_fill_from_cache() - Dataset not found.');
+ }
+
+ // identify start/end of request
+ var start = request_dictionary.start;
+ var end = Math.min(request_dictionary.end, dataset.metadata_data_lines);
+ if (end - start <= 0) {
+ console.debug('FAILED - Datasets::_fill_from_cache() - Invalid range.');
+ }
+
+ // initialize group values
+ for (var i in request_dictionary.groups) {
+ // get group
+ var group = request_dictionary.groups[i];
+
+ // reset group
+ group.values = [];
+
+ // add values
+ for (var j = 0; j < end - start; j++) {
+ // add default x values
+ group.values[j] = {
+ x : parseInt(j) + start
+ };
+ }
+ }
+
// collect all data into the defined groups
for (var i in request_dictionary.groups) {
// get group
var group = request_dictionary.groups[i];
- // create array for values
- group.values = [];
-
// fill value
for (var key in group.columns) {
// get column
var column = group.columns[key];
- // get block
- var block_id = this._block_id(request_dictionary, column.index);
- var column_data = this.cache[block_id];
-
- // go through column
- for (k in column_data) {
- // initialize value
- var value = group.values[k];
- if (value === undefined) {
- // create new value field
- value = {
- x : parseInt(k) + request_dictionary.start
+ // check if auto block is requested
+ if (column.index == 'auto') {
+ for (var j = start; j < end; j++) {
+ // get value dictionary
+ var value = group.values[j];
+
+ // add auto value
+ value[key] = parseInt(j) + start;
+ }
+ } else {
+ // get block
+ var block_id = this._block_id(request_dictionary, column.index);
+ var column_data = this.cache[block_id];
+
+ // go through column
+ for (var j = start; j < end; j++) {
+ // get value dictionary
+ var value = group.values[j];
+
+ // get/fix value
+ var v = column_data[j];
+ if (isNaN(v) && !column.is_label) {
+ v = 0;
}
- // add to group
- group.values[k] = value;
- };
-
- // get/fix value
- var v = column_data[k];
- if (isNaN(v) && !column.is_label) {
- v = 0;
+ // add to dict
+ value[key] = v;
}
-
- // add to dict
- value[key] = v;
}
}
}
diff -r 6c3cc96d1fa7888b7af015dd73c7451df7338ad5 -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe config/plugins/visualizations/charts/static/library/ui-select.js
--- a/config/plugins/visualizations/charts/static/library/ui-select.js
+++ b/config/plugins/visualizations/charts/static/library/ui-select.js
@@ -33,11 +33,9 @@
// add change event
var self = this;
- if (this.options.onchange) {
- this.$select.on('change', function() {
- self.value(self.$select.val());
- });
- }
+ this.$select.on('change', function() {
+ self.value(self.$select.val());
+ });
// refresh
this._refresh();
@@ -158,6 +156,34 @@
this._refresh();
},
+ // force selection to existing value
+ force: function() {
+ if (!this._exists(this.selected)) {
+ // get select options
+ var options = this.$select.find('option');
+ if (options.length > 0) {
+ // get value from options field
+ var value = options.val();
+
+ // log
+ console.debug('Ui-Select()::force() - Forcing value from "' + this.selected + '" to "' + value + '".');
+
+ // set value
+ this.value(value);
+ }
+ }
+ },
+
+ // set on change event
+ onchange: function(callback) {
+ this.options.onchange = callback;
+ },
+
+ // check if selected value exists
+ _exists: function(value) {
+ return this.$select.find('option[value=' + value + ']').length > 0;
+ },
+
// refresh
_refresh: function() {
// remove placeholder
@@ -166,9 +192,11 @@
// count remaining entries
var remaining = this.$select.find('option').length;
if (remaining == 0) {
+ // disable select field
+ this.disable();
+
// append placeholder
this.$select.append(this._templateOption({value : 'null', label : this.options.empty}));
- this.disable();
} else {
// enable select field
this.enable();
@@ -180,12 +208,6 @@
}
},
- // exists
- _exists: function(value) {
- // check if selected value exists
- return 0 != this.$select.find('option[value=' + value + ']').length;
- },
-
// option
_templateOption: function(options) {
return '<option value="' + options.value + '">' + options.label + '</option>';
diff -r 6c3cc96d1fa7888b7af015dd73c7451df7338ad5 -r d18b0f6cac6cb7bea6bd66900cc2d119bb733fbe config/plugins/visualizations/charts/static/views/group.js
--- a/config/plugins/visualizations/charts/static/views/group.js
+++ b/config/plugins/visualizations/charts/static/views/group.js
@@ -82,25 +82,21 @@
// load list
var list = {};
for (var id in chart_settings.columns) {
- // initialize
- var value = this.group.get(id);
- if (!value) {
- this.group.set(id, 0);
+ // get definition
+ var data_def = chart_settings.columns[id];
+ if (!data_def) {
+ console.debug('Group::_refreshTable() - Skipping column definition.');
+ continue;
}
+
+ // create select field
+ var select = new Ui.Select.View({
+ id : 'select_' + id,
+ gid : id,
+ value : this.group.get(id),
+ wait : true
+ });
- // create select field
- var data_def = chart_settings.columns[id];
- var select = new Ui.Select.View({
- id : 'select_' + id,
- gid : id,
- onchange : function(value) {
- self.group.set(this.gid, value);
- self.chart.set('modified', true);
- },
- value : value,
- wait : true
- });
-
// add row to table
this.table.add(data_def.title, '25%');
this.table.add(select.$el);
@@ -121,11 +117,25 @@
// update select fields
for (var id in list) {
+ // select
+ var select = list[id];
+
// is a numeric number required
- var is_label = chart_settings.columns[id].is_label;
-
+ var is_label = chart_settings.columns[id].is_label;
+ var is_auto = chart_settings.columns[id].is_auto;
+
// configure columns
var columns = [];
+
+ // add auto selection column
+ if (is_auto) {
+ columns.push({
+ 'label' : 'Column: Row Number',
+ 'value' : 'auto'
+ });
+ }
+
+ // meta data
var meta = dataset.metadata_column_types;
for (var key in meta) {
// check type
@@ -138,9 +148,16 @@
}
}
+ // add onchange event
+ select.onchange(function(value) {
+ self.group.set(this.gid, value);
+ self.chart.set('modified', true);
+ });
+
// list
- list[id].update(columns);
- list[id].show();
+ select.update(columns);
+ select.force();
+ select.show();
}
// loading
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/316db249f068/
Changeset: 316db249f068
Branch: next-stable
User: jmchilton
Date: 2014-05-21 22:09:52
Summary: Fix for running workflows with collection inptus.
takadonet reported running such workflows were not behaving correctly when copying inputs to new history is enabled.
Affected #: 1 file
diff -r fc89661b92dcbd9684ac779171235525601d0f4a -r 316db249f068ded4e541415232b480250c7cdd56 lib/galaxy/workflow/run.py
--- a/lib/galaxy/workflow/run.py
+++ b/lib/galaxy/workflow/run.py
@@ -203,9 +203,17 @@
# ds_map.
if self.copy_inputs_to_history:
for input_dataset_hda in out_data.values():
- new_hda = input_dataset_hda.copy( copy_children=True )
- self.target_history.add_dataset( new_hda )
- outputs[ step.id ][ 'input_ds_copy' ] = new_hda
+ content_type = input_dataset_hda.history_content_type
+ if content_type == "dataset":
+ new_hda = input_dataset_hda.copy( copy_children=True )
+ self.target_history.add_dataset( new_hda )
+ outputs[ step.id ][ 'input_ds_copy' ] = new_hda
+ elif content_type == "dataset_collection":
+ new_hdca = input_dataset_hda.copy()
+ self.target_history.add_dataset_collection( new_hdca )
+ outputs[ step.id ][ 'input_ds_copy' ] = new_hdca
+ else:
+ raise Exception("Unknown history content encountered")
if self.ds_map:
outputs[ step.id ][ 'output' ] = self.ds_map[ str( step.id ) ][ 'hda' ]
https://bitbucket.org/galaxy/galaxy-central/commits/6c3cc96d1fa7/
Changeset: 6c3cc96d1fa7
User: jmchilton
Date: 2014-05-21 22:10:44
Summary: Merge next-stable.
Affected #: 1 file
diff -r e8f2c4f3e8c8ed63a99254a50ceb18fc33c52080 -r 6c3cc96d1fa7888b7af015dd73c7451df7338ad5 lib/galaxy/workflow/run.py
--- a/lib/galaxy/workflow/run.py
+++ b/lib/galaxy/workflow/run.py
@@ -203,9 +203,17 @@
# ds_map.
if self.copy_inputs_to_history:
for input_dataset_hda in out_data.values():
- new_hda = input_dataset_hda.copy( copy_children=True )
- self.target_history.add_dataset( new_hda )
- outputs[ step.id ][ 'input_ds_copy' ] = new_hda
+ content_type = input_dataset_hda.history_content_type
+ if content_type == "dataset":
+ new_hda = input_dataset_hda.copy( copy_children=True )
+ self.target_history.add_dataset( new_hda )
+ outputs[ step.id ][ 'input_ds_copy' ] = new_hda
+ elif content_type == "dataset_collection":
+ new_hdca = input_dataset_hda.copy()
+ self.target_history.add_dataset_collection( new_hdca )
+ outputs[ step.id ][ 'input_ds_copy' ] = new_hdca
+ else:
+ raise Exception("Unknown history content encountered")
if self.ds_map:
outputs[ step.id ][ 'output' ] = self.ds_map[ str( step.id ) ][ 'hda' ]
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Remove appropriate entries from the Tool Shed's new repository registry for repositories that have been marked deprecated or deleted.
by commits-noreply@bitbucket.org 21 May '14
by commits-noreply@bitbucket.org 21 May '14
21 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e8f2c4f3e8c8/
Changeset: e8f2c4f3e8c8
User: greg
Date: 2014-05-21 21:57:54
Summary: Remove appropriate entries from the Tool Shed's new repository registry for repositories that have been marked deprecated or deleted.
Affected #: 3 files
diff -r 155be7ce7910c2effb12fff904390401bdd7976b -r e8f2c4f3e8c8ed63a99254a50ceb18fc33c52080 lib/galaxy/webapps/tool_shed/controllers/admin.py
--- a/lib/galaxy/webapps/tool_shed/controllers/admin.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/admin.py
@@ -171,6 +171,8 @@
repository.deleted = True
trans.sa_session.add( repository )
trans.sa_session.flush()
+ # Update the repository registry.
+ trans.app.repository_registry.remove_entry( repository )
count += 1
deleted_repositories += " %s " % repository.name
if count:
diff -r 155be7ce7910c2effb12fff904390401bdd7976b -r e8f2c4f3e8c8ed63a99254a50ceb18fc33c52080 lib/galaxy/webapps/tool_shed/controllers/repository.py
--- a/lib/galaxy/webapps/tool_shed/controllers/repository.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/repository.py
@@ -1051,6 +1051,8 @@
trans.sa_session.add( repository )
trans.sa_session.flush()
if mark_deprecated:
+ # Update the repository registry.
+ trans.app.repository_registry.remove_entry( repository )
message = 'The repository <b>%s</b> has been marked as deprecated.' % repository.name
else:
# Update the repository registry.
diff -r 155be7ce7910c2effb12fff904390401bdd7976b -r e8f2c4f3e8c8ed63a99254a50ceb18fc33c52080 lib/tool_shed/repository_registry.py
--- a/lib/tool_shed/repository_registry.py
+++ b/lib/tool_shed/repository_registry.py
@@ -17,6 +17,7 @@
class Registry( object ):
def __init__( self, app ):
+ log.debug( "Loading the repository registry..." )
self.app = app
self.certified_level_one_clause_list = self.get_certified_level_one_clause_list()
# The following lists contain tuples like ( repository.name, repository.user.username, changeset_revision )
@@ -164,9 +165,11 @@
if tip_changeset_hash != suc.INITIAL_CHANGELOG_HASH:
certified_level_one_tuple = ( name, owner, tip_changeset_hash )
if repository.type == rt_util.REPOSITORY_SUITE_DEFINITION:
- self.certified_level_one_suite_tuples.append( certified_level_one_tuple )
+ if certified_level_one_tuple not in self.certified_level_one_suite_tuples:
+ self.certified_level_one_suite_tuples.append( certified_level_one_tuple )
else:
- self.certified_level_one_repository_and_suite_tuples.append( certified_level_one_tuple )
+ if certified_level_one_tuple not in self.certified_level_one_repository_and_suite_tuples:
+ self.certified_level_one_repository_and_suite_tuples.append( certified_level_one_tuple )
def load_repository_and_suite_tuple( self, repository ):
name = str( repository.name )
@@ -174,9 +177,11 @@
for repository_metadata in repository.metadata_revisions:
changeset_revision = str( repository_metadata.changeset_revision )
tuple = ( name, owner, changeset_revision )
- self.repository_and_suite_tuples.append( tuple )
+ if tuple not in self.repository_and_suite_tuples:
+ self.repository_and_suite_tuples.append( tuple )
if repository.type == rt_util.REPOSITORY_SUITE_DEFINITION:
- self.suite_tuples.append( tuple )
+ if tuple not in self.suite_tuples:
+ self.suite_tuples.append( tuple )
def load_repository_and_suite_tuples( self ):
# Load self.certified_level_one_repository_and_suite_tuples and self.certified_level_one_suite_tuples.
@@ -237,6 +242,55 @@
if repository.type in [ rt_util.REPOSITORY_SUITE_DEFINITION ]:
self.certified_level_one_viewable_suites_by_category[ category_name ] += 1
+ def remove_entry( self, repository ):
+ if repository:
+ is_valid = self.is_valid( repository )
+ for rca in repository.categories:
+ category = rca.category
+ category_name = str( category.name )
+ self.viewable_repositories_and_suites_by_category[ category_name ] -= 1
+ if is_valid:
+ self.viewable_valid_repositories_and_suites_by_category[ category_name ] -= 1
+ if repository.type == rt_util.REPOSITORY_SUITE_DEFINITION:
+ self.viewable_suites_by_category[ category_name ] -= 1
+ if is_valid:
+ self.viewable_valid_suites_by_category[ category_name ] -= 1
+ certified_level_one_tuple = self.get_certified_level_one_tuple( repository )
+ latest_installable_changeset_revision, is_level_one_certified = certified_level_one_tuple
+ if is_level_one_certified:
+ self.certified_level_one_viewable_repositories_and_suites_by_category[ category_name ] -= 1
+ if repository.type == rt_util.REPOSITORY_SUITE_DEFINITION:
+ self.certified_level_one_viewable_suites_by_category[ category_name ] -= 1
+ self.unload_repository_and_suite_tuple( repository )
+ if is_level_one_certified:
+ self.unload_certified_level_one_repository_and_suite_tuple( repository )
+
@property
def sa_session( self ):
return self.app.model.context.current
+
+ def unload_certified_level_one_repository_and_suite_tuple( self, repository ):
+ # The received repository has been determined to be level one certified.
+ name = str( repository.name )
+ owner = str( repository.user.username )
+ tip_changeset_hash = repository.tip( self.app )
+ if tip_changeset_hash != suc.INITIAL_CHANGELOG_HASH:
+ certified_level_one_tuple = ( name, owner, tip_changeset_hash )
+ if repository.type == rt_util.REPOSITORY_SUITE_DEFINITION:
+ if certified_level_one_tuple in self.certified_level_one_suite_tuples:
+ self.certified_level_one_suite_tuples.remove( certified_level_one_tuple )
+ else:
+ if certified_level_one_tuple in self.certified_level_one_repository_and_suite_tuples:
+ self.certified_level_one_repository_and_suite_tuples.remove( certified_level_one_tuple )
+
+ def unload_repository_and_suite_tuple( self, repository ):
+ name = str( repository.name )
+ owner = str( repository.user.username )
+ for repository_metadata in repository.metadata_revisions:
+ changeset_revision = str( repository_metadata.changeset_revision )
+ tuple = ( name, owner, changeset_revision )
+ if tuple in self.repository_and_suite_tuples:
+ self.repository_and_suite_tuples.remove( tuple )
+ if repository.type == rt_util.REPOSITORY_SUITE_DEFINITION:
+ if tuple in self.suite_tuples:
+ self.suite_tuples.remove( tuple )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0