commit/galaxy-central: Dave Bouvier: Add a new tool dependency action download_file to download a file without extracting it.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/b4733e42a2c9/ Changeset: b4733e42a2c9 User: Dave Bouvier Date: 2013-05-10 20:48:15 Summary: Add a new tool dependency action download_file to download a file without extracting it. Affected #: 3 files diff -r f72fd96d3fac5e17ec5c9aaece023b0ae74db696 -r b4733e42a2c98c42401bca5e0643fc4d4dcf2db6 lib/tool_shed/galaxy_install/tool_dependencies/common_util.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/common_util.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/common_util.py @@ -151,6 +151,9 @@ def isgzip( file_path ): return checkers.is_gzip( file_path ) +def isjar( file_path ): + return iszip( file_path ) and file_path.endswith( '.jar' ) + def istar( file_path ): return tarfile.is_tarfile( file_path ) diff -r f72fd96d3fac5e17ec5c9aaece023b0ae74db696 -r b4733e42a2c98c42401bca5e0643fc4d4dcf2db6 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 @@ -71,6 +71,8 @@ # <action type="download_by_url">http://sourceforge.net/projects/samtools/files/samtools/0.1.18/samtools-0.1.18.tar.bz2</action> common_util.extract_tar( downloaded_file_path, work_dir ) dir = common_util.tar_extraction_directory( work_dir, downloaded_filename ) + elif common_util.isjar( downloaded_file_path ): + dir = os.path.curdir elif common_util.iszip( downloaded_file_path ): # <action type="download_by_url">http://downloads.sourceforge.net/project/picard/picard-tools/1.56/picard-tools-1.56.zip</action> zip_archive_extracted = common_util.extract_zip( downloaded_file_path, work_dir ) @@ -85,6 +87,14 @@ if return_code: return dir = package_name + elif action_type == 'download_file': + # <action type="download_file">http://effectors.org/download/version/TTSS_GUI-1.0.1.jar</action> + # Download a single file to the working directory. + filtered_actions = actions[ 1: ] + url = action_dict[ 'url' ] + filename = url.split( '/' )[ -1 ] + common_util.url_download( work_dir, filename, url ) + dir = os.path.curdir else: # We're handling a complex repository dependency where we only have a set_environment tag set. # <action type="set_environment"> @@ -137,6 +147,11 @@ return_code = handle_command( app, tool_dependency, install_dir, cmd ) if return_code: return + elif action_type == 'download_file': + # Download a single file to the current directory. + url = action_dict[ 'url' ] + filename = url.split( '/' )[ -1 ] + common_util.url_download( current_dir, filename, url ) def log_results( command, fabric_AttributeString, file_path ): """ diff -r f72fd96d3fac5e17ec5c9aaece023b0ae74db696 -r b4733e42a2c98c42401bca5e0643fc4d4dcf2db6 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 @@ -341,6 +341,12 @@ action_dict[ 'target_filename' ] = action_elem.attrib[ 'target_filename' ] else: continue + elif action_type == 'download_file': + # <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 + else: + continue elif action_type == 'make_directory': # <action type="make_directory">$INSTALL_DIR/lib/python</action> if action_elem.text: 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