INGV / qquake

A plugin for QGIS 3.x that relies on web services for loading seismological data
https://www.emidius.eu/qquake/
GNU General Public License v3.0
7 stars 3 forks source link

Python error while retrievgin macroseismic data #56

Closed MarioLocati closed 2 years ago

MarioLocati commented 2 years ago

@nyalldawson I discovered a problem while using the latest QQuake v1.3 with macroseismic data web services.
I get the Python error UnboundLocalError: local variable 'style' referenced before assignment whenever trying to download macroseismic data, either from AHEAD or ASMI webservices, it doesn't matter if with a "basic" or an "extended" output table.

QQuake v1.3, QGIS v3.10.4 on Ubuntu 20.04

An error has occurred while executing Python code: 

UnboundLocalError: local variable 'style' referenced before assignment 
Traceback (most recent call last):
  File "/home/mario/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qquake/gui/qquake_dialog.py", line 968, in _fetcher_finished
    layer = self.fetcher.create_mdp_layer()
  File "/home/mario/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qquake/fetcher.py", line 783, in create_mdp_layer
    return self.mdpset_to_layer(self.result)
  File "/home/mario/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qquake/fetcher.py", line 711, in mdpset_to_layer
    style_attr = style.get('classified_attribute_text')
UnboundLocalError: local variable 'style' referenced before assignment

Python version: 3.8.10 (default, Sep 28 2021, 16:10:42) [GCC 9.3.0] 
QGIS version: 3.10.4-A Coruña A Coruña, exported 

Python Path:
/usr/share/qgis/python
/home/mario/.local/share/QGIS/QGIS3/profiles/default/python
/home/mario/.local/share/QGIS/QGIS3/profiles/default/python/plugins
/usr/share/qgis/python/plugins
/usr/lib/python38.zip
/usr/lib/python3.8
/usr/lib/python3.8/lib-dynload
/usr/local/lib/python3.8/dist-packages
/usr/lib/python3/dist-packages
/home/mario/.local/share/QGIS/QGIS3/profiles/default/python

QQuake v1.3, QGIS v3.16.11 on Windows 10

An error has occurred while executing Python code: 

UnboundLocalError: local variable 'style' referenced before assignment 
Traceback (most recent call last):
  File "C:\Users/mario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qquake\gui\qquake_dialog.py", line 968, in _fetcher_finished
    layer = self.fetcher.create_mdp_layer()
  File "C:\Users/mario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qquake\fetcher.py", line 783, in create_mdp_layer
    return self.mdpset_to_layer(self.result)
  File "C:\Users/mario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qquake\fetcher.py", line 711, in mdpset_to_layer
    style_attr = style.get('classified_attribute_text')
UnboundLocalError: local variable 'style' referenced before assignment

Python version: 3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] 
QGIS version: 3.16.11-Hannover Hannover, 26cc1c76 

Python Path:
C:/PROGRA~1/QGIS31~1.11/apps/qgis-ltr/./python
C:/Users/mario/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/mario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA~1/QGIS31~1.11/apps/qgis-ltr/./python/plugins
C:\Program Files\QGIS 3.16.11\bin\python39.zip
C:\PROGRA~1\QGIS31~1.11\apps\Python39\DLLs
C:\PROGRA~1\QGIS31~1.11\apps\Python39\lib
C:\Program Files\QGIS 3.16.11\bin
C:\PROGRA~1\QGIS31~1.11\apps\Python39
C:\PROGRA~1\QGIS31~1.11\apps\Python39\lib\site-packages
C:\PROGRA~1\QGIS31~1.11\apps\Python39\lib\site-packages\win32
C:\PROGRA~1\QGIS31~1.11\apps\Python39\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS31~1.11\apps\Python39\lib\site-packages\Pythonwin
C:/Users/mario/AppData/Roaming/QGIS/QGIS3\profiles\default/python