2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/a5cedd31d98e/ Changeset: a5cedd31d98e Branch: next-stable User: greg Date: 2013-03-29 14:46:19 Summary: Be less restrictive when loacting tool image help files for tools contained in repositories. Affected #: 2 files diff -r 56de0ee7932f5097855dcb54a2393ce86e8b7c15 -r a5cedd31d98e0af9b80843ed7e0c987a6b04cda1 lib/galaxy/webapps/galaxy/controllers/tool_runner.py --- a/lib/galaxy/webapps/galaxy/controllers/tool_runner.py +++ b/lib/galaxy/webapps/galaxy/controllers/tool_runner.py @@ -102,8 +102,14 @@ image_file = kwd.get( 'image_file', None ) if repository_id and image_file: repository = suc.get_tool_shed_repository_by_id( trans, repository_id ) - repo_files_dir = os.path.join( repository.repo_path( trans.app ), repository.name, repository.name ) - return open( os.path.join( repo_files_dir, 'static', 'images', image_file ), 'r' ) + repo_files_dir = os.path.join( repository.repo_files_directory( trans.app ) ) + default_path = os.path.abspath( os.path.join( repo_files_dir, 'static', 'images', image_file ) ) + if os.path.exists( default_path ): + return open( default_path, 'r' ) + else: + path_to_file = suc.get_absolute_path_to_file_in_repository( repo_files_dir, image_file ) + if os.path.exists( path_to_file ): + return open( path_to_file, 'r' ) return None @web.expose diff -r 56de0ee7932f5097855dcb54a2393ce86e8b7c15 -r a5cedd31d98e0af9b80843ed7e0c987a6b04cda1 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 @@ -751,7 +751,13 @@ if repository_id and image_file: repository = suc.get_repository_in_tool_shed( trans, repository_id ) repo_files_dir = os.path.join( repository.repo_path( trans.app ), repository.name ) - return open( os.path.join( repo_files_dir, 'static', 'images', image_file ), 'r' ) + default_path = os.path.abspath( os.path.join( repo_files_dir, 'static', 'images', image_file ) ) + if os.path.exists( default_path ): + return open( default_path, 'r' ) + else: + path_to_file = suc.get_absolute_path_to_file_in_repository( repo_files_dir, image_file ) + if os.path.exists( path_to_file ): + return open( path_to_file, 'r' ) return None @web.expose https://bitbucket.org/galaxy/galaxy-central/commits/93f069f8325c/ Changeset: 93f069f8325c User: greg Date: 2013-03-29 14:46:52 Summary: Merged next-stable Affected #: 2 files diff -r 5a3199174e53443cc85626dad7192077e52daeef -r 93f069f8325ca3bd7aff1cfd8673efdb3b61b4d5 lib/galaxy/webapps/galaxy/controllers/tool_runner.py --- a/lib/galaxy/webapps/galaxy/controllers/tool_runner.py +++ b/lib/galaxy/webapps/galaxy/controllers/tool_runner.py @@ -102,8 +102,14 @@ image_file = kwd.get( 'image_file', None ) if repository_id and image_file: repository = suc.get_tool_shed_repository_by_id( trans, repository_id ) - repo_files_dir = os.path.join( repository.repo_path( trans.app ), repository.name, repository.name ) - return open( os.path.join( repo_files_dir, 'static', 'images', image_file ), 'r' ) + repo_files_dir = os.path.join( repository.repo_files_directory( trans.app ) ) + default_path = os.path.abspath( os.path.join( repo_files_dir, 'static', 'images', image_file ) ) + if os.path.exists( default_path ): + return open( default_path, 'r' ) + else: + path_to_file = suc.get_absolute_path_to_file_in_repository( repo_files_dir, image_file ) + if os.path.exists( path_to_file ): + return open( path_to_file, 'r' ) return None @web.expose diff -r 5a3199174e53443cc85626dad7192077e52daeef -r 93f069f8325ca3bd7aff1cfd8673efdb3b61b4d5 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 @@ -751,7 +751,13 @@ if repository_id and image_file: repository = suc.get_repository_in_tool_shed( trans, repository_id ) repo_files_dir = os.path.join( repository.repo_path( trans.app ), repository.name ) - return open( os.path.join( repo_files_dir, 'static', 'images', image_file ), 'r' ) + default_path = os.path.abspath( os.path.join( repo_files_dir, 'static', 'images', image_file ) ) + if os.path.exists( default_path ): + return open( default_path, 'r' ) + else: + path_to_file = suc.get_absolute_path_to_file_in_repository( repo_files_dir, image_file ) + if os.path.exists( path_to_file ): + return open( path_to_file, 'r' ) return None @web.expose 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.