Various user files changes#3535
Conversation
…egen.makedocumentation
| elif resource.is_file() and not f_name.exists(): | ||
| logging.debug("Copied: %s", spth / resource.name) | ||
| with open(dpth / resource.name, "wb") as dh: | ||
| dh.write(resource.read_bytes()) |
There was a problem hiding this comment.
You might want to wrap this in an exception handler to catch things like permission issues
There was a problem hiding this comment.
Note sure about this. There is exception handling in the caller - any exceptions thrown means "sorry, no docs for you" gets logged and the UI handles that. Handling the exception here means a pathway to pass the exception back to the user is needed.
| source_dir = exe_dir.parent / "Frameworks" / "doc" / "source" | ||
| build_dir = exe_dir.parent / "Frameworks" / "doc" / "build" | ||
|
|
||
| else: |
There was a problem hiding this comment.
It would probably be safer to elif this branch and use else to throw or at least send some info to warn the user that source_dir and build_dit can't be found.
There was a problem hiding this comment.
This is only defining the likely locations for the documentation files. A check is performed later if either location does not exist.
llimeht
left a comment
There was a problem hiding this comment.
Thanks for some tidy-up and documentation @krzywon!
I'm not sure whether this is part of a series of PRs that is planned or if this is and end-point of this work - the items below might be a todo list for the next PR.
- I understand that doc-regen is off the table — there is no need to copy doc source and doc build to
~any more. All of this can be simplified to "where is the html file on disk" (for the vast majority of users for whom it will be unpacked on disk; for a couple of exotic use cases, it could be popped into a tempdir) - is copying the example_data to
~a desirable thing? It's not like~/AppDatais an easily findable location on Windows (I'm curious whether that path is actually different under different types of Windows installation too) - The commit message and code says "move" ("Move example_data into user") but it's actually copying not moving
- The doc for Example Data says the docs are moved at install time but they are actually copied at runtime.
- The docs for the example data point to
example_data_helpbutsasdata/example_data/media/testdata_help.rstis the actual documentation - that probably should just get fixed at thesasdataend though.
|
@llimeht, thanks for the documentation catch and simplification suggestion. I'll fix those shortly.
It is meant to be the first of about 5 PRs as I see them, in the possible order I envision them:
|
From a MacOS perspective, absolutely. It's very difficult to find the example data (#3201). For other OSes, it's debatable. |
…ved to ensure sasview does not resurrect them
…nd the reasoning for the change
…case where both files exist is handles properly
3537: End plugin model necromancy
# Conflicts: # src/sas/qtgui/MainWindow/GuiManager.py # src/sas/qtgui/Perspectives/Fitting/FittingWidget.py # src/sas/qtgui/Perspectives/Fitting/MagnetismWidget.py # src/sas/qtgui/Utilities/DocViewWidget.py # src/sas/qtgui/Utilities/GuiUtils.py # src/sas/qtgui/Utilities/ModelEditors/ReparamEditor/ReparameterizationEditor.py # src/sas/qtgui/Utilities/ModelEditors/TabbedEditor/PluginDefinition.py # src/sas/qtgui/Utilities/ModelEditors/TabbedEditor/TabbedModelEditor.py # src/sas/sascalc/doc_regen/makedocumentation.py # src/sas/sascalc/doc_regen/regenmodel.py # src/sas/sascalc/doc_regen/regentoc.py # src/sas/system/lib.py # src/sas/system/user.py
jamescrake-merani
left a comment
There was a problem hiding this comment.
Approving this, as I think the changes here are reasonable.
# Conflicts: # src/sas/sascalc/doc_regen/makedocumentation.py
|
Once the CI completes, I plan to merge this |
Description
This changes a number of items related to user files:
Refs #3522, #3485, #3201, #3062 - This PR may fix a few of these, but more testing is needed for each.
NOTE: The example data location still needs to be updated in other parts of the documentation.
Review Checklist:
Documentation (check at least one)
Installers
Licensing (untick if necessary)