1# -*- coding: utf-8 -*-

2

3"""

4***************************************************************************

5 __init__.py

6 ---------------------

7 Date : May 2014

8 Copyright : (C) 2014 by Nathan Woodrow

9 Email : woodrow dot nathan at gmail dot com

10***************************************************************************

11* *

12* This program is free software; you can redistribute it and/or modify *

13* it under the terms of the GNU General Public License as published by *

14* the Free Software Foundation; either version 2 of the License, or *

15* (at your option) any later version. *

16* *

17***************************************************************************

18"""

19

20__author__ = 'Nathan Woodrow'

21__date__ = 'May 2014'

22__copyright__ = '(C) 2014, Nathan Woodrow'

23

24 from qgis.PyQt.QtCore import NULL

25 from qgis._core import *

26

27 from .additions.edit import edit, QgsEditError

28 from .additions.fromfunction import fromFunction

29 from .additions.markerlinesymbollayer import *

30 from .additions.metaenum import metaEnumFromType, metaEnumFromValue

31 from .additions.processing import processing_output_layer_repr, processing_source_repr

32 from .additions.projectdirtyblocker import ProjectDirtyBlocker

33 from .additions.providermetadata import PyProviderMetadata

34 from .additions.qgsfeature import mapping_feature

35 from .additions.qgsfunction import register_function, qgsfunction

36 from .additions.qgsgeometry import _geometryNonZero, mapping_geometry

37 from .additions.qgssettings import _qgssettings_enum_value, _qgssettings_set_enum_value, _qgssettings_flag_value

38 from .additions.qgstaskwrapper import QgsTaskWrapper

39 from .additions.readwritecontextentercategory import ReadWriteContextEnterCategory

40 from .additions.validitycheck import check

41

42# Injections into classes

43 QgsFeature.__geo_interface__ = property(mapping_feature)

44 QgsGeometry.__bool__ = _geometryNonZero

45 QgsGeometry.__geo_interface__ = property(mapping_geometry)

46 QgsGeometry.__nonzero__ = _geometryNonZero

47 QgsProcessingFeatureSourceDefinition.__repr__ = processing_source_repr

48 QgsProcessingOutputLayerDefinition.__repr__ = processing_output_layer_repr

49 QgsProject.blockDirtying = ProjectDirtyBlocker

50 QgsReadWriteContext.enterCategory = ReadWriteContextEnterCategory

51 QgsSettings.enumValue = _qgssettings_enum_value

52 QgsSettings.setEnumValue = _qgssettings_set_enum_value

53 QgsSettings.flagValue = _qgssettings_flag_value

54 QgsTask.fromFunction = fromFunction

55

56# Classes patched using a derived class

57 QgsProviderMetadata = PyProviderMetadata

58"""

59 This folder is completed using sipify.pl script

60 It is not aimed to be manually edited

61"""

62# The following has been generated automatically from src/core/qgis.h

63 Qgis.PythonMacroMode.baseClass = Qgis

64# The following has been generated automatically from src/core/qgsabstractdatabaseproviderconnection.h

65 QgsAbstractDatabaseProviderConnection.TableFlags.baseClass = QgsAbstractDatabaseProviderConnection

66 TableFlags = QgsAbstractDatabaseProviderConnection # dirty hack since SIP seems to introduce the flags in module

67 QgsAbstractDatabaseProviderConnection.Capability.baseClass = QgsAbstractDatabaseProviderConnection

68 QgsAbstractDatabaseProviderConnection.Capabilities.baseClass = QgsAbstractDatabaseProviderConnection

69 Capabilities = QgsAbstractDatabaseProviderConnection # dirty hack since SIP seems to introduce the flags in module

70# The following has been generated automatically from src/core/geometry/qgsabstractgeometry.h

71 QgsAbstractGeometry.SegmentationToleranceType.baseClass = QgsAbstractGeometry

72# The following has been generated automatically from src/core/auth/qgsauthmanager.h

73 QgsAuthManager.MessageLevel.baseClass = QgsAuthManager

74# The following has been generated automatically from src/core/qgsdataitem.h

75 QgsDataItem.Type.baseClass = QgsDataItem

76 QgsDataItem.State.baseClass = QgsDataItem

77 QgsLayerItem.LayerType.baseClass = QgsLayerItem

78# The following has been generated automatically from src/core/qgsdatasourceuri.h

79 QgsDataSourceUri.SslMode.baseClass = QgsDataSourceUri

80# The following has been generated automatically from src/core/qgsdefaultvalue.h

81 QgsDefaultValue.__bool__ = lambda self: self.isValid()

82# The following has been generated automatically from src/core/dxf/qgsdxfexport.h

83# monkey patching scoped based enum

84 QgsDxfExport.ExportResult.Success.__doc__ = "Successful export"

