Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance filenames with collection context when downloading datasets from GUI. #3985

Merged
merged 2 commits into from May 2, 2017

Conversation

Projects
None yet
5 participants
@jmchilton
Copy link
Member

commented Apr 27, 2017

  • Reduce duplication related to calculating filename.
  • Formalized pattern for normal dataset download using string.Tempalte - "Galaxy${hid}-[${name}].${ext}".
  • In the context of collections, hid and name of the datasets are pretty worthless so I used a second pattern for collections based on where it is in the current GUI frame. The new pattern is "Galaxy${hdca_hid}-[${hdca_name}__${element_identifier}].${ext}".
  • The patterns make this a little more tweakable - for people who want something different it should be pretty straight forward to make these patterns configurable.

Fixes #2140 I think.

jmchilton added some commits Apr 27, 2017

Enhance filenames with collection context when downloading datasets f…
…rom GUI.

- Reduce duplication related to calculating filename.
- Formalized pattern for normal dataset download using string.Tempalte - "Galaxy${hid}-[${name}].${ext}".
- In the context of collections, hid and name of the datasets are pretty worthless so I used a second pattern for collections based on where it is in the current GUI frame. The new pattern is "Galaxy${hdca_hid}-[${hdca_name}__${element_identifier}].${ext}".
- The patterns make this a little more tweakable - for people who want something different it should be pretty straight forward to make these patterns configurable.

Fixes #2140 I think.

@jmchilton jmchilton force-pushed the jmchilton:fix_collection_download_name branch from 094d62d to ef92904 May 2, 2017

@martenson martenson merged commit 4b7d5e3 into galaxyproject:dev May 2, 2017

5 checks passed

api test Build finished. 275 tests run, 0 skipped, 0 failed.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
framework test Build finished. 148 tests run, 0 skipped, 0 failed.
Details
integration test Build finished. 34 tests run, 0 skipped, 0 failed.
Details
toolshed test Build finished. 579 tests run, 0 skipped, 0 failed.
Details
@jmchilton

This comment has been minimized.

Copy link
Member Author

commented May 2, 2017

Thanks for the merge @martenson - glad this made it into 17.05.

@jmchilton jmchilton deleted the jmchilton:fix_collection_download_name branch May 2, 2017

if not to_ext:
to_ext = data.extension
fname = ''.join(c in FILENAME_VALID_CHARS and c or '_' for c in data.name)[0:150]
trans.response.set_content_type( "application/octet-stream" ) # force octet-stream so Safari doesn't append mime extensions to filename

This comment has been minimized.

Copy link
@nsoranzo

nsoranzo May 2, 2017

Member

@jmchilton Was this line removed on purpose?

This comment has been minimized.

Copy link
@jmchilton

jmchilton May 2, 2017

Author Member

Nope :(

This comment has been minimized.

Copy link
@jmchilton

jmchilton May 2, 2017

Author Member

#4004 - sorry about that and thanks for the catch.

jmchilton added a commit to jmchilton/galaxy that referenced this pull request May 2, 2017

martenson added a commit that referenced this pull request May 2, 2017

Merge pull request #4004 from jmchilton/filename_fixup
Restore line accidentally removed as part of #3985.
@mvdbeek

This comment has been minimized.

Copy link
Member

commented May 3, 2017

This is not in 17.05 though, what's the procedure now, can I push this to the 17.05 branch?

@mvdbeek

This comment has been minimized.

Copy link
Member

commented May 3, 2017

Actually it is and it works fine :D

mvdbeek added a commit to mvdbeek/galaxy that referenced this pull request May 3, 2017

Pass hdca and element_identifier to _serve_raw
This is necessary for getting the new filenames introduced in galaxyproject#3985 if
downloading tabular datatypes. Closes galaxyproject#4016.
@martenson

This comment has been minimized.

Copy link
Member

commented May 3, 2017

@mvdbeek yeah, this has been merged pre-freeze :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.