Skip to content

Commit 737629e

Browse files
authored
prepare release 3.0.0 (#293)
#293 * bump version to 3.0.0 * update docstrings * housekeeping * update gitignore to ignore quicksearches.json * update i18n * formatting with black
1 parent d3deae8 commit 737629e

11 files changed

Lines changed: 119 additions & 76 deletions

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ test/fixtures
117117

118118
# user settings
119119
_user/
120-
120+
cache.json
121+
quicksearches.json
121122

122123
*.pyc
123124
*.*~

i18n/isogeo.qph

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -221,17 +221,12 @@
221221
<target>Alerte</target>
222222
</phrase>
223223
<phrase>
224-
<source>Proxy issue :
225-
QGIS and your OS have different proxy set ups.</source>
226-
<target>Problème de proxy :\nQGIS et votre ordinateur ont des configurations de proxy différentes.</target>
227-
</phrase>
228-
<phrase>
229-
<source>Proxy issue :
230-
You have a proxy set up on your OS but none in QGIS.
231-
Please set it up in &apos;Preferences/Options/Network&apos;.</source>
232-
<target>Problème de proxy :
233-
Votre ordinateur utilise un proxy, mais il n&apos;est pas configuré
234-
dans QGIS (Menu &apos;Préférences/Options/Réseau).</target>
224+
<source>Proxy issue:
225+
You have a proxy set up on your OS {} but none in QGIS.
226+
Please set it up in &apos;Preferences/Options/Network&apos; then close/reopen the plugin.</source>
227+
<target>Erreur de proxy détectée :
228+
Un proxy est actif sur votre système {} mais pas dans QGIS.
229+
Vérifiez la configuration de QGIS (Préférénces/Options/Réseau) et de votre ordinateur, puis fermer et réouvrir le plugin.</target>
235230
</phrase>
236231
<phrase>
237232
<source>Error</source>
@@ -421,10 +416,6 @@ dans QGIS (Menu &apos;Préférences/Options/Réseau).</target>
421416
<source>Authentication file is valid. Asking for authorization to Isogeo&apos;s API.</source>
422417
<target>Le fichier d&apos;authentification est valide. Demande d&apos;autorisation envoyée à l&apos;API.</target>
423418
</phrase>
424-
<phrase>
425-
<source>Redirecting code received. ID and SECRET could be invalid. Provide them again. If this error keeps happening, please report it in the bug tracker.</source>
426-
<target>Les identifiant et mot de passe ne sont pas valides. Renseignez les une nouvelle fois. Si l&apos;erreur persiste, merci de la signaler dans le bug tracker.</target>
427-
</phrase>
428419
<phrase>
429420
<source>Proxy error found. Check your OS and QGIS proxy configuration.If this error keeps happening, please report it in the bug tracker.</source>
430421
<target>Erreur de proxy détectée. Vérifiez les configurations de QGIS et de votre ordinateur. Si l&apos;erreur persiste, merci de la signaler dans le bug tracker.</target>
@@ -445,6 +436,10 @@ dans QGIS (Menu &apos;Préférences/Options/Réseau).</target>
445436
<source>Request to Isogeo&apos;s API failed : please check your Internet connection and your proxy configuration. If this error keeps happening, please report it in the bug tracker.</source>
446437
<target>La requête à l&apos;API Isogeo a échoué. Vérifiez votre connexion Internet et votre configuration proxy. Si l&apos;erreur persiste, merci de la signaler dans le bug tracker.</target>
447438
</phrase>
439+
<phrase>
440+
<source>ID and SECRET could be invalid. Provide them again. If this error keeps happening, please report it in the bug tracker.</source>
441+
<target>Les paramètres d&apos;authentification (Client ID et Client Secret) semblent invalides.</target>
442+
</phrase>
448443
<phrase>
449444
<source>Credits</source>
450445
<target>Crédits</target>

i18n/isogeo_search_engine_en.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -280,17 +280,17 @@
280280
<context>
281281
<name>IsogeoPlgTools</name>
282282
<message>
283-
<location filename="../modules/tools.py" line="458"/>
283+
<location filename="../modules/tools.py" line="461"/>
284284
<source>The &apos;{}&apos; QGIS style is not compatible with combobox. It has been changed. Please restart QGIS.</source>
285285
<translation type="unfinished"></translation>
286286
</message>
287287
<message>
288-
<location filename="../modules/tools.py" line="368"/>
288+
<location filename="../modules/tools.py" line="371"/>
289289
<source>Alert</source>
290290
<translation type="unfinished"></translation>
291291
</message>
292292
<message>
293-
<location filename="../modules/tools.py" line="368"/>
293+
<location filename="../modules/tools.py" line="371"/>
294294
<source>Proxy issue:
295295
You have a proxy set up on your OS {} but none in QGIS.
296296
Please set it up in &apos;Preferences/Options/Network&apos; then close/reopen the plugin.</source>
@@ -366,52 +366,52 @@ You have a proxy set up on your OS {} but none in QGIS.
366366
<context>
367367
<name>ResultsManager</name>
368368
<message>
369-
<location filename="../modules/results/display.py" line="162"/>
369+
<location filename="../modules/results/display.py" line="167"/>
370370
<source>Point</source>
371371
<translation type="unfinished"></translation>
372372
</message>
373373
<message>
374-
<location filename="../modules/results/display.py" line="165"/>
374+
<location filename="../modules/results/display.py" line="170"/>
375375
<source>Polygon</source>
376376
<translation type="unfinished"></translation>
377377
</message>
378378
<message>
379-
<location filename="../modules/results/display.py" line="168"/>
379+
<location filename="../modules/results/display.py" line="173"/>
380380
<source>Line</source>
381381
<translation type="unfinished"></translation>
382382
</message>
383383
<message>
384-
<location filename="../modules/results/display.py" line="171"/>
384+
<location filename="../modules/results/display.py" line="176"/>
385385
<source>MultiPolygon</source>
386386
<translation type="unfinished"></translation>
387387
</message>
388388
<message>
389-
<location filename="../modules/results/display.py" line="193"/>
389+
<location filename="../modules/results/display.py" line="198"/>
390390
<source>Unknown geometry</source>
391391
<translation type="unfinished"></translation>
392392
</message>
393393
<message>
394-
<location filename="../modules/results/display.py" line="187"/>
394+
<location filename="../modules/results/display.py" line="192"/>
395395
<source>Raster</source>
396396
<translation type="unfinished"></translation>
397397
</message>
398398
<message>
399-
<location filename="../modules/results/display.py" line="190"/>
399+
<location filename="../modules/results/display.py" line="195"/>
400400
<source>Service</source>
401401
<translation type="unfinished"></translation>
402402
</message>
403403
<message>
404-
<location filename="../modules/results/display.py" line="450"/>
404+
<location filename="../modules/results/display.py" line="455"/>
405405
<source>Data file</source>
406406
<translation type="unfinished"></translation>
407407
</message>
408408
<message>
409-
<location filename="../modules/results/display.py" line="446"/>
409+
<location filename="../modules/results/display.py" line="451"/>
410410
<source>PostGIS table</source>
411411
<translation type="unfinished"></translation>
412412
</message>
413413
<message>
414-
<location filename="../modules/results/display.py" line="398"/>
414+
<location filename="../modules/results/display.py" line="403"/>
415415
<source>Can&apos;t be added</source>
416416
<translation type="unfinished"></translation>
417417
</message>

i18n/isogeo_search_engine_fr.qm

-255 Bytes
Binary file not shown.

i18n/isogeo_search_engine_fr.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -280,17 +280,17 @@
280280
<context>
281281
<name>IsogeoPlgTools</name>
282282
<message>
283-
<location filename="../modules/tools.py" line="458"/>
283+
<location filename="../modules/tools.py" line="461"/>
284284
<source>The &apos;{}&apos; QGIS style is not compatible with combobox. It has been changed. Please restart QGIS.</source>
285285
<translation>Le {} style de l&apos;interface n&apos;est pas compatible avec le sélecteur de mots-clés. Il a été changé. Merci de redémarrer QGIS.</translation>
286286
</message>
287287
<message>
288-
<location filename="../modules/tools.py" line="368"/>
288+
<location filename="../modules/tools.py" line="371"/>
289289
<source>Alert</source>
290290
<translation>Alerte</translation>
291291
</message>
292292
<message>
293-
<location filename="../modules/tools.py" line="368"/>
293+
<location filename="../modules/tools.py" line="371"/>
294294
<source>Proxy issue:
295295
You have a proxy set up on your OS {} but none in QGIS.
296296
Please set it up in &apos;Preferences/Options/Network&apos; then close/reopen the plugin.</source>
@@ -368,52 +368,52 @@ Vérifiez la configuration de QGIS (Préférénces/Options/Réseau) et de votre
368368
<context>
369369
<name>ResultsManager</name>
370370
<message>
371-
<location filename="../modules/results/display.py" line="162"/>
371+
<location filename="../modules/results/display.py" line="167"/>
372372
<source>Point</source>
373373
<translation>Point</translation>
374374
</message>
375375
<message>
376-
<location filename="../modules/results/display.py" line="165"/>
376+
<location filename="../modules/results/display.py" line="170"/>
377377
<source>Polygon</source>
378378
<translation>Polygone</translation>
379379
</message>
380380
<message>
381-
<location filename="../modules/results/display.py" line="168"/>
381+
<location filename="../modules/results/display.py" line="173"/>
382382
<source>Line</source>
383383
<translation>Linéaire</translation>
384384
</message>
385385
<message>
386-
<location filename="../modules/results/display.py" line="171"/>
386+
<location filename="../modules/results/display.py" line="176"/>
387387
<source>MultiPolygon</source>
388388
<translation>Multi-polygone</translation>
389389
</message>
390390
<message>
391-
<location filename="../modules/results/display.py" line="193"/>
391+
<location filename="../modules/results/display.py" line="198"/>
392392
<source>Unknown geometry</source>
393393
<translation>Géométrie inconnue</translation>
394394
</message>
395395
<message>
396-
<location filename="../modules/results/display.py" line="187"/>
396+
<location filename="../modules/results/display.py" line="192"/>
397397
<source>Raster</source>
398398
<translation>Raster</translation>
399399
</message>
400400
<message>
401-
<location filename="../modules/results/display.py" line="190"/>
401+
<location filename="../modules/results/display.py" line="195"/>
402402
<source>Service</source>
403403
<translation>Service</translation>
404404
</message>
405405
<message>
406-
<location filename="../modules/results/display.py" line="450"/>
406+
<location filename="../modules/results/display.py" line="455"/>
407407
<source>Data file</source>
408408
<translation>Donnée fichier</translation>
409409
</message>
410410
<message>
411-
<location filename="../modules/results/display.py" line="446"/>
411+
<location filename="../modules/results/display.py" line="451"/>
412412
<source>PostGIS table</source>
413413
<translation>Table PostGIS</translation>
414414
</message>
415415
<message>
416-
<location filename="../modules/results/display.py" line="398"/>
416+
<location filename="../modules/results/display.py" line="403"/>
417417
<source>Can&apos;t be added</source>
418418
<translation>Non ajoutable</translation>
419419
</message>

metadata.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ name=Isogeo
1111
qgisMinimumVersion=3.4
1212
qgisMaximumVersion=3.99
1313
description=Isogeo search engine within QGIS
14-
version=2.0.0-beta4
14+
version=3.0.0
1515
author=Isogeo
1616
email=projects+qgis@isogeo.com
1717

@@ -37,7 +37,7 @@ homepage=http://help.isogeo.com/qgis/
3737
category=Web
3838
icon=icon.png
3939
# experimental flag
40-
experimental=True
40+
experimental=False
4141

4242
# deprecated flag (applies to the whole plugin, not just a single version)
4343
deprecated=False

modules/api/auth.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def credentials_update(self, credentials_source: str = "QSettings"):
274274
self.api_params["url_auth"] = creds.get("uri_auth")
275275
self.api_params["url_token"] = creds.get("uri_token")
276276
self.api_params["url_redirect"] = creds.get("uri_redirect")
277-
# self.credentials_storer(store_location="QSettings")
277+
self.credentials_storer(store_location="QSettings")
278278
else:
279279
pass
280280

@@ -290,7 +290,6 @@ def display_auth_form(self):
290290
"""
291291
self.informer = UserInformer(message_bar=self.msgbar, trad=self.tr)
292292
self.auth_sig.connect(self.informer.authentication_slot)
293-
self.ask_shares.connect(self.informer.authentication_slot)
294293
self.ui_auth_form.chb_isogeo_editor.stateChanged.connect(
295294
lambda: qsettings.setValue(
296295
"isogeo/user/editor",
@@ -326,7 +325,8 @@ def display_auth_form(self):
326325
def credentials_uploader(self):
327326
"""Get file selected by the user and loads API credentials into plugin.
328327
If the selected is compliant, credentials are loaded from then it's
329-
moved inside plugin/_auth subfolder.
328+
moved inside plugin/_auth subfolder. auth_sig is emitted to inform the user
329+
about indicated file's accessibility and format validity.
330330
"""
331331
self.ui_auth_form.btn_browse_credentials.fileChanged.disconnect()
332332

@@ -383,7 +383,7 @@ def credentials_uploader(self):
383383

384384
# mave new credentials file to the _auth subfolder
385385
try:
386-
selected_file.rename(dest_path) # using pathlib.Path (= os.rename)
386+
selected_file.rename(dest_path) # using pathlib.Path (= os.rename)
387387
logger.debug(
388388
"Selected credentials file has been moved into plugin _auth subfolder"
389389
)

modules/api/request.py

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class ApiRequester(QgsNetworkAccessManager):
3333
- Request about application's shares
3434
- Request about ressources
3535
- Building request URLs
36+
- Parsing API's answer tags
3637
"""
3738

3839
api_sig = pyqtSignal(str)
@@ -66,8 +67,8 @@ def __init__(self):
6667
self.currentUrl = str
6768

6869
def setup_api_params(self, dict_params: dict):
69-
"""Store API parameters of the application (URLs and credentials)
70-
in class attributes.
70+
"""Store API parameters of the application (URLs and credentials) in class
71+
attributes.
7172
7273
:param dict dict_params: a dict containing API parameters provided
7374
by Authenticator().manage_api_initialization method.
@@ -83,8 +84,8 @@ def setup_api_params(self, dict_params: dict):
8384
self.send_request("token")
8485

8586
def create_request(self, request_type: str):
86-
"""Creates a QNetworkRequest() with appropriate headers and URL
87-
according to the 'request_type' parameter.
87+
"""Creates a QNetworkRequest() with appropriate headers and URL according to the
88+
'request_type' parameter.
8889
8990
:param str request_type: type of request to create. Options:
9091
- 'token'
@@ -131,8 +132,8 @@ def create_request(self, request_type: str):
131132
return request
132133

133134
def send_request(self, request_type: str = "search"):
134-
""" Sends a request to the Isogeo's API using QNetworkRequestManager.
135-
That's the handle_reply method which get the API's response. See below.
135+
""" Sends a request to the Isogeo's API using QNetworkRequestManager. That's the
136+
handle_reply method which get the API's response. See below.
136137
137138
:param str request_type: type of request to send. Options:
138139
- 'token'
@@ -154,23 +155,39 @@ def send_request(self, request_type: str = "search"):
154155
# get request for other
155156
else:
156157
req = self.get(request)
158+
# since https://github.com/isogeo/isogeo-plugin-qgis/issues/288, the slot is
159+
# connected to the request's signal and no more to QgsNetworkAccessManager's one
160+
# because otherweise, the plugin doesn't work on QGIS 3.8.x
157161
req.finished.connect(partial(self.handle_reply, req))
158162
return
159163

160164
def handle_reply(self, reply: QNetworkReply):
161-
"""Slot to QNetworkAccesManager.finished signal who handles the API's response to any type
162-
of request : 'token', 'search', 'shares' or 'details'.
163-
164-
The request's type is identicated from the url of the request from which the answer comes.
165-
Depending on the reply's content validity and the request's type, an appropriated signal
166-
is emitted with different data's value.
167-
168-
- For token requests : the api_sig signal is emitted wathever the replys's content but
169-
the mitted str's value depend on this content. A single slot is connected to this signal
170-
and acts according to value of the string recieved (see isogeo.py : Isogeo.token_slot).
171-
- For other requests : for each type of request there is a corresponding signal but the
172-
reply's parsed content is emitted wathever the request's type. Each signal is connected to
173-
an appropriate slot (see isogeo.py).
165+
"""Slot to QNetworkAccesManager.finished signal who handles the API's response
166+
to any type of request: 'token', 'search', 'shares' or 'details'.
167+
168+
The request's type is identicated from the url of the request from which the
169+
answer comes. Depending on the reply's content validity and the request's type,
170+
an appropriated signal is emitted with different data's value.
171+
172+
- api_sig is emitted when a token request is handled or when there is a problem
173+
with the API response. 2 slots are connected to api_sig:
174+
175+
- Isogeo.token_slot: it calls the necessary methods to initialize the plugin
176+
when authentication is successful (when "ok" is emitted) and disables the
177+
plugin when it's not (when other than "ok" str is emitted).
178+
179+
- UserInformer.request_slot: it displays to user the appropriated message
180+
when a problem with the API response is detected (when other than "ok" str
181+
is emitted) depending on the origin ofthe problem.
182+
183+
- search_sig is emitted when the API response to a search request is handled.
184+
Isogeo.search_slot() is connected to this signal
185+
186+
- details_sig is emitted when the API response to a details request is handled.
187+
MetadataDisplayer.show_complete_md() is connected to this signal
188+
189+
- shares_sig is emitted when the API response to a shares request is handled.
190+
SharesParser.send_share_info() is connected to this signal
174191
175192
:param QNetworkReply reply: Isogeo API response
176193
"""

0 commit comments

Comments
 (0)