3liz / qgis-pgmetadata-plugin

QGIS Plugin to manage some metadata from PostgreSQL layer
GNU General Public License v2.0
12 stars 10 forks source link

Fix #119 unknown connection names #129

Closed effjot closed 2 years ago

effjot commented 2 years ago

Instead of critical log messages, check for stale database connection (i.e. the connection name is found in PgMetadata’s settings, but no longer exists in Qgis) at startup and give the user the option to delete them.

fix #119

The function connections_list() shows a message bar every time a connection is not found. This is probably too much, because it appears almost every tiime you do something with the plugin. Also, the message bar call doesn’t seem to play nicely with the locator bar when typing. So I suggest to leave it out. The message box at startup and the “critical” log messages should be enough IMHO.

Also please have a look at the questions marked FIXME about “architectural” decisions.

effjot commented 2 years ago

Sorry, I’ve missed the failed tests. I’m having a look into that.

Gustry commented 2 years ago

Do not worry about isort, it's a automatic tool. isort . makes everything. I just checked that for now

effjot commented 2 years ago

flake8 made me run in circles because it doesn’t like my “indented inline comments” :-D

However, the unit test found a sloppy return value in my new function. OTOH, that Python version doesn’t seem to like the list[str] type hint syntax…

Gustry commented 2 years ago

Python version doesn’t seem to like the list[str] type hint syntax…

Ah, I should raise the minimum QGIS desktop version. It's still QGIS minimum 3.10 ... Annotations are indeed so convenient. I will try soon.