commit/galaxy-central: Dave Bouvier: Add support for specifying the target filename in the download_file action. Set a tool dependency to the error state if the actions list specifies an unsupported action.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/2e387c1384f1/ Changeset: 2e387c1384f1 User: Dave Bouvier Date: 2013-05-15 17:07:49 Summary: Add support for specifying the target filename in the download_file action. Set a tool dependency to the error state if the actions list specifies an unsupported action. Affected #: 2 files diff -r 866ed8fd31e146792980c61489d57cc18a5036b5 -r 2e387c1384f1f7429a86e77e9a23b5329ca97b94 lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py @@ -92,7 +92,10 @@ # Download a single file to the working directory. filtered_actions = actions[ 1: ] url = action_dict[ 'url' ] - filename = url.split( '/' )[ -1 ] + if action_dict[ 'target_filename' ]: + filename = action_dict[ 'target_filename' ] + else: + filename = url.split( '/' )[ -1 ] common_util.url_download( work_dir, filename, url ) dir = os.path.curdir else: @@ -150,7 +153,10 @@ elif action_type == 'download_file': # Download a single file to the current directory. url = action_dict[ 'url' ] - filename = url.split( '/' )[ -1 ] + if action_dict[ 'target_filename' ]: + filename = action_dict[ 'target_filename' ] + else: + filename = url.split( '/' )[ -1 ] common_util.url_download( current_dir, filename, url ) def log_results( command, fabric_AttributeString, file_path ): diff -r 866ed8fd31e146792980c61489d57cc18a5036b5 -r 2e387c1384f1f7429a86e77e9a23b5329ca97b94 lib/tool_shed/galaxy_install/tool_dependencies/install_util.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py @@ -345,6 +345,7 @@ # <action type="download_file">http://effectors.org/download/version/TTSS_GUI-1.0.1.jar</action> if action_elem.text: action_dict[ 'url' ] = action_elem.text + action_dict[ 'target_filename' ] = action_elem.attrib.get( 'target_filename', None ) else: continue elif action_type == 'make_directory': @@ -402,8 +403,8 @@ else: continue else: - log.debug( "Skipping unsupported action type '%s'." % str( action_type ) ) - continue + log.debug( "Unsupported action type '%s'. Not proceeding." % str( action_type ) ) + raise Exception( "Unsupported action type '%s' in tool dependency definition." % str( action_type ) ) actions.append( ( action_type, action_dict ) ) if actions: actions_dict[ 'actions' ] = actions 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