-
-
Notifications
You must be signed in to change notification settings - Fork 295
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
Check for gislock and other issues when deleting/renaming/editing mapset and location in catalog #904
Conversation
…nd check_locations_interactively. Rename and delete function edited in order to manage those checking functions.
… check of permanent mapset added.
gui/wxpython/startup/guiutils.py
Outdated
| return messages | ||
|
|
||
|
|
||
| def get_reasons_mapset_not_removable(grassdb, location, mapset, check_permanent): |
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 we wanted "get_reason_mapset_not_removable", currently the implementation reports 1 reason because you have elif there and not if for every case. We could also report multiple reasons (e.g. mapset can be locked and PERMANENT), but I would keep single reason. Therefore the name should reflect that. It's a detail, but let's get it right.
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.
Also it should return message as string (or None), not list to keep it all consistent. Update the documentation.
gui/wxpython/startup/guiutils.py
Outdated
| Queue().put( | ||
| (maps_dict, | ||
| _("Failed to read mapsets from location <{location}>.").format( | ||
| location=location_path))) |
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.
You can't just blindly copy code. This is handling communication from parallelized calls of getLocationTree function, remove it.
gui/wxpython/startup/guiutils.py
Outdated
| dlg = wx.MessageDialog( | ||
| parent=guiparent, | ||
| message=_( | ||
| "Cannot rename selected mapset for the following reason:\n\n" | ||
| "Cannot rename the mapset for the following reason:\n\n" |
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.
Probably could say cannot rename mapset <mapset> for ...
…ssages and docstrings made more comprehensive.
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.
This is in good shape now, but I realized we should probably add the same checks for deleting grass database. Should be straightforward, use GetListOfLocations to get the locations and check if db is current and check if the locations can be removed. GetListOfLocations should be moved to the grassdb library, but let's not do that in this PR.
…nd removing of current db from tree is not allowed now.
…-renaming-editing-mapset-and-location
Currently we don't have mechanism in data catalog to check for gislock and if mapset belongs to different user, so that we prevent user from actions including deleting or renaming mapset, and editing layers. The same applies to location deleting/renaming, it needs to check whether all mapsets can be edited.