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
Reflect grassdb changes in catalog #994
Conversation
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.
It works for me with and without watchdog.
When I switch to an empty mapset and create new maps, the node does not expand (although the content is updated).
In the review, I'm mainly asking for more documentation. Some motivation cane be also included in the commit message if needed.
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.
I think at least without watch dog, one raster map is being added multiple times to the data catalog when module is re-run from the GUI.
This PR introduces new signal to update catalog tree when a change in grass database happened.
So far it covers cases when a new map is created through running a module (from command line or dialog), imports, mapcalc.
Also updates tree when new mapset/location is created from menu. Here it changes behavior, it doesn't automatically switch to the new mapset. Supersedes/incorporates #916.
Additionally it uses python watchdog library to observe current mapset to reflect changes from terminal or other sources not covered by mechanism above. Only current mapset is observed because there is a low default limit on how many files can be watched. Watchdog is not part of standard Python lib but can be installed through pip, the PR should work without it, missing changes done externally.
Fixes #885.