-
Notifications
You must be signed in to change notification settings - Fork 296
Implement dynamic status update of the dictionaries #1400
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
Conversation
|
Of course the additional hooks triggered/events emitted will break the tests... Note that if there are more than one dictionaries loaded, the checking functions might need to be modified to account for the different orders of the Note that this creates a circular reference loop (engine -> dictionary load manager -> dictionary load operation -> ...), but there probably isn't that many of them, and Python can collect them. |
82b757b to
97a84ab
Compare
|
Hi @user202729, thanks for the PR! Are you still interested in this being merged? It would need to reworked quite a bit of course to resolve the conflicts. I had a look at the implementation. I'm a fan of keeping things simple and this additional logic does add some complexity. Not sure if it's worth it in this case. |
|
Given that it's net +13 lines added and at least as many of them are documentations/explanatory comments, I wouldn't say it's much extra complexity. My motivation for having this feature is
in my case, one of them is a Python dictionary and because of a bug it takes infinitely long to load it. This feature would be useful to see which one it is. I… will take a look to see how to resolve the conflict. Doesn't help that I'm still using 4.0.0 with heavy patches, and the version I run have pretty much everything I need (upgrading would require rewriting much of the plugins) |
c48d17b to
4af84c3
Compare
|
Okay, rebased. (actually I just Manual testing instruction
|
|
The failing test which is fixed in the last commit is the following. The test asserts that there is a which is called by Note that the comparison is which creates a new |
mkrnr
left a comment
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.
Just one super trivial finding. Everything else looks good to me and I also successfully tested the functionality.
|
Sorry, only noticed it now: the PR is missing the news file. |
Summary of changes
(See also the linked issue.) In summary, this change will make it such that if some dictionaries are fast to load and others are slow to load, the
↻icon will only display on the dictionaries which haven't finished loading.Breaking change:
StenoLoadingManager.load()returns a list of mixedDictionaryLoaderExceptionandJsonDictionaryetc. objects, only for theExceptionobjects to be immediately converted intoErroredDictionaryobject inengine.pyright after, nowload()returns a list of mixedErroredDictionaryandJsonDictionaryobjects which are homogeneous (both are instances ofStenoDictionary).Note:
The favorite icon is not shown until all dictionaries are loaded (although it might be impossible to determine it correctly in advance before all dictionaries are loaded)
Note: make sure that there's no race condition and the final
dictionaries_changedhook is always triggered later than thedictionary_state_changedhooks.Closes #1331 .
Pull Request Checklist