Skip to content
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

Merged
merged 10 commits into from Nov 18, 2020

Conversation

petrasovaa
Copy link
Contributor

@petrasovaa petrasovaa commented Sep 28, 2020

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.

demo

@petrasovaa petrasovaa added the GUI wxGUI related label Sep 28, 2020
@petrasovaa petrasovaa added this to PRs in progress in New GUI Startup via automation Sep 28, 2020
Copy link
Member

@wenzeslaus wenzeslaus left a 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.

gui/wxpython/datacatalog/tree.py Outdated Show resolved Hide resolved
gui/wxpython/datacatalog/tree.py Show resolved Hide resolved
gui/wxpython/datacatalog/tree.py Outdated Show resolved Hide resolved
gui/wxpython/datacatalog/tree.py Show resolved Hide resolved
gui/wxpython/datacatalog/tree.py Show resolved Hide resolved
gui/wxpython/lmgr/giface.py Outdated Show resolved Hide resolved
gui/wxpython/datacatalog/tree.py Outdated Show resolved Hide resolved
Copy link
Member

@wenzeslaus wenzeslaus left a 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.

@petrasovaa petrasovaa merged commit 32bb3de into OSGeo:master Nov 18, 2020
New GUI Startup automation moved this from PRs in progress to Done Nov 18, 2020
@petrasovaa petrasovaa deleted the catalog-watchdog branch November 18, 2020 04:14
@wenzeslaus wenzeslaus moved this from Waiting for review to Done in OSGeo Virtual Community Sprint 2020 Nov 18, 2020
@neteler neteler added this to the 8.0.0 milestone Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI wxGUI related
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

[Bug] Reflect changes done from data catalog in GUI and vice versa
3 participants