mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
Cleanup python code
This commit is contained in:
parent
52f0994bf6
commit
abf9880182
@ -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()
|
||||
|
@ -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
|
@ -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()
|
@ -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()
|
Loading…
x
Reference in New Issue
Block a user