diff --git a/python/core/__init__.py.in b/python/core/__init__.py.in index b5e0359b5e2..4ae7a7c9c07 100644 --- a/python/core/__init__.py.in +++ b/python/core/__init__.py.in @@ -26,7 +26,6 @@ from qgis._core import * from .additions.edit import edit, QgsEditError from .additions.fromfunction import fromFunction -from .additions.markerlinesymbollayer import * from .additions.metaenum import metaEnumFromType, metaEnumFromValue from .additions.processing import processing_output_layer_repr, processing_source_repr from .additions.projectdirtyblocker import ProjectDirtyBlocker @@ -38,7 +37,6 @@ from .additions.qgssettings import _qgssettings_enum_value, _qgssettings_set_enu from .additions.qgstaskwrapper import QgsTaskWrapper from .additions.readwritecontextentercategory import ReadWriteContextEnterCategory from .additions.validitycheck import check -from .additions import qgsdataprovider # Injections into classes QgsFeature.__geo_interface__ = property(mapping_feature) @@ -56,3 +54,26 @@ QgsTask.fromFunction = fromFunction # Classes patched using a derived class QgsProviderMetadata = PyProviderMetadata + +# monkey patch deprecated enum values to maintain API +# TODO - remove for QGIS 4.0 +QgsMarkerLineSymbolLayer.Interval = QgsTemplatedLineSymbolLayerBase.Interval +QgsMarkerLineSymbolLayer.Vertex = QgsTemplatedLineSymbolLayerBase.Vertex +QgsMarkerLineSymbolLayer.LastVertex = QgsTemplatedLineSymbolLayerBase.LastVertex +QgsMarkerLineSymbolLayer.FirstVertex = QgsTemplatedLineSymbolLayerBase.FirstVertex +QgsMarkerLineSymbolLayer.CentralPoint = QgsTemplatedLineSymbolLayerBase.CentralPoint +QgsMarkerLineSymbolLayer.CurvePoint = QgsTemplatedLineSymbolLayerBase.CurvePoint + +# Monkey patch static const "QgsDataProvider.SUBLAYER_SEPARATOR" which was removed for QGIS 3.12 +QgsDataProvider.SUBLAYER_SEPARATOR = QgsDataProvider.sublayerSeparator() + +# Monkey patch Qgis vars +Qgis.QGIS_VERSION = Qgis.version() +Qgis.QGIS_VERSION_INT = Qgis.versionInt() +Qgis.QGIS_VERSION_RELEASE_NAME = Qgis.releaseName() + +core.GEOWKT = geoWkt() +core.PROJECT_SCALES = projectScales() +core.GEOPROJ4 = geoProj4() +core.GEO_EPSG_CRS_AUTHID = geoEpsgCrsAuthId() +core.GEO_NONE = geoNone() diff --git a/python/core/additions/markerlinesymbollayer.py b/python/core/additions/markerlinesymbollayer.py deleted file mode 100644 index 27539b76468..00000000000 --- a/python/core/additions/markerlinesymbollayer.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -*************************************************************************** - markerlinesymbollayer.py - --------------------- - Date : March 2019 - Copyright : (C) 2019 by Nyall Dawson - Email : nyall dot dawson at gmail dot com -*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -*************************************************************************** -""" -from qgis._core import ( - QgsMarkerLineSymbolLayer, - QgsTemplatedLineSymbolLayerBase) - - -# monkey patch deprecated enum values to maintain API -# TODO - remove for QGIS 4.0 -QgsMarkerLineSymbolLayer.Interval = QgsTemplatedLineSymbolLayerBase.Interval -QgsMarkerLineSymbolLayer.Vertex = QgsTemplatedLineSymbolLayerBase.Vertex -QgsMarkerLineSymbolLayer.LastVertex = QgsTemplatedLineSymbolLayerBase.LastVertex -QgsMarkerLineSymbolLayer.FirstVertex = QgsTemplatedLineSymbolLayerBase.FirstVertex -QgsMarkerLineSymbolLayer.CentralPoint = QgsTemplatedLineSymbolLayerBase.CentralPoint -QgsMarkerLineSymbolLayer.CurvePoint = QgsTemplatedLineSymbolLayerBase.CurvePoint diff --git a/python/core/additions/qgis.py b/python/core/additions/qgis.py deleted file mode 100644 index 4543ae2a210..00000000000 --- a/python/core/additions/qgis.py +++ /dev/null @@ -1,18 +0,0 @@ -from qgis.core import Qgis -from qgis.core import geoWkt -from qgis.core import projectScales -from qgis.core import geoProj4 -from qgis.core import geoEpsgCrsAuthId -from qgis.core import geoNone - -from qgis import core - -Qgis.QGIS_VERSION = Qgis.version() -Qgis.QGIS_VERSION_INT = Qgis.versionInt() -Qgis.QGIS_VERSION_RELEASE_NAME = Qgis.releaseName() - -core.GEOWKT = geoWkt() -core.PROJECT_SCALES = projectScales() -core.GEOPROJ4 = geoProj4() -core.GEO_EPSG_CRS_AUTHID = geoEpsgCrsAuthId() -core.GEO_NONE = geoNone() diff --git a/python/core/additions/qgsdataprovider.py b/python/core/additions/qgsdataprovider.py deleted file mode 100644 index ae05918e9e2..00000000000 --- a/python/core/additions/qgsdataprovider.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -*************************************************************************** - qgsdataprovider.py - --------------------- - Date : November 2019 - Copyright : (C) 2019 by Matthias Kuhn - Email : matthias@opengis.ch -*************************************************************************** -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -*************************************************************************** -""" - -from qgis.core import QgsDataProvider - -# Monkey patch static const "QgsDataProvider.SUBLAYER_SEPARATOR" which was removed for QGIS 3.12 -QgsDataProvider.SUBLAYER_SEPARATOR = QgsDataProvider.sublayerSeparator()