1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/b9fdb88da530/ changeset: b9fdb88da530 branches: user: dan date: 2011-06-02 17:46:49 summary: Import patch contributed by Jim Johnson that supports sub directories in extra_files_path for displaying and downloading. "Numerous applications create html files with a directory hierarchy. I\'m including a patch support the display and download of datasets that include subdirs in their extra_files_path." affected #: 2 files (263 bytes) --- a/lib/galaxy/web/buildapp.py Thu Jun 02 11:40:06 2011 -0400 +++ b/lib/galaxy/web/buildapp.py Thu Jun 02 11:46:49 2011 -0400 @@ -94,6 +94,8 @@ webapp.add_route( '/async/:tool_id/:data_id/:data_secret', controller='async', action='index', tool_id=None, data_id=None, data_secret=None ) webapp.add_route( '/:controller/:action', action='index' ) webapp.add_route( '/:action', controller='root', action='index' ) + # allow for subdirectories in extra_files_path + webapp.add_route( '/datasets/:dataset_id/display/{filename:.+?}', controller='dataset', action='display', dataset_id=None, filename=None) webapp.add_route( '/datasets/:dataset_id/:action/:filename', controller='dataset', action='index', dataset_id=None, filename=None) webapp.add_route( '/display_application/:dataset_id/:app_name/:link_name/:user_id/:app_action/:action_param', controller='dataset', action='display_application', dataset_id=None, user_id=None, app_name = None, link_name = None, app_action = None, action_param = None ) webapp.add_route( '/u/:username/d/:slug', controller='dataset', action='display_by_username_and_slug' ) --- a/lib/galaxy/web/controllers/dataset.py Thu Jun 02 11:40:06 2011 -0400 +++ b/lib/galaxy/web/controllers/dataset.py Thu Jun 02 11:46:49 2011 -0400 @@ -267,17 +267,18 @@ log.exception( "Unable to add composite parent %s to temporary library download archive" % data.file_name) msg = "Unable to create archive for download, please report this error" messagetype = 'error' - flist = glob.glob(os.path.join(efp,'*.*')) # glob returns full paths - for fpath in flist: - efp,fname = os.path.split(fpath) - try: - archive.add( fpath,fname ) - except IOError: - error = True - log.exception( "Unable to add %s to temporary library download archive" % fname) - msg = "Unable to create archive for download, please report this error" - messagetype = 'error' - continue + for root, dirs, files in os.walk(efp): + for fname in files: + fpath = os.path.join(root,fname) + rpath = os.path.relpath(fpath,efp) + try: + archive.add( fpath,rpath ) + except IOError: + error = True + log.exception( "Unable to add %s to temporary library download archive" % rpath) + msg = "Unable to create archive for download, please report this error" + messagetype = 'error' + continue if not error: if params.do_action == 'zip': archive.close() 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.