From 22e8aa590c148350658f7e2684387b2d084aa2de Mon Sep 17 00:00:00 2001 From: gena Date: Mon, 29 Mar 2021 22:06:37 +0200 Subject: [PATCH 1/2] Bugfixing backward-compatibility (make sure it does not crash) --- README.md | 3 +++ ee_plugin.py | 10 +++++++++- metadata.txt | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5c96188..73b28af 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,9 @@ A: Go to http://code.earthengine.google.com and make sure you can access code ed - [x] Fixed the authentication dialog when the url shortener doesn't work by any reason [#66](https://github.com/gee-community/qgis-earthengine-plugin/issues/66) - [x] Fix loading extra python dependencies to the plugin, fix [#62](https://github.com/gee-community/qgis-earthengine-plugin/issues/62) +#### Alpha 0.0.4 (Q1 2021) :heavy_check_mark: +- [x] Minor bugfix release (EE authentication) + #### 1.0.0 (Q2 2021) :hourglass: - [ ] EE vector layer inspector - [ ] EE raster collection layer inspector diff --git a/ee_plugin.py b/ee_plugin.py index 891d8ef..af79679 100644 --- a/ee_plugin.py +++ b/ee_plugin.py @@ -130,8 +130,16 @@ def updateLayers(self): ee_object = l.customProperty('ee-object') ee_object_vis = l.customProperty('ee-object-vis') + # check for backward-compatibility, older file formats (before 0.0.3) store ee-objects in ee-script property an no ee-object-vis is stored + # also, it seems that JSON representation of persistent object has been changed, making it difficult to read older EE JSON + if ee_object is None: + QgsMessageLog.logMessage('Map layer saved with older version of EE plugin is detected, backward-compatibility for versions before 0.0.3 is not supported due to changes in EE library, please re-create EE layer by re-running the Python script') + return + ee_object = ee.deserializer.fromJSON(ee_object) - ee_object_vis = json.loads(ee_object_vis) + + if ee_object_vis is not None: + ee_object_vis = json.loads(ee_object_vis) # update loaded EE layer diff --git a/metadata.txt b/metadata.txt index cd9106e..0b0979f 100644 --- a/metadata.txt +++ b/metadata.txt @@ -10,7 +10,7 @@ name=Google Earth Engine qgisMinimumVersion=3.8 description=Integrates QGIS with Google Earth Engine -version=0.0.3 +version=0.0.4 author=Gennadii Donchyts email=gennadiy.donchyts@gmail.com From 907866b3d9574675f4d6a430befe30ebcfad2ced Mon Sep 17 00:00:00 2001 From: gena Date: Mon, 29 Mar 2021 22:35:42 +0200 Subject: [PATCH 2/2] fixing PR --- ee_plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee_plugin.py b/ee_plugin.py index af79679..36751ea 100644 --- a/ee_plugin.py +++ b/ee_plugin.py @@ -133,7 +133,7 @@ def updateLayers(self): # check for backward-compatibility, older file formats (before 0.0.3) store ee-objects in ee-script property an no ee-object-vis is stored # also, it seems that JSON representation of persistent object has been changed, making it difficult to read older EE JSON if ee_object is None: - QgsMessageLog.logMessage('Map layer saved with older version of EE plugin is detected, backward-compatibility for versions before 0.0.3 is not supported due to changes in EE library, please re-create EE layer by re-running the Python script') + print('\nWARNING:\n Map layer saved with older version of EE plugin is detected, backward-compatibility for versions before 0.0.3 is not supported due to changes in EE library, please re-create EE layer by re-running the Python script\n') return ee_object = ee.deserializer.fromJSON(ee_object)