1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a7bd59964f50/
changeset: a7bd59964f50
user: inithello
date: 2013-03-18 20:51:04
summary: Reference the right app.
affected #: 1 file
diff -r f19741fdb9a6b6f15f3e9b983d4a8228b205ffda -r a7bd59964f5053133897e6e7b89065a608e11d03 lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
--- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
+++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
@@ -399,7 +399,7 @@
tool_panel_dict = tool_util.generate_tool_panel_dict_for_new_install( metadata_dict[ 'tools' ], tool_section )
sample_files = metadata_dict.get( 'sample_files', [] )
tool_index_sample_files = tool_util.get_tool_index_sample_files( sample_files )
- tool_util.copy_sample_files( self.app, tool_index_sample_files, tool_path=tool_path )
+ tool_util.copy_sample_files( trans.app, tool_index_sample_files, tool_path=tool_path )
sample_files_copied = [ str( s ) for s in tool_index_sample_files ]
repository_tools_tups = suc.get_repository_tools_tups( trans.app, metadata_dict )
if repository_tools_tups:
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/7b5f97700fdc/
changeset: 7b5f97700fdc
branch: next-stable
user: inithello
date: 2013-03-18 19:32:06
summary: Fix unicode decoding error when displaying the contents of certain files. Catch any future errors.
affected #: 1 file
diff -r e0607a09d9fa9eb690e9b410d9c167072db0b55a -r 7b5f97700fdc8286db3e5ed6b6425127694ca42f lib/tool_shed/util/shed_util_common.py
--- a/lib/tool_shed/util/shed_util_common.py
+++ b/lib/tool_shed/util/shed_util_common.py
@@ -1059,7 +1059,12 @@
"""Translates the characters in text to an html string"""
if text:
if to_html:
- escaped_text = str( markupsafe.escape( text ) )
+ try:
+ escaped_text = text.decode( 'utf-8' )
+ escaped_text = escaped_text.encode( 'ascii', 'ignore' )
+ escaped_text = str( markupsafe.escape( escaped_text ) )
+ except UnicodeDecodeError, e:
+ escaped_text = "Error decoding string: %s" % str( e )
else:
escaped_text = str( text )
translated = []
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/51d3a88f45ee/
changeset: 51d3a88f45ee
user: inithello
date: 2013-03-18 19:32:06
summary: Fix unicode decoding error when displaying the contents of certain files. Catch any future errors.
affected #: 1 file
diff -r 7a4dd13dac9be2b3c9233b7a60e61d30d283744f -r 51d3a88f45ee2e3aa89395d2df13b5452d463274 lib/tool_shed/util/shed_util_common.py
--- a/lib/tool_shed/util/shed_util_common.py
+++ b/lib/tool_shed/util/shed_util_common.py
@@ -1059,7 +1059,12 @@
"""Translates the characters in text to an html string"""
if text:
if to_html:
- escaped_text = str( markupsafe.escape( text ) )
+ try:
+ escaped_text = text.decode( 'utf-8' )
+ escaped_text = escaped_text.encode( 'ascii', 'ignore' )
+ escaped_text = str( markupsafe.escape( escaped_text ) )
+ except UnicodeDecodeError, e:
+ escaped_text = "Error decoding string: %s" % str( e )
else:
escaped_text = str( text )
translated = []
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.
0 new commits in galaxy-central:
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/da3aece419ca/
changeset: da3aece419ca
user: greg
date: 2013-03-18 15:24:03
summary: Rename community_wsgi.ini.sample to be tool_shed_wsgi.ini.sample, run_community.sh to run_tool_shed.sh, and fix references to these files in the code.
affected #: 8 files
diff -r 6be1fed44bf65402f11d2bd4b576fa76941f1393 -r da3aece419ca2940c4a8a3a059e3bfe25a98098b community_wsgi.ini.sample
--- a/community_wsgi.ini.sample
+++ /dev/null
@@ -1,98 +0,0 @@
-# ---- HTTP Server ----------------------------------------------------------
-
-[server:main]
-
-use = egg:Paste#http
-port = 9009
-
-# The address on which to listen. By default, only listen to localhost (the tool shed will not
-# be accessible over the network). Use '0.0.0.0' to listen on all available network interfaces.
-#host = 0.0.0.0
-host = 127.0.0.1
-
-use_threadpool = true
-threadpool_workers = 10
-
-# ---- Galaxy Webapps Community Interface -------------------------------------------------
-
-[app:main]
-
-# Specifies the factory for the universe WSGI application
-paste.app_factory = galaxy.webapps.tool_shed.buildapp:app_factory
-log_level = DEBUG
-
-# Database connection
-database_file = database/community.sqlite
-# You may use a SQLAlchemy connection string to specify an external database instead
-#database_connection = postgres:///community_test?host=/var/run/postgresql
-
-# Where the hgweb.config file is stored. The default is the Galaxy installation directory.
-#hgweb_config_dir = None
-
-# Where dataset files are saved
-file_path = database/community_files
-# Temporary storage for additional datasets, this should be shared through the cluster
-new_file_path = database/tmp
-
-# Session support (beaker)
-use_beaker_session = True
-session_type = memory
-session_data_dir = %(here)s/database/beaker_sessions
-session_key = galaxysessions
-session_secret = changethisinproduction
-
-# -- Users and Security
-
-# Galaxy encodes various internal values when these values will be output in
-# some format (for example, in a URL or cookie). You should set a key to be
-# used by the algorithm that encodes and decodes these values. It can be any
-# string. If left unchanged, anyone could construct a cookie that would grant
-# them access to others' sessions.
-id_secret = changethisinproductiontoo
-
-# User authentication can be delegated to an upstream proxy server (usually
-# Apache). The upstream proxy should set a REMOTE_USER header in the request.
-# Enabling remote user disables regular logins. For more information, see:
-# http://wiki.g2.bx.psu.edu/Admin/Config/Apache%20Proxy
-#use_remote_user = False
-
-# Configuration for debugging middleware
-debug = true
-use_lint = false
-
-# NEVER enable this on a public site (even test or QA)
-# use_interactive = true
-
-# this should be a comma-separated list of valid Galaxy users
-#admin_users = user1@example.org,user2@example.org
-
-# Force everyone to log in (disable anonymous access)
-require_login = False
-
-# path to sendmail
-sendmail_path = /usr/sbin/sendmail
-
-# For use by email messages sent from the tool shed
-#smtp_server = smtp.your_tool_shed_server
-#email_from = your_tool_shed_email@server
-
-# The URL linked by the "Support" link in the "Help" menu.
-#support_url = http://wiki.g2.bx.psu.edu/Support
-
-# Write thread status periodically to 'heartbeat.log' (careful, uses disk space rapidly!)
-## use_heartbeat = True
-
-# Profiling middleware (cProfile based)
-## use_profile = True
-
-# Use the new iframe / javascript based layout
-use_new_layout = true
-
-# Serving static files (needed if running standalone)
-static_enabled = True
-static_cache_time = 360
-static_dir = %(here)s/static/
-static_images_dir = %(here)s/static/images
-static_favicon_dir = %(here)s/static/favicon.ico
-static_scripts_dir = %(here)s/static/scripts/
-static_style_dir = %(here)s/static/june_2007_style/blue
diff -r 6be1fed44bf65402f11d2bd4b576fa76941f1393 -r da3aece419ca2940c4a8a3a059e3bfe25a98098b run_community.sh
--- a/run_community.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-
-cd `dirname $0`
-
-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
- openid_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/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
-
-python ./scripts/paster.py serve community_wsgi.ini --pid-file=community_webapp.pid --log-file=community_webapp.log $@
diff -r 6be1fed44bf65402f11d2bd4b576fa76941f1393 -r da3aece419ca2940c4a8a3a059e3bfe25a98098b run_tool_shed.sh
--- /dev/null
+++ b/run_tool_shed.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+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
+ 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
+"
+
+# 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
+
+python ./scripts/paster.py serve tool_shed_wsgi.ini --pid-file=tool_shed_webapp.pid --log-file=tool_shed_webapp.log $@
diff -r 6be1fed44bf65402f11d2bd4b576fa76941f1393 -r da3aece419ca2940c4a8a3a059e3bfe25a98098b scripts/db_shell.py
--- a/scripts/db_shell.py
+++ b/scripts/db_shell.py
@@ -30,7 +30,7 @@
# Need to pop the last arg so the command line args will be correct
# for sqlalchemy-migrate
webapp = sys.argv.pop()
- config_file = 'community_wsgi.ini'
+ config_file = 'tool_shed_wsgi.ini'
repo = 'lib/galaxy/webapps/tool_shed/model/migrate'
else:
# Poor man's optparse
diff -r 6be1fed44bf65402f11d2bd4b576fa76941f1393 -r da3aece419ca2940c4a8a3a059e3bfe25a98098b scripts/manage_db.py
--- a/scripts/manage_db.py
+++ b/scripts/manage_db.py
@@ -18,7 +18,7 @@
# Need to pop the last arg so the command line args will be correct
# for sqlalchemy-migrate
webapp = sys.argv.pop()
- config_file = 'community_wsgi.ini'
+ config_file = 'tool_shed_wsgi.ini'
repo = 'lib/galaxy/webapps/tool_shed/model/migrate'
else:
# Poor man's optparse
diff -r 6be1fed44bf65402f11d2bd4b576fa76941f1393 -r da3aece419ca2940c4a8a3a059e3bfe25a98098b scripts/tool_shed/migrate_tools_to_repositories.py
--- a/scripts/tool_shed/migrate_tools_to_repositories.py
+++ b/scripts/tool_shed/migrate_tools_to_repositories.py
@@ -10,7 +10,7 @@
0. This script must be run on a repo updated to changeset: 5621:4618be57481b
-1. Before running this script, make sure the following config setting is set in community_wsgi.ini
+1. Before running this script, make sure the following config setting is set in tool_shed_wsgi.ini
# Enable next-gen tool shed features
enable_next_gen_tool_shed = True
@@ -262,7 +262,7 @@
print " "
print "##########################################"
print "%s - Migrating current tool archives to new tool repositories" % now
- # community_wsgi.ini file
+ # tool_shed_wsgi.ini file
ini_file = sys.argv[1]
conf_parser = ConfigParser.ConfigParser( {'here':os.getcwd()} )
conf_parser.read( ini_file )
diff -r 6be1fed44bf65402f11d2bd4b576fa76941f1393 -r da3aece419ca2940c4a8a3a059e3bfe25a98098b test/tool_shed/functional_tests.py
--- a/test/tool_shed/functional_tests.py
+++ b/test/tool_shed/functional_tests.py
@@ -175,7 +175,7 @@
os.environ[ 'TOOL_SHED_TEST_TOOL_DATA_TABLE_CONF' ] = shed_tool_data_table_conf_file
# ---- Build Tool Shed Application --------------------------------------------------
toolshedapp = None
- global_conf = { '__file__' : 'community_wsgi.ini.sample' }
+ global_conf = { '__file__' : 'tool_shed_wsgi.ini.sample' }
# if not toolshed_database_connection.startswith( 'sqlite://' ):
# kwargs[ 'database_engine_option_max_overflow' ] = '20'
if tool_dependency_dir is not None:
diff -r 6be1fed44bf65402f11d2bd4b576fa76941f1393 -r da3aece419ca2940c4a8a3a059e3bfe25a98098b tool_shed_wsgi.ini.sample
--- /dev/null
+++ b/tool_shed_wsgi.ini.sample
@@ -0,0 +1,98 @@
+# ---- HTTP Server ----------------------------------------------------------
+
+[server:main]
+
+use = egg:Paste#http
+port = 9009
+
+# The address on which to listen. By default, only listen to localhost (the tool shed will not
+# be accessible over the network). Use '0.0.0.0' to listen on all available network interfaces.
+#host = 0.0.0.0
+host = 127.0.0.1
+
+use_threadpool = true
+threadpool_workers = 10
+
+# ---- Galaxy Webapps Community Interface -------------------------------------------------
+
+[app:main]
+
+# Specifies the factory for the universe WSGI application
+paste.app_factory = galaxy.webapps.tool_shed.buildapp:app_factory
+log_level = DEBUG
+
+# Database connection
+database_file = database/community.sqlite
+# You may use a SQLAlchemy connection string to specify an external database instead
+#database_connection = postgres:///community_test?host=/var/run/postgresql
+
+# Where the hgweb.config file is stored. The default is the Galaxy installation directory.
+#hgweb_config_dir = None
+
+# Where dataset files are saved
+file_path = database/community_files
+# Temporary storage for additional datasets, this should be shared through the cluster
+new_file_path = database/tmp
+
+# Session support (beaker)
+use_beaker_session = True
+session_type = memory
+session_data_dir = %(here)s/database/beaker_sessions
+session_key = galaxysessions
+session_secret = changethisinproduction
+
+# -- Users and Security
+
+# Galaxy encodes various internal values when these values will be output in
+# some format (for example, in a URL or cookie). You should set a key to be
+# used by the algorithm that encodes and decodes these values. It can be any
+# string. If left unchanged, anyone could construct a cookie that would grant
+# them access to others' sessions.
+id_secret = changethisinproductiontoo
+
+# User authentication can be delegated to an upstream proxy server (usually
+# Apache). The upstream proxy should set a REMOTE_USER header in the request.
+# Enabling remote user disables regular logins. For more information, see:
+# http://wiki.g2.bx.psu.edu/Admin/Config/Apache%20Proxy
+#use_remote_user = False
+
+# Configuration for debugging middleware
+debug = true
+use_lint = false
+
+# NEVER enable this on a public site (even test or QA)
+# use_interactive = true
+
+# this should be a comma-separated list of valid Galaxy users
+#admin_users = user1@example.org,user2@example.org
+
+# Force everyone to log in (disable anonymous access)
+require_login = False
+
+# path to sendmail
+sendmail_path = /usr/sbin/sendmail
+
+# For use by email messages sent from the tool shed
+#smtp_server = smtp.your_tool_shed_server
+#email_from = your_tool_shed_email@server
+
+# The URL linked by the "Support" link in the "Help" menu.
+#support_url = http://wiki.g2.bx.psu.edu/Support
+
+# Write thread status periodically to 'heartbeat.log' (careful, uses disk space rapidly!)
+## use_heartbeat = True
+
+# Profiling middleware (cProfile based)
+## use_profile = True
+
+# Use the new iframe / javascript based layout
+use_new_layout = true
+
+# Serving static files (needed if running standalone)
+static_enabled = True
+static_cache_time = 360
+static_dir = %(here)s/static/
+static_images_dir = %(here)s/static/images
+static_favicon_dir = %(here)s/static/favicon.ico
+static_scripts_dir = %(here)s/static/scripts/
+static_style_dir = %(here)s/static/june_2007_style/blue
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/6be1fed44bf6/
changeset: 6be1fed44bf6
user: jgoecks
date: 2013-03-18 15:09:43
summary: Import clean up and documentation for compute tool.
affected #: 1 file
diff -r 0ddc03509b24d4d4e9024902546025df185c6a18 -r 6be1fed44bf65402f11d2bd4b576fa76941f1393 tools/stats/column_maker.py
--- a/tools/stats/column_maker.py
+++ b/tools/stats/column_maker.py
@@ -1,13 +1,13 @@
#!/usr/bin/env python
# This tool takes a tab-delimited textfile as input and creates another column in the file which is the result of
# a computation performed on every row in the original file. The tool will skip over invalid lines within the file,
-# informing the user about the number of lines skipped.
-import sys, re, os.path
-from galaxy import eggs
-from galaxy.tools import validation
-from galaxy.datatypes import metadata
+# informing the user about the number of lines skipped.
+
+import sys, re
+# These functions may be used in compute expression:
from math import log,exp,sqrt,ceil,floor
+
assert sys.version_info[:2] >= ( 2, 4 )
def stop_err( msg ):
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/0ddc03509b24/
changeset: 0ddc03509b24
user: greg
date: 2013-03-18 14:55:28
summary: Eliminate a duplicate method from shed_util_common and add missing documentation to several utility methods.
affected #: 6 files
diff -r 92275794f6efe2f2e17c2d3785061e88f2f23f84 -r 0ddc03509b24d4d4e9024902546025df185c6a18 lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
--- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
+++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
@@ -184,7 +184,7 @@
params = util.Params( kwd )
repository_id = params.get( 'id', None )
repository = suc.get_installed_tool_shed_repository( trans, repository_id )
- tool_shed_url = suc.get_url_from_repository_tool_shed( trans.app, repository )
+ tool_shed_url = suc.get_url_from_tool_shed( trans.app, repository.tool_shed )
url = suc.url_join( tool_shed_url,
'repository/check_for_updates?galaxy_url=%s&name=%s&owner=%s&changeset_revision=%s' % \
( web.url_for( '/', qualified=True ), repository.name, repository.owner, repository.changeset_revision ) )
@@ -314,7 +314,7 @@
need it so that we can derive the tool shed from which it was installed.
"""
repository = suc.get_installed_tool_shed_repository( trans, repository_id )
- tool_shed_url = suc.get_url_from_repository_tool_shed( trans.app, repository )
+ tool_shed_url = suc.get_url_from_tool_shed( trans.app, repository.tool_shed )
url = suc.url_join( tool_shed_url,
'repository/get_repository_dependencies?name=%s&owner=%s&changeset_revision=%s' % \
( repository_name, repository_owner, changeset_revision ) )
@@ -337,7 +337,7 @@
it so that we can derive the tool shed from which it was installed.
"""
repository = suc.get_installed_tool_shed_repository( trans, repository_id )
- tool_shed_url = suc.get_url_from_repository_tool_shed( trans.app, repository )
+ tool_shed_url = suc.get_url_from_tool_shed( trans.app, repository.tool_shed )
url = suc.url_join( tool_shed_url,
'repository/get_tool_dependencies?name=%s&owner=%s&changeset_revision=%s' % \
( repository_name, repository_owner, changeset_revision ) )
@@ -359,7 +359,7 @@
uninstalled tool shed repository.
"""
repository = suc.get_installed_tool_shed_repository( trans, repository_id )
- tool_shed_url = suc.get_url_from_repository_tool_shed( trans.app, repository )
+ tool_shed_url = suc.get_url_from_tool_shed( trans.app, repository.tool_shed )
url = suc.url_join( tool_shed_url,
'repository/get_updated_repository_information?name=%s&owner=%s&changeset_revision=%s' % \
( repository_name, repository_owner, changeset_revision ) )
@@ -654,7 +654,7 @@
suc.update_tool_shed_repository_status( trans.app,
tool_shed_repository,
trans.model.ToolShedRepository.installation_status.SETTING_TOOL_VERSIONS )
- tool_shed_url = suc.get_url_from_repository_tool_shed( trans.app, tool_shed_repository )
+ tool_shed_url = suc.get_url_from_tool_shed( trans.app, tool_shed_repository.tool_shed )
url = suc.url_join( tool_shed_url,
'/repository/get_tool_versions?name=%s&owner=%s&changeset_revision=%s' % \
( tool_shed_repository.name, tool_shed_repository.owner, tool_shed_repository.changeset_revision ) )
@@ -711,7 +711,7 @@
repository = suc.get_installed_tool_shed_repository( trans, repository_id )
if not repository:
return trans.show_error_message( 'Invalid repository specified.' )
- tool_shed_url = suc.get_url_from_repository_tool_shed( trans.app, repository )
+ tool_shed_url = suc.get_url_from_tool_shed( trans.app, repository.tool_shed )
if repository.status in [ trans.model.ToolShedRepository.installation_status.CLONING ]:
tool_shed_repository_ids = [ repository_id ]
return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
@@ -1172,7 +1172,7 @@
clone_dir = os.path.join( tool_path, suc.generate_tool_shed_repository_install_dir( repository_clone_url,
tool_shed_repository.installed_changeset_revision ) )
relative_install_dir = os.path.join( clone_dir, tool_shed_repository.name )
- tool_shed_url = suc.get_url_from_repository_tool_shed( trans.app, tool_shed_repository )
+ tool_shed_url = suc.get_url_from_tool_shed( trans.app, tool_shed_repository.tool_shed )
tool_section = None
tool_panel_section = kwd.get( 'tool_panel_section', '' )
new_tool_panel_section = kwd.get( 'new_tool_panel_section', '' )
@@ -1317,7 +1317,7 @@
tool_shed_repository = suc.get_installed_tool_shed_repository( trans, repository_id )
repository_clone_url = suc.generate_clone_url_for_installed_repository( trans.app, tool_shed_repository )
metadata = tool_shed_repository.metadata
- tool_shed_url = suc.get_url_from_repository_tool_shed( trans.app, tool_shed_repository )
+ tool_shed_url = suc.get_url_from_tool_shed( trans.app, tool_shed_repository.tool_shed )
tool_path, relative_install_dir = tool_shed_repository.get_tool_relative_path( trans.app )
if latest_changeset_revision and latest_ctx_rev:
# There are updates available in the tool shed for the repository, so use the receieved dependency information which was retrieved from
@@ -1481,7 +1481,7 @@
def reset_repository_metadata( self, trans, id ):
"""Reset all metadata on a single installed tool shed repository."""
repository = suc.get_installed_tool_shed_repository( trans, id )
- tool_shed_url = suc.get_url_from_repository_tool_shed( trans.app, repository )
+ tool_shed_url = suc.get_url_from_tool_shed( trans.app, repository.tool_shed )
repository_clone_url = suc.generate_clone_url_for_installed_repository( trans.app, repository )
tool_path, relative_install_dir = repository.get_tool_relative_path( trans.app )
if relative_install_dir:
@@ -1560,7 +1560,7 @@
metadata for the repository's revision in the Galaxy database.
"""
repository = suc.get_installed_tool_shed_repository( trans, kwd[ 'id' ] )
- tool_shed_url = suc.get_url_from_repository_tool_shed( trans.app, repository )
+ tool_shed_url = suc.get_url_from_tool_shed( trans.app, repository.tool_shed )
url = suc.url_join( tool_shed_url,
'repository/get_tool_versions?name=%s&owner=%s&changeset_revision=%s' % \
( repository.name, repository.owner, repository.changeset_revision ) )
diff -r 92275794f6efe2f2e17c2d3785061e88f2f23f84 -r 0ddc03509b24d4d4e9024902546025df185c6a18 lib/tool_shed/galaxy_install/install_manager.py
--- a/lib/tool_shed/galaxy_install/install_manager.py
+++ b/lib/tool_shed/galaxy_install/install_manager.py
@@ -279,7 +279,7 @@
if self.__isinstalled( clone_dir ):
print "Skipping automatic install of repository '", name, "' because it has already been installed in location ", clone_dir
else:
- tool_shed_url = self.__get_url_from_tool_shed( self.tool_shed )
+ tool_shed_url = suc.get_url_from_tool_shed( self.app, self.tool_shed )
repository_clone_url = os.path.join( tool_shed_url, 'repos', self.repository_owner, name )
relative_install_dir = os.path.join( relative_clone_dir, name )
install_dir = os.path.join( clone_dir, name )
@@ -351,16 +351,6 @@
@property
def non_shed_tool_panel_configs( self ):
return common_util.get_non_shed_tool_panel_configs( self.app )
- def __get_url_from_tool_shed( self, tool_shed ):
- # The value of tool_shed is something like: toolshed.g2.bx.psu.edu. We need the URL to this tool shed, which is something like:
- # http://toolshed.g2.bx.psu.edu/
- for shed_name, shed_url in self.app.tool_shed_registry.tool_sheds.items():
- if shed_url.find( tool_shed ) >= 0:
- if shed_url.endswith( '/' ):
- shed_url = shed_url.rstrip( '/' )
- return shed_url
- # The tool shed from which the repository was originally installed must no longer be configured in tool_sheds_conf.xml.
- return None
def __isinstalled( self, clone_dir ):
full_path = os.path.abspath( clone_dir )
if os.path.exists( full_path ):
diff -r 92275794f6efe2f2e17c2d3785061e88f2f23f84 -r 0ddc03509b24d4d4e9024902546025df185c6a18 lib/tool_shed/galaxy_install/repository_util.py
--- a/lib/tool_shed/galaxy_install/repository_util.py
+++ b/lib/tool_shed/galaxy_install/repository_util.py
@@ -77,7 +77,7 @@
def get_update_to_changeset_revision_and_ctx_rev( trans, repository ):
"""Return the changeset revision hash to which the repository can be updated."""
changeset_revision_dict = {}
- tool_shed_url = suc.get_url_from_repository_tool_shed( trans.app, repository )
+ tool_shed_url = suc.get_url_from_tool_shed( trans.app, repository.tool_shed )
url = suc.url_join( tool_shed_url, 'repository/get_changeset_revision_and_ctx_rev?name=%s&owner=%s&changeset_revision=%s' % \
( repository.name, repository.owner, repository.installed_changeset_revision ) )
try:
diff -r 92275794f6efe2f2e17c2d3785061e88f2f23f84 -r 0ddc03509b24d4d4e9024902546025df185c6a18 lib/tool_shed/galaxy_install/update_manager.py
--- a/lib/tool_shed/galaxy_install/update_manager.py
+++ b/lib/tool_shed/galaxy_install/update_manager.py
@@ -34,7 +34,7 @@
self.sleeper.sleep( self.seconds_to_sleep )
log.info( 'Transfer job restarter shutting down...' )
def check_for_update( self, repository ):
- tool_shed_url = suc.get_url_from_repository_tool_shed( self.app, repository )
+ tool_shed_url = suc.get_url_from_tool_shed( self.app, repository.tool_shed )
url = '%s/repository/check_for_updates?name=%s&owner=%s&changeset_revision=%s&from_update_manager=True' % \
( tool_shed_url, repository.name, repository.owner, repository.changeset_revision )
try:
diff -r 92275794f6efe2f2e17c2d3785061e88f2f23f84 -r 0ddc03509b24d4d4e9024902546025df185c6a18 lib/tool_shed/util/metadata_util.py
--- a/lib/tool_shed/util/metadata_util.py
+++ b/lib/tool_shed/util/metadata_util.py
@@ -1432,7 +1432,7 @@
def reset_all_metadata_on_installed_repository( trans, id ):
"""Reset all metadata on a single tool shed repository installed into a Galaxy instance."""
repository = suc.get_installed_tool_shed_repository( trans, id )
- tool_shed_url = suc.get_url_from_repository_tool_shed( trans.app, repository )
+ tool_shed_url = suc.get_url_from_tool_shed( trans.app, repository.tool_shed )
repository_clone_url = suc.generate_clone_url_for_installed_repository( trans.app, repository )
tool_path, relative_install_dir = repository.get_tool_relative_path( trans.app )
if relative_install_dir:
diff -r 92275794f6efe2f2e17c2d3785061e88f2f23f84 -r 0ddc03509b24d4d4e9024902546025df185c6a18 lib/tool_shed/util/shed_util_common.py
--- a/lib/tool_shed/util/shed_util_common.py
+++ b/lib/tool_shed/util/shed_util_common.py
@@ -160,7 +160,7 @@
return False, error_message
def config_elems_to_xml_file( app, config_elems, config_filename, tool_path ):
- # Persist the current in-memory list of config_elems to a file named by the value of config_filename.
+ """Persist the current in-memory list of config_elems to a file named by the value of config_filename."""
fd, filename = tempfile.mkstemp()
os.write( fd, '<?xml version="1.0"?>\n' )
os.write( fd, '<toolbox tool_path="%s">\n' % str( tool_path ) )
@@ -242,7 +242,7 @@
def generate_clone_url_for_installed_repository( app, repository ):
"""Generate the URL for cloning a repository that has been installed into a Galaxy instance."""
- tool_shed_url = get_url_from_repository_tool_shed( app, repository )
+ tool_shed_url = get_url_from_tool_shed( app, repository.tool_shed )
return url_join( tool_shed_url, 'repos', repository.owner, repository.name )
def generate_clone_url_for_repository_in_tool_shed( trans, repository ):
@@ -469,7 +469,7 @@
return None
def get_installed_tool_shed_repository( trans, id ):
- """Get a repository on the Galaxy side from the database via id"""
+ """Get a tool shed repository record from the Galaxy database defined by the id."""
return trans.sa_session.query( trans.model.ToolShedRepository ).get( trans.security.decode_id( id ) )
def get_named_tmpfile_from_ctx( ctx, filename, dir ):
@@ -516,6 +516,11 @@
return None
def get_or_create_tool_shed_repository( trans, tool_shed, name, owner, changeset_revision ):
+ """
+ Return a tool shed repository database record defined by the combination of tool shed, repository name, repository owner and changeset_revision
+ or installed_changeset_revision. A new tool shed repository record will be created if one is not located.
+ """
+ # This method is used only in Galaxy, not the tool shed.
repository = get_repository_for_dependency_relationship( trans.app, tool_shed, name, owner, changeset_revision )
if not repository:
tool_shed_url = get_url_from_tool_shed( trans.app, tool_shed )
@@ -572,7 +577,7 @@
previous_changeset_revision = changeset_revision
def get_repo_info_tuple_contents( repo_info_tuple ):
- # Take care in handling the repo_info_tuple as it evolves over time as new tool shed features are introduced.
+ """Take care in handling the repo_info_tuple as it evolves over time as new tool shed features are introduced."""
if len( repo_info_tuple ) == 6:
description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, tool_dependencies = repo_info_tuple
repository_dependencies = None
@@ -613,6 +618,8 @@
return None
def get_repository_for_dependency_relationship( app, tool_shed, name, owner, changeset_revision ):
+ """Return a tool shed repository database record that is defined by either the current changeset revision or the installed_changeset_revision."""
+ # This method is used only in Galaxy, not the tool shed.
repository = get_tool_shed_repository_by_shed_name_owner_installed_changeset_revision( app=app,
tool_shed=tool_shed,
name=name,
@@ -627,6 +634,7 @@
return repository
def get_repository_file_contents( file_path ):
+ """Return the display-safe contents of a repository file."""
if checkers.is_gzip( file_path ):
safe_str = to_safe_string( '\ngzip compressed file\n' )
elif checkers.is_bz2( file_path ):
@@ -646,6 +654,7 @@
return safe_str
def get_repository_files( trans, folder_path ):
+ """Return the file hierarchy of a tool shed repository."""
contents = []
for item in os.listdir( folder_path ):
# Skip .hg directories
@@ -684,6 +693,7 @@
return None
def get_repository_owner( cleaned_repository_url ):
+ """Gvien a "cleaned" repository clone URL, return the owner of the repository."""
items = cleaned_repository_url.split( '/repos/' )
repo_path = items[ 1 ]
if repo_path.startswith( '/' ):
@@ -691,11 +701,13 @@
return repo_path.lstrip( '/' ).split( '/' )[ 0 ]
def get_repository_owner_from_clone_url( repository_clone_url ):
+ """Given a repository clone URL, return the owner of the repository."""
tmp_url = clean_repository_clone_url( repository_clone_url )
tool_shed = tmp_url.split( '/repos/' )[ 0 ].rstrip( '/' )
return get_repository_owner( tmp_url )
def get_repository_tools_tups( app, metadata_dict ):
+ """Return a list of tuples of the form (relative_path, guid, tool) for each tool defined in the received tool shed repository metadata."""
repository_tools_tups = []
index, shed_conf_dict = get_shed_tool_conf_dict( app, metadata_dict.get( 'shed_config_filename' ) )
if 'tools' in metadata_dict:
@@ -713,6 +725,7 @@
return repository_tools_tups
def get_reversed_changelog_changesets( repo ):
+ """Return a list of changesets in reverse order from that provided by the repository manifest."""
reversed_changelog = []
for changeset in repo.changelog:
reversed_changelog.insert( 0, changeset )
@@ -728,6 +741,7 @@
return "-1:%s" % changeset_revision
def get_rev_label_from_changeset_revision( repo, changeset_revision ):
+ """Given a changeset revision hash, return two strings, the changeset rev and the changeset revision hash."""
ctx = get_changectx_for_changeset( repo, changeset_revision )
if ctx:
rev = '%04d' % ctx.rev()
@@ -748,8 +762,10 @@
return index, shed_tool_conf_dict
def get_tool_panel_config_tool_path_install_dir( app, repository ):
- # Return shed-related tool panel config, the tool_path configured in it, and the relative path to the directory where the
- # repository is installed. This method assumes all repository tools are defined in a single shed-related tool panel config.
+ """
+ Return shed-related tool panel config, the tool_path configured in it, and the relative path to the directory where the repository is installed.
+ This method assumes all repository tools are defined in a single shed-related tool panel config.
+ """
tool_shed = clean_tool_shed_url( repository.tool_shed )
partial_install_dir = '%s/repos/%s/%s/%s' % ( tool_shed, repository.owner, repository.name, repository.installed_changeset_revision )
# Get the relative tool installation paths from each of the shed tool configs.
@@ -782,11 +798,14 @@
return None
def get_tool_shed_repository_by_id( trans, repository_id ):
+ """Return a tool shed repository database record defined by the id."""
+ # This method is used only in Galaxy, not the tool shed.
return trans.sa_session.query( trans.model.ToolShedRepository ) \
.filter( trans.model.ToolShedRepository.table.c.id == trans.security.decode_id( repository_id ) ) \
.first()
def get_tool_shed_repository_by_shed_name_owner_changeset_revision( app, tool_shed, name, owner, changeset_revision ):
+ """Return a tool shed repository database record defined by the combination of a tool_shed, repository name, repository owner and current changeet_revision."""
# This method is used only in Galaxy, not the tool shed.
sa_session = app.model.context.current
if tool_shed.find( '//' ) > 0:
@@ -800,6 +819,7 @@
.first()
def get_tool_shed_repository_by_shed_name_owner_installed_changeset_revision( app, tool_shed, name, owner, installed_changeset_revision ):
+ """Return a tool shed repository database record defined by the combination of a tool_shed, repository name, repository owner and installed_changeet_revision."""
# This method is used only in Galaxy, not the tool shed.
sa_session = app.model.context.current
if tool_shed.find( '//' ) > 0:
@@ -816,23 +836,12 @@
tmp_url = clean_repository_clone_url( repository_clone_url )
return tmp_url.split( '/repos/' )[ 0 ].rstrip( '/' )
-def get_url_from_repository_tool_shed( app, repository ):
+def get_url_from_tool_shed( app, tool_shed ):
"""
- The stored value of repository.tool_shed is something like: toolshed.g2.bx.psu.edu. We need the URL to this tool shed, which is
- something like: http://toolshed.g2.bx.psu.edu/.
+ The value of tool_shed is something like: toolshed.g2.bx.psu.edu. We need the URL to this tool shed, which is something like:
+ http://toolshed.g2.bx.psu.edu/
"""
for shed_name, shed_url in app.tool_shed_registry.tool_sheds.items():
- if shed_url.find( repository.tool_shed ) >= 0:
- if shed_url.endswith( '/' ):
- shed_url = shed_url.rstrip( '/' )
- return shed_url
- # The tool shed from which the repository was originally installed must no longer be configured in tool_sheds_conf.xml.
- return None
-
-def get_url_from_tool_shed( app, tool_shed ):
- # The value of tool_shed is something like: toolshed.g2.bx.psu.edu. We need the URL to this tool shed, which is something like:
- # http://toolshed.g2.bx.psu.edu/
- for shed_name, shed_url in app.tool_shed_registry.tool_sheds.items():
if shed_url.find( tool_shed ) >= 0:
if shed_url.endswith( '/' ):
shed_url = shed_url.rstrip( '/' )
@@ -856,26 +865,28 @@
return None
def handle_email_alerts( trans, repository, content_alert_str='', new_repo_alert=False, admin_only=False ):
- # There are 2 complementary features that enable a tool shed user to receive email notification:
- # 1. Within User Preferences, they can elect to receive email when the first (or first valid)
- # change set is produced for a new repository.
- # 2. When viewing or managing a repository, they can check the box labeled "Receive email alerts"
- # which caused them to receive email alerts when updates to the repository occur. This same feature
- # is available on a per-repository basis on the repository grid within the tool shed.
- #
- # There are currently 4 scenarios for sending email notification when a change is made to a repository:
- # 1. An admin user elects to receive email when the first change set is produced for a new repository
- # from User Preferences. The change set does not have to include any valid content. This allows for
- # the capture of inappropriate content being uploaded to new repositories.
- # 2. A regular user elects to receive email when the first valid change set is produced for a new repository
- # from User Preferences. This differs from 1 above in that the user will not receive email until a
- # change set tha tincludes valid content is produced.
- # 3. An admin user checks the "Receive email alerts" check box on the manage repository page. Since the
- # user is an admin user, the email will include information about both HTML and image content that was
- # included in the change set.
- # 4. A regular user checks the "Receive email alerts" check box on the manage repository page. Since the
- # user is not an admin user, the email will not include any information about both HTML and image content
- # that was included in the change set.
+ """
+ There are 2 complementary features that enable a tool shed user to receive email notification:
+ 1. Within User Preferences, they can elect to receive email when the first (or first valid)
+ change set is produced for a new repository.
+ 2. When viewing or managing a repository, they can check the box labeled "Receive email alerts"
+ which caused them to receive email alerts when updates to the repository occur. This same feature
+ is available on a per-repository basis on the repository grid within the tool shed.
+
+ There are currently 4 scenarios for sending email notification when a change is made to a repository:
+ 1. An admin user elects to receive email when the first change set is produced for a new repository
+ from User Preferences. The change set does not have to include any valid content. This allows for
+ the capture of inappropriate content being uploaded to new repositories.
+ 2. A regular user elects to receive email when the first valid change set is produced for a new repository
+ from User Preferences. This differs from 1 above in that the user will not receive email until a
+ change set tha tincludes valid content is produced.
+ 3. An admin user checks the "Receive email alerts" check box on the manage repository page. Since the
+ user is an admin user, the email will include information about both HTML and image content that was
+ included in the change set.
+ 4. A regular user checks the "Receive email alerts" check box on the manage repository page. Since the
+ user is not an admin user, the email will not include any information about both HTML and image content
+ that was included in the change set.
+ """
repo_dir = repository.repo_path( trans.app )
repo = hg.repository( get_configured_ui(), repo_dir )
sharable_link = generate_sharable_link_for_repository_in_tool_shed( trans, repository, changeset_revision=None )
@@ -948,6 +959,7 @@
log.exception( "An error occurred sending a tool shed repository update alert by email." )
def open_repository_files_folder( trans, folder_path ):
+ """Return a list of dictionaries, each of which contains information for a file or directory contained within a directory in a repository file hierarchy."""
try:
files_list = get_repository_files( trans, folder_path )
except OSError, e:
@@ -957,19 +969,20 @@
folder_contents = []
for filename in files_list:
is_folder = False
- if filename and filename[-1] == os.sep:
+ if filename and filename[ -1 ] == os.sep:
is_folder = True
if filename:
full_path = os.path.join( folder_path, filename )
- node = { "title": filename,
- "isFolder": is_folder,
- "isLazy": is_folder,
- "tooltip": full_path,
- "key": full_path }
+ node = { "title" : filename,
+ "isFolder" : is_folder,
+ "isLazy" : is_folder,
+ "tooltip" : full_path,
+ "key" : full_path }
folder_contents.append( node )
return folder_contents
def remove_dir( dir ):
+ """Attempt to remove a directory from disk."""
if os.path.exists( dir ):
try:
shutil.rmtree( dir )
@@ -1029,9 +1042,11 @@
return reversed_changelog
def reversed_upper_bounded_changelog( repo, included_upper_bounds_changeset_revision ):
+ """Return a reversed list of changesets in the repository changelog up to and including the included_upper_bounds_changeset_revision."""
return reversed_lower_upper_bounded_changelog( repo, INITIAL_CHANGELOG_HASH, included_upper_bounds_changeset_revision )
def strip_path( fpath ):
+ """Attempt to strip the path from a file name."""
if not fpath:
return fpath
try:
@@ -1072,12 +1087,15 @@
return text
def tool_shed_from_repository_clone_url( repository_clone_url ):
+ """Given a repository clone URL, return the tool shed that contains the repository."""
return clean_repository_clone_url( repository_clone_url ).split( '/repos/' )[ 0 ].rstrip( '/' )
def tool_shed_is_this_tool_shed( toolshed_base_url ):
+ """Determine if a tool shed is the current tool shed."""
return toolshed_base_url.rstrip( '/' ) == str( url_for( '/', qualified=True ) ).rstrip( '/' )
def translate_string( raw_text, to_html=True ):
+ """Return a subset of a string (up to MAX_CONTENT_SIZE) translated to a safe string for display in a browser."""
if raw_text:
if len( raw_text ) <= MAX_CONTENT_SIZE:
translated_string = to_safe_string( raw_text, to_html=to_html )
@@ -1141,12 +1159,14 @@
commands.update( get_configured_ui(), repo, rev=ctx_rev )
def update_tool_shed_repository_status( app, tool_shed_repository, status ):
+ """Update the status of a tool shed repository in the process of being installed into Galaxy."""
sa_session = app.model.context.current
tool_shed_repository.status = status
sa_session.add( tool_shed_repository )
sa_session.flush()
def url_join( *args ):
+ """Return a valid URL produced by appending a base URL and a set of request parameters."""
parts = []
for arg in args:
parts.append( arg.strip( '/' ) )
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.