From aa2c36df2a0be57def79818647c530498690d44c Mon Sep 17 00:00:00 2001
From: "Benjamin Jakimow benjamin.jakimow@geo.hu-berlin.de"
 <benjamin.jakimow@geo.hu-berlin.de>
Date: Sun, 15 Nov 2020 17:02:50 +0100
Subject: [PATCH] updates QPS added json files to plugin folder

Signed-off-by: Benjamin Jakimow benjamin.jakimow@geo.hu-berlin.de <benjamin.jakimow@geo.hu-berlin.de>
---
 eotimeseriesviewer/externals/qps/__init__.py | 5 ++++-
 scripts/create_plugin.py                     | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/eotimeseriesviewer/externals/qps/__init__.py b/eotimeseriesviewer/externals/qps/__init__.py
index dace95d7..224addf4 100644
--- a/eotimeseriesviewer/externals/qps/__init__.py
+++ b/eotimeseriesviewer/externals/qps/__init__.py
@@ -39,7 +39,7 @@ DIR_UI_FILES = DIR_QPS / 'ui'
 DIR_ICONS = DIR_UI_FILES / 'icons'
 QPS_RESOURCE_FILE = DIR_QPS / 'qpsresources_rc.py'
 
-MAPLAYER_CONFIGWIDGET_FACTORIES = list()
+MAPLAYER_CONFIGWIDGET_FACTORIES: typing.List[QgsMapLayerConfigWidgetFactory] = list()
 
 if Qgis.QGIS_VERSION < MIN_QGIS_VERSION:
     warnings.warn(f'Your QGIS ({Qgis.QGIS_VERSION}) is outdated. '
@@ -54,6 +54,7 @@ def registerMapLayerConfigWidgetFactory(factory: QgsMapLayerConfigWidgetFactory)
     :return:
     :rtype:
     """
+    global MAPLAYER_CONFIGWIDGET_FACTORIES
     assert isinstance(factory, QgsMapLayerConfigWidgetFactory)
     if factory not in MAPLAYER_CONFIGWIDGET_FACTORIES:
         MAPLAYER_CONFIGWIDGET_FACTORIES.append(factory)
@@ -68,6 +69,7 @@ def unregisterMapLayerConfigWidgetFactory(factory: QgsMapLayerConfigWidgetFactor
     :rtype:
     """
     assert isinstance(factory, QgsMapLayerConfigWidgetFactory)
+    global MAPLAYER_CONFIGWIDGET_FACTORIES
     while factory in MAPLAYER_CONFIGWIDGET_FACTORIES:
         MAPLAYER_CONFIGWIDGET_FACTORIES.remove(factory)
 
@@ -78,6 +80,7 @@ def mapLayerConfigWidgetFactories() -> typing.List[QgsMapLayerConfigWidgetFactor
     :return: list of QgsMapLayerConfigWidgetFactories
     :rtype:
     """
+    global MAPLAYER_CONFIGWIDGET_FACTORIES
     return MAPLAYER_CONFIGWIDGET_FACTORIES[:]
 
 
diff --git a/scripts/create_plugin.py b/scripts/create_plugin.py
index 202c239e..e509e3af 100644
--- a/scripts/create_plugin.py
+++ b/scripts/create_plugin.py
@@ -134,7 +134,7 @@ def create_plugin(include_testdata: bool = False,
     compileEOTSVResourceFiles()
 
     # copy python and other resource files
-    pattern = re.compile(r'\.(py|svg|png|txt|ui|tif|qml|md|js|css)$')
+    pattern = re.compile(r'\.(py|svg|png|txt|ui|tif|qml|md|js|css|json)$')
     files = list(scantree(DIR_REPO / 'eotimeseriesviewer', pattern=pattern))
     # add unit tests
     files.extend(list(scantree(DIR_REPO / 'tests', pattern=re.compile(r'\.py$'))))
-- 
GitLab