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

[ENH] Save widgets: Store paths relative to workflow directory #4532

Merged
merged 1 commit into from
Mar 20, 2020

Conversation

janezd
Copy link
Contributor

@janezd janezd commented Mar 14, 2020

Issue

Fixes part of #4464 by storing paths relative to the workflow directory.

Description of changes

Path is always relative to the workflow directory, and the saved file must be either in the same director or in its subtree. On loading the widget, auto-save is disabled unless a relative path is used to prevent auto saving to arbitrary locations when the workflow is loaded.

Implementation does not use RecentPath because it does not fit.

All core widgets for saving (Save, Save Distances, Save Model) are derived from this base class, so the patch should work for them, as well as for all properly written widgets in add-ons (Save Network).

I took care to keep the backward compatibility, though ... please check all potentially affected add-ons.

Unlike codecov, I believe that coverage is 100 %. At least judging by codecov's diff.

Includes
  • Code changes
  • Tests
  • Documentation

@janezd janezd changed the title OWSaveBase: Keep relative path Save widgets: Store paths relative to workflow directory Mar 14, 2020
@janezd janezd changed the title Save widgets: Store paths relative to workflow directory [ENH] Save widgets: Store paths relative to workflow directory Mar 14, 2020
@codecov
Copy link

codecov bot commented Mar 14, 2020

Codecov Report

Merging #4532 into master will increase coverage by 0.08%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #4532      +/-   ##
==========================================
+ Coverage   83.38%   83.46%   +0.08%     
==========================================
  Files         279      276       -3     
  Lines       55780    55267     -513     
==========================================
- Hits        46510    46130     -380     
+ Misses       9270     9137     -133     

@PrimozGodec
Copy link
Contributor

The implementation works correctly. There is only one thing I would change.

When setting a location to save data the text at the save button changes to Save as <filname> if I save data with name foo.csv the button has the text Save as foo.csv. Then I save the workflow and reopen it. I would like to see a button with the same text again (it would give a user feels that the path to save data is already set). After reopening text at the button is just Save

@PrimozGodec
Copy link
Contributor

Thank you. It is great now.

@PrimozGodec PrimozGodec merged commit 6fc0741 into biolab:master Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants