Ticket #8243 (closed: fixed)
Make sure the browsed-to "default save directory" has a separator
Reported by: | Peter Parker | Owned by: | Peter Parker |
---|---|---|---|
Priority: | critical | Milestone: | Release 3.0 |
Component: | GUI | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: | Roman Tolchenov |
Description
In "Manage User Directories", browsing to a default save directory results in the field being populated with a path that has no trailing separator.
This has caused problems in the new Indirect Bayes interface (#5421), and in any case it would seem sensible to keep to the convention that directory paths should end in a separator.
Change History
comment:2 Changed 7 years ago by Peter Parker
Merge branch 'feature/8243_fix_browse_to_default_save_dir' into devel
..op
Refs #8243
Changeset: 266213481c253ee73f73661434b0247f30b92254
comment:3 Changed 7 years ago by Peter Parker
- Status changed from inprogress to verify
- Resolution set to fixed
To test:
- Make sure that the default save directory field in Manage User Directories is populated correctly when using the "Browse to Directory" button -- i.e. that it has a trailing separator and all separators are forward slashes.
- Run the ResNorm, Quasi and Stretch tabs on the Indirect Bayes interface. Use data files from the system test directory for this -- irs26173_graphite002_red.nxs and irs26173_graphite002_res.nxs should be fine. Make sure that "Save Result" is checked (as saving the result is where the problems were) and also that Sequential Fit is checked on Quasi and Stretch (since there is a known problem with the non-sequential fit that is being worked on in another ticket.)
comment:4 Changed 7 years ago by Roman Tolchenov
- Status changed from verify to verifying
- Tester set to Roman Tolchenov
comment:5 Changed 7 years ago by Roman Tolchenov
It seems that this issue has been fixed but there is another one: if the save directory doesn't exist then mantid crashes. The follow up ticket is #8270.
comment:6 Changed 7 years ago by Roman Tolchenov
- Status changed from verifying to closed
Merge remote-tracking branch 'origin/feature/8243_fix_browse_to_default_save_dir'
Full changeset: 70e2cede583d428dd37256852715ae566feb0f73
Refs #8243 - Fix "browse to" default save directory.
Now, directories that are browsed to have a trailing separator, and separators are forward-slashes rather than back-slashes.
A quick grep of "defaultsave.directory" seemed to reveal no cases where adding a trailing separator would cause a problem. Also, the Windows, Linux and Mac command lines are all robust enough to parse/understand a double forward slash anyway.
Lastly, changed IndirectAbsCor.py and IndirectBayes.py to use os.path.join when working with the value of the defaultsave.directory property. This wasn't strictly necessary, but covers the case where a user manually types in a default save directory whithout a trailing slash.
Changeset: 175c57ee042ef8490f94c4682c8a71f5d25fad82