85 QgsDxfExport.ExportResult.InvalidDeviceError.__doc__ = "Invalid device error"

86 QgsDxfExport.ExportResult.DeviceNotWritableError.__doc__ = "Device not writable error"

87 QgsDxfExport.ExportResult.EmptyExtentError.__doc__ = "Empty extent, no extent given and no extent could be derived from layers"

88 QgsDxfExport.ExportResult.__doc__ = 'The result of an export as dxf operation\n\n.. versionadded:: 3.10.1\n\n' + '* ``Success``: ' + QgsDxfExport.ExportResult.Success.__doc__ + '\n' + '* ``InvalidDeviceError``: ' + QgsDxfExport.ExportResult.InvalidDeviceError.__doc__ + '\n' + '* ``DeviceNotWritableError``: ' + QgsDxfExport.ExportResult.DeviceNotWritableError.__doc__ + '\n' + '* ``EmptyExtentError``: ' + QgsDxfExport.ExportResult.EmptyExtentError.__doc__

89# --

90# The following has been generated automatically from src/core/qgseditformconfig.h

91 QgsEditFormConfig.EditorLayout.baseClass = QgsEditFormConfig

92 QgsEditFormConfig.FeatureFormSuppress.baseClass = QgsEditFormConfig

93 QgsEditFormConfig.PythonInitCodeSource.baseClass = QgsEditFormConfig

94# The following has been generated automatically from src/core/qgsfieldproxymodel.h

95 QgsFieldProxyModel.Filters.baseClass = QgsFieldProxyModel

96 Filters = QgsFieldProxyModel # dirty hack since SIP seems to introduce the flags in module

97# The following has been generated automatically from src/core/geometry/qgsgeometry.h

98 QgsGeometry.BufferSide.baseClass = QgsGeometry

99 QgsGeometry.EndCapStyle.baseClass = QgsGeometry

100 QgsGeometry.JoinStyle.baseClass = QgsGeometry

101# The following has been generated automatically from src/core/geocms/geonode/qgsgeonoderequest.h

102# monkey patching scoped based enum

103 QgsGeoNodeRequest.BackendServer.Unknown.__doc__ = "Unknown backend"

104 QgsGeoNodeRequest.BackendServer.QgisServer.__doc__ = "QGIS server used as backend"

105 QgsGeoNodeRequest.BackendServer.Geoserver.__doc__ = "Geoserver used as backend"

106 QgsGeoNodeRequest.BackendServer.__doc__ = 'GeoNode backend server type.\n\n' + '* ``Unknown``: ' + QgsGeoNodeRequest.BackendServer.Unknown.__doc__ + '\n' + '* ``QgisServer``: ' + QgsGeoNodeRequest.BackendServer.QgisServer.__doc__ + '\n' + '* ``Geoserver``: ' + QgsGeoNodeRequest.BackendServer.Geoserver.__doc__

107# --

108# The following has been generated automatically from src/core/layout/qgslayoutmanager.h

109 QgsLayoutManagerProxyModel.Filters.baseClass = QgsLayoutManagerProxyModel

110 Filters = QgsLayoutManagerProxyModel # dirty hack since SIP seems to introduce the flags in module

111# The following has been generated automatically from src/core/locator/qgslocatorfilter.h

112 QgsLocatorFilter.Priority.baseClass = QgsLocatorFilter

113 QgsLocatorFilter.Flags.baseClass = QgsLocatorFilter

114 Flags = QgsLocatorFilter # dirty hack since SIP seems to introduce the flags in module

115# The following has been generated automatically from src/core/qgsmaplayer.h

116 QgsMapLayer.LayerType = QgsMapLayerType

117# monkey patching scoped based enum

118 QgsMapLayer.VectorLayer = QgsMapLayerType.VectorLayer

119 QgsMapLayer.VectorLayer.__doc__ = ""

120 QgsMapLayer.RasterLayer = QgsMapLayerType.RasterLayer

121 QgsMapLayer.RasterLayer.__doc__ = ""

122 QgsMapLayer.PluginLayer = QgsMapLayerType.PluginLayer

123 QgsMapLayer.PluginLayer.__doc__ = ""

124 QgsMapLayer.MeshLayer = QgsMapLayerType.MeshLayer

125 QgsMapLayer.MeshLayer.__doc__ = "Added in 3.2"

126 QgsMapLayerType.__doc__ = 'Types of layers that can be added to a map\n\n.. versionadded:: 3.8\n\n' + '* ``VectorLayer``: ' + QgsMapLayerType.VectorLayer.__doc__ + '\n' + '* ``RasterLayer``: ' + QgsMapLayerType.RasterLayer.__doc__ + '\n' + '* ``PluginLayer``: ' + QgsMapLayerType.PluginLayer.__doc__ + '\n' + '* ``MeshLayer``: ' + QgsMapLayerType.MeshLayer.__doc__

