1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/51bcb9cdb8bd/ Changeset: 51bcb9cdb8bd User: greg Date: 2013-10-07 16:32:33 Summary: Fix setting mimetype for image files in tool shed repositories. Affected #: 2 files diff -r 656b965c5d030b7a6b61b727380a8141c12c2c37 -r 51bcb9cdb8bd109e5b89eac5c2ad83d6f3e3e0fc 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 @@ -306,9 +306,14 @@ path_to_file = suc.get_absolute_path_to_file_in_repository( repo_files_dir, relative_path_to_image_file ) if os.path.exists( path_to_file ): file_name = os.path.basename( relative_path_to_image_file ) - mimetype = trans.app.datatypes_registry.get_mimetype_by_extension( file_name, None ) - if mimetype: - trans.response.set_content_type( mimetype ) + try: + extension = file_name.split( '.' )[ -1 ] + except Exception, e: + extension = None + if extension: + mimetype = trans.app.datatypes_registry.get_mimetype_by_extension( extension ) + if mimetype: + trans.response.set_content_type( mimetype ) return open( path_to_file, 'r' ) return None diff -r 656b965c5d030b7a6b61b727380a8141c12c2c37 -r 51bcb9cdb8bd109e5b89eac5c2ad83d6f3e3e0fc 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 @@ -1038,9 +1038,14 @@ path_to_file = suc.get_absolute_path_to_file_in_repository( repo_files_dir, relative_path_to_image_file ) if os.path.exists( path_to_file ): file_name = os.path.basename( relative_path_to_image_file ) - mimetype = trans.app.datatypes_registry.get_mimetype_by_extension( file_name, None ) - if mimetype: - trans.response.set_content_type( mimetype ) + try: + extension = file_name.split( '.' )[ -1 ] + except Exception, e: + extension = None + if extension: + mimetype = trans.app.datatypes_registry.get_mimetype_by_extension( extension ) + if mimetype: + trans.response.set_content_type( mimetype ) return open( path_to_file, 'r' ) return None 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.