commit/galaxy-central: greg: Fixes for sending file contents to the tool shed.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/65a81aead95e/ Changeset: 65a81aead95e User: greg Date: 2013-05-12 17:52:55 Summary: Fixes for sending file contents to the tool shed. Affected #: 4 files diff -r bc5cd95d042bc062c688bee6b3e9cbf74d853fb1 -r 65a81aead95e147f709ee3969d49766f35d6a2e2 lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py --- a/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py +++ b/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py @@ -362,4 +362,3 @@ elif isinstance( installed_tool_shed_repositories, list ): all_installed_tool_shed_repositories.extend( installed_tool_shed_repositories ) return all_installed_tool_shed_repositories - diff -r bc5cd95d042bc062c688bee6b3e9cbf74d853fb1 -r 65a81aead95e147f709ee3969d49766f35d6a2e2 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 @@ -1406,6 +1406,15 @@ message=message, status=status ) + @web.expose + def stream_file_contents( self, trans, encoded_tmp_file_name ): + tmp_file_name = encoding_util.tool_shed_decode( encoded_tmp_file_name ) + if os.path.exists( tmp_file_name ): + return open( tmp_file_name, 'r' ) + else: + log.debug( "The required temporary file '%s' cannot be located." % str( tmp_file_name ) ) + return '' + @web.json def tool_dependency_status_updates( self, trans, ids=None, status_list=None ): # Avoid caching diff -r bc5cd95d042bc062c688bee6b3e9cbf74d853fb1 -r 65a81aead95e147f709ee3969d49766f35d6a2e2 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 @@ -1491,11 +1491,14 @@ # stream the string to us. galaxy_url = suc.handle_galaxy_url( trans, **kwd ) if galaxy_url and encoded_tmp_file_name: - url = suc.url_join( galaxy_url, '/common_install_util/stream_file_contents?encoded_tmp_file_name=%s' % encoded_tmp_file_name ) + url = suc.url_join( galaxy_url, + 'admin_toolshed/stream_file_contents?encoded_tmp_file_name=%s' % encoded_tmp_file_name ) response = urllib2.urlopen( url ) encoded_required_repository_str = response.read() else: - raise Exception( "Required galaxy_url or encoded_tmp_file_name request parameters missing." ) + log.debug( "Invalid galaxy_url '%s' or encoded_tmp_file_name '%s'." % ( str( galaxy_url ), str( encoded_tmp_file_name ) ) ) + repo_info_dict = {} + return repo_info_dict encoded_required_repository_tups = encoded_required_repository_str.split( encoding_util.encoding_sep2 ) decoded_required_repository_tups = [] for encoded_required_repository_tup in encoded_required_repository_tups: diff -r bc5cd95d042bc062c688bee6b3e9cbf74d853fb1 -r 65a81aead95e147f709ee3969d49766f35d6a2e2 lib/tool_shed/util/common_install_util.py --- a/lib/tool_shed/util/common_install_util.py +++ b/lib/tool_shed/util/common_install_util.py @@ -3,6 +3,7 @@ import tempfile from galaxy import eggs from galaxy import util +from galaxy import web from galaxy.util import json from galaxy.webapps.tool_shed.util import container_util import tool_shed.util.shed_util_common as suc @@ -396,7 +397,3 @@ app.model.ToolDependency.installation_status.ERROR ]: installed_tool_dependencies.append( tool_dependency ) return installed_tool_dependencies - -def stream_file_contents( trans, encoded_tmp_file_name ): - tmp_file_name = encoding_util.tool_shed_decode( encoded_tmp_file_name ) - return open( tmp_file_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.
participants (1)
-
commits-noreply@bitbucket.org