127# --

128 QgsMapLayer.LayerFlag.baseClass = QgsMapLayer

129 QgsMapLayer.LayerFlags.baseClass = QgsMapLayer

130 LayerFlags = QgsMapLayer # dirty hack since SIP seems to introduce the flags in module

131 QgsMapLayer.StyleCategory.baseClass = QgsMapLayer

132 QgsMapLayer.StyleCategories.baseClass = QgsMapLayer

133 StyleCategories = QgsMapLayer # dirty hack since SIP seems to introduce the flags in module

134# The following has been generated automatically from src/core/qgsmaplayermodel.h

135 QgsMapLayerModel.ItemDataRole.baseClass = QgsMapLayerModel

136# The following has been generated automatically from src/core/qgsmaplayerproxymodel.h

137 QgsMapLayerProxyModel.Filters.baseClass = QgsMapLayerProxyModel

138 Filters = QgsMapLayerProxyModel # dirty hack since SIP seems to introduce the flags in module

139# The following has been generated automatically from src/core/qgsnetworkcontentfetcherregistry.h

140 QgsNetworkContentFetcherRegistry.FetchingMode.baseClass = QgsNetworkContentFetcherRegistry

141# The following has been generated automatically from src/core/processing/qgsprocessingutils.h

142# monkey patching scoped based enum

143 QgsProcessingUtils.UnknownType = QgsProcessingUtils.LayerHint.UnknownType

144 QgsProcessingUtils.LayerHint.UnknownType.__doc__ = "Unknown layer type"

145 QgsProcessingUtils.Vector = QgsProcessingUtils.LayerHint.Vector

146 QgsProcessingUtils.LayerHint.Vector.__doc__ = "Vector layer type"

147 QgsProcessingUtils.Raster = QgsProcessingUtils.LayerHint.Raster

148 QgsProcessingUtils.LayerHint.Raster.__doc__ = "Raster layer type"

149 QgsProcessingUtils.Mesh = QgsProcessingUtils.LayerHint.Mesh

150 QgsProcessingUtils.LayerHint.Mesh.__doc__ = "Mesh layer type \since QGIS 3.6"

151 QgsProcessingUtils.LayerHint.__doc__ = 'Layer type hints.\n\n.. versionadded:: 3.4\n\n' + '* ``UnknownType``: ' + QgsProcessingUtils.LayerHint.UnknownType.__doc__ + '\n' + '* ``Vector``: ' + QgsProcessingUtils.LayerHint.Vector.__doc__ + '\n' + '* ``Raster``: ' + QgsProcessingUtils.LayerHint.Raster.__doc__ + '\n' + '* ``Mesh``: ' + QgsProcessingUtils.LayerHint.Mesh.__doc__

152# --

153# The following has been generated automatically from src/core/qgsprovidermetadata.h

154# monkey patching scoped based enum

155 QgsProviderMetadata.FilterType.FilterVector.__doc__ = ""

156 QgsProviderMetadata.FilterType.FilterRaster.__doc__ = ""

157 QgsProviderMetadata.FilterType.FilterMesh.__doc__ = ""

158 QgsProviderMetadata.FilterType.FilterMeshDataset.__doc__ = ""

159 QgsProviderMetadata.FilterType.__doc__ = 'Type of file filters\n\n.. versionadded:: 3.10\n\n' + '* ``FilterVector``: ' + QgsProviderMetadata.FilterType.FilterVector.__doc__ + '\n' + '* ``FilterRaster``: ' + QgsProviderMetadata.FilterType.FilterRaster.__doc__ + '\n' + '* ``FilterMesh``: ' + QgsProviderMetadata.FilterType.FilterMesh.__doc__ + '\n' + '* ``FilterMeshDataset``: ' + QgsProviderMetadata.FilterType.FilterMeshDataset.__doc__

160# --

161# The following has been generated automatically from src/core/raster/qgsrasterprojector.h

162 QgsRasterProjector.Precision.baseClass = QgsRasterProjector

163# The following has been generated automatically from src/core/qgssnappingconfig.h

164 QgsSnappingConfig.SnappingMode.baseClass = QgsSnappingConfig

165 QgsSnappingConfig.SnappingType.baseClass = QgsSnappingConfig

166# The following has been generated automatically from src/core/symbology/qgsstyleentityvisitor.h

167# monkey patching scoped based enum

168 QgsStyleEntityVisitorInterface.NodeType.Project.__doc__ = "QGIS Project node"

169 QgsStyleEntityVisitorInterface.NodeType.Layer.__doc__ = "Map layer"

170 QgsStyleEntityVisitorInterface.NodeType.SymbolRule.__doc__ = "Rule based symbology or label child rule"

171 QgsStyleEntityVisitorInterface.NodeType.Layouts.__doc__ = "Layout collection"

172 QgsStyleEntityVisitorInterface.NodeType.PrintLayout.__doc__ = "An individual print layout"

173 QgsStyleEntityVisitorInterface.NodeType.LayoutItem.__doc__ = "Individual item in a print layout"

174 QgsStyleEntityVisitorInterface.NodeType.Report.__doc__ = "A QGIS print report"

175 QgsStyleEntityVisitorInterface.NodeType.ReportHeader.__doc__ = "Report header section"

176 QgsStyleEntityVisitorInterface.NodeType.ReportFooter.__doc__ = "Report footer section"

177 QgsStyleEntityVisitorInterface.NodeType.ReportSection.__doc__ = "Report sub section"

178 QgsStyleEntityVisitorInterface.NodeType.Annotations.__doc__ = "Annotations collection"

179 QgsStyleEntityVisitorInterface.NodeType.Annotation.__doc__ = "An individual annotation"

180 QgsStyleEntityVisitorInterface.NodeType.__doc__ = 'Describes the types of nodes which may be visited by the visitor.\n\n' + '* ``Project``: ' + QgsStyleEntityVisitorInterface.NodeType.Project.__doc__ + '\n' + '* ``Layer``: ' + QgsStyleEntityVisitorInterface.NodeType.Layer.__doc__ + '\n' + '* ``SymbolRule``: ' + QgsStyleEntityVisitorInterface.NodeType.SymbolRule.__doc__ + '\n' + '* ``Layouts``: ' + QgsStyleEntityVisitorInterface.NodeType.Layouts.__doc__ + '\n' + '* ``PrintLayout``: ' + QgsStyleEntityVisitorInterface.NodeType.PrintLayout.__doc__ + '\n' + '* ``LayoutItem``: ' + QgsStyleEntityVisitorInterface.NodeType.LayoutItem.__doc__ + '\n' + '* ``Report``: ' + QgsStyleEntityVisitorInterface.NodeType.Report.__doc__ + '\n' + '* ``ReportHeader``: ' + QgsStyleEntityVisitorInterface.NodeType.ReportHeader.__doc__ + '\n' + '* ``ReportFooter``: ' + QgsStyleEntityVisitorInterface.NodeType.ReportFooter.__doc__ + '\n' + '* ``ReportSection``: ' + QgsStyleEntityVisitorInterface.NodeType.ReportSection.__doc__ + '\n' + '* ``Annotations``: ' + QgsStyleEntityVisitorInterface.NodeType.Annotations.__doc__ + '\n' + '* ``Annotation``: ' + QgsStyleEntityVisitorInterface.NodeType.Annotation.__doc__

181# --

182# The following has been generated automatically from src/core/qgstaskmanager.h

183 QgsTask.TaskStatus.baseClass = QgsTask

184# The following has been generated automatically from src/core/qgstolerance.h

185 QgsTolerance.UnitType.baseClass = QgsTolerance

186# The following has been generated automatically from src/core/qgsunittypes.h

187 QgsUnitTypes.SystemOfMeasurement.baseClass = QgsUnitTypes

188 QgsUnitTypes.DistanceUnit.baseClass = QgsUnitTypes

189 QgsUnitTypes.AreaUnit.baseClass = QgsUnitTypes

190 QgsUnitTypes.VolumeUnit.baseClass = QgsUnitTypes

191 QgsUnitTypes.AngleUnit.baseClass = QgsUnitTypes

192 QgsUnitTypes.RenderUnit.baseClass = QgsUnitTypes

193 QgsUnitTypes.LayoutUnit.baseClass = QgsUnitTypes

194# The following has been generated automatically from src/core/qgsvectorlayerserverproperties.h

195 QgsVectorLayerServerProperties.PredefinedWmsDimensionName.baseClass = QgsVectorLayerServerProperties

196# The following has been generated automatically from src/core/qgsvectorsimplifymethod.h

197 QgsVectorSimplifyMethod.SimplifyHint.baseClass = QgsVectorSimplifyMethod

198 QgsVectorSimplifyMethod.SimplifyHints.baseClass = QgsVectorSimplifyMethod

199 SimplifyHints = QgsVectorSimplifyMethod # dirty hack since SIP seems to introduce the flags in module

200 QgsVectorSimplifyMethod.SimplifyAlgorithm.baseClass = QgsVectorSimplifyMethod

201# The following has been generated automatically from src/core/geometry/qgswkbtypes.h

202 QgsWkbTypes.Type.baseClass = QgsWkbTypes

203 QgsWkbTypes.GeometryType.baseClass = QgsWkbTypes