-
Notifications
You must be signed in to change notification settings - Fork 14
Assess Userdata Folders (new feature, off by default) #330
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
Assess Userdata Folders (new feature, off by default) #330
Conversation
bring_to_foreground is implemented as a method in the registration dialog object. It's actually general, affecting the app, not specifically the dialog object. This commit moves it to a function in mywx, so it can be used even if registration dialog isn't employed.
During the preliminary probes, call userdata_survey.survey() (which for now is a skeleton implementation) to check for user data in deprecated locations inside the LabGym software tree.
implement verify_userdata_dir_separation, and call it from userdata_survey.survey().
Implement offer_mkdir_userdata function, and call it from userdata_survey.survey().
Weird, somehow I inadvertantly deleted it?? Or poor git skils, IDK.
Remove mywx.App function implementation. Instead, on load of mywx, patch wx.App to be a "strict singleton". Reorganize imports so that the load of mywx happens prior to the load of wx.
45 unit tests 100% pass, all in one pytest session, and also each in a separate pytest session.
This addresses a deprecation warning :-/.
Although we think of modules as "singletons", module py-files inside packages might be loaded/executed more than once, if developers don't maintain consistency of importing as pkg.modulename. I don't see a way to ensure developer consistency, so I'm adding an attribute to the patched wx module so I no longer depend on wxpy.py being imported/loaded only once.
Eliminate superfluous bring_wxapp_to_foreground.
Rely on test_userdata.py
9 unit tests in test_userdata_survey.py 1 bugfix in mywx/patch.py 2 bugfix in userdata_survey.py
To enable, use
--enable assess_userdata_folders
Also, scrub the early-exit developers crutch
--enable userdata_survey_exit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mywx.py is replaced by mywx package
|
ok, I see, this is a false alarm from unit test, so now I'll fix the unit test. |
|
And also, John, I think we should make the pipeline of using external Detector/Categorizer folder when using pyinstaller implementation parallel to the pypi implementation so that users who already installed LabGym with python3 and pypi don't need to go the other route for updating LabGym. And the pypi way should be the default since this GitHub repo is linked to pypi and directly generate releases pypi. |
should have been removesuffix(), not rstrip
userdata_survey.open_html_in_browser() isn't used by the LabGym sw. Taking it and it's unittest out, because although the unittest worked on Linux & macOS, it errored on Windows.
This PR introduces feature that assesses the config of userdata folders.
This feature is by default off, to allow developers to demo it on demand, for now.
To enable, give option like
LabGym --enable assess_userdata_foldersIf you don't do that, then this feature does nothing, because the call to userdata_survey.survey returns early.
This addresses each of several conditions:
if the test for the condition is True, then, log a message, and
Action: show the message in a gui dialog
This PR is a first step towards a better action, which might yet be developed...
But either way, this PR is the basis to work from, because it has 4 conditions implemented.
This PR is important whether ultimately user-facing instructions are issued, or automated fix is implemented.
The four conditions whose assessment is implemented are:
Verify the separation of configuration's userdata dirs.
If not separate, then display an error message, then sys.exit().
Check for userdata dirs that are defined/configured as
"external" to LabGym, but don't exist. If any, then warn.
Check for userdata dirs that are defined/configured as
"internal" to LabGym. If any, then warn.
For any userdata dirs configured as external to LabGym tree,
if there is "orphaned" data, remaining in the "traditional"
location (internal, within the LabGym tree), then warn.