Skip to content

Commit

Permalink
Merge branch 'master' into fix_memleaks_qgsstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jun 3, 2018
2 parents b21701b + bb2e15c commit d5afc71
Show file tree
Hide file tree
Showing 51 changed files with 427 additions and 236 deletions.
11 changes: 10 additions & 1 deletion python/CMakeLists.txt
Expand Up @@ -327,9 +327,18 @@ ENDFOREACH(pyfile)
FOREACH(module ${PY_MODULES})
ADD_CUSTOM_TARGET(py${module} ALL)
ADD_DEPENDENCIES(py${module} python_module_qgis__${module})

# concat auto_additions/*.py in _module_/__init__.py
FILE(GLOB PY_FILES_AUTO_ADDITIONS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${module}/auto_additions/*.py)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${module}/__init__.py.in ${QGIS_PYTHON_OUTPUT_DIRECTORY}/${module}/__init__.py COPYONLY)
FOREACH(pyfile ${PY_FILES_AUTO_ADDITIONS})
file(READ ${pyfile} CONTENTS)
file(APPEND ${QGIS_PYTHON_OUTPUT_DIRECTORY}/${module}/__init__.py "${CONTENTS}")
ENDFOREACH(pyfile)

FILE(GLOB PY_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${module}/*.py)
FILE(GLOB PY_FILES_ADDITIONS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${module}/additions/*.py)
INSTALL(FILES ${PY_FILES} DESTINATION "${QGIS_PYTHON_DIR}/${module}")
FILE(GLOB PY_FILES_ADDITIONS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${module}/additions/*.py)
INSTALL(FILES ${PY_FILES_ADDITIONS} DESTINATION "${QGIS_PYTHON_DIR}/${module}/additions")
SET(PY_FILES ${PY_FILES} ${PY_FILES_ADDITIONS})
FOREACH(pyfile ${PY_FILES})
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions python/analysis/auto_additions/__init__.py
@@ -0,0 +1,4 @@
"""
This folder is completed using sipify.pl script
It is not aimed to be manually edited
"""
35 changes: 0 additions & 35 deletions python/core/__init__.py → python/core/__init__.py.in
Expand Up @@ -31,7 +31,6 @@
from .additions.metaenum import metaEnumFromType, metaEnumFromValue
from .additions.processing import processing_output_layer_repr, processing_source_repr
from .additions.projectdirtyblocker import ProjectDirtyBlocker
from .additions.qgsdefaultvalue import _isValid
from .additions.qgsfeature import mapping_feature
from .additions.qgsfunction import register_function, qgsfunction
from .additions.qgsgeometry import _geometryNonZero, mapping_geometry
Expand All @@ -40,7 +39,6 @@
from .additions.readwritecontextentercategory import ReadWriteContextEnterCategory

# Injections into classes
QgsDefaultValue.__bool__ = _isValid
QgsFeature.__geo_interface__ = property(mapping_feature)
QgsGeometry.__bool__ = _geometryNonZero
QgsGeometry.__geo_interface__ = property(mapping_geometry)
Expand All @@ -52,36 +50,3 @@
QgsSettings.enumValue = _qgssettings_enum_value
QgsSettings.flagValue = _qgssettings_flag_value
QgsTask.fromFunction = fromFunction

# -----------------
# DO NOT EDIT BELOW
# These are automatically added by calling sipify.pl script

QgsAuthManager.MessageLevel.baseClass = QgsAuthManager
QgsDataItem.Type.baseClass = QgsDataItem
QgsDataItem.State.baseClass = QgsDataItem
QgsLayerItem.LayerType.baseClass = QgsLayerItem
QgsDataProvider.DataCapability.baseClass = QgsDataProvider
QgsDataSourceUri.SslMode.baseClass = QgsDataSourceUri
QgsFieldProxyModel.Filters.baseClass = QgsFieldProxyModel
Filters = QgsFieldProxyModel # dirty hack since SIP seems to introduce the flags in module
QgsMapLayerProxyModel.Filters.baseClass = QgsMapLayerProxyModel
Filters = QgsMapLayerProxyModel # dirty hack since SIP seems to introduce the flags in module
QgsNetworkContentFetcherRegistry.FetchingMode.baseClass = QgsNetworkContentFetcherRegistry
QgsSnappingConfig.SnappingMode.baseClass = QgsSnappingConfig
QgsSnappingConfig.SnappingType.baseClass = QgsSnappingConfig
QgsTolerance.UnitType.baseClass = QgsTolerance
QgsUnitTypes.DistanceUnit.baseClass = QgsUnitTypes
QgsUnitTypes.AreaUnit.baseClass = QgsUnitTypes
QgsUnitTypes.AngleUnit.baseClass = QgsUnitTypes
QgsUnitTypes.RenderUnit.baseClass = QgsUnitTypes
QgsUnitTypes.LayoutUnit.baseClass = QgsUnitTypes
QgsVectorSimplifyMethod.SimplifyHint.baseClass = QgsVectorSimplifyMethod
QgsVectorSimplifyMethod.SimplifyHints.baseClass = QgsVectorSimplifyMethod
SimplifyHints = QgsVectorSimplifyMethod # dirty hack since SIP seems to introduce the flags in module
QgsVectorSimplifyMethod.SimplifyAlgorithm.baseClass = QgsVectorSimplifyMethod
QgsRasterProjector.Precision.baseClass = QgsRasterProjector
QgsAbstractGeometry.SegmentationToleranceType.baseClass = QgsAbstractGeometry
QgsGeometry.BufferSide.baseClass = QgsGeometry
QgsGeometry.EndCapStyle.baseClass = QgsGeometry
QgsGeometry.JoinStyle.baseClass = QgsGeometry
4 changes: 4 additions & 0 deletions python/core/auto_additions/__init__.py
@@ -0,0 +1,4 @@
"""
This folder is completed using sipify.pl script
It is not aimed to be manually edited
"""
2 changes: 2 additions & 0 deletions python/core/auto_additions/qgsabstractgeometry.py
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/core/geometry/qgsabstractgeometry.h
QgsAbstractGeometry.SegmentationToleranceType.baseClass = QgsAbstractGeometry
2 changes: 2 additions & 0 deletions python/core/auto_additions/qgsauthmanager.py
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/core/auth/qgsauthmanager.h
QgsAuthManager.MessageLevel.baseClass = QgsAuthManager
4 changes: 4 additions & 0 deletions python/core/auto_additions/qgsdataitem.py
@@ -0,0 +1,4 @@
# The following has been generated automatically from src/core/qgsdataitem.h
QgsDataItem.Type.baseClass = QgsDataItem
QgsDataItem.State.baseClass = QgsDataItem
QgsLayerItem.LayerType.baseClass = QgsLayerItem
2 changes: 2 additions & 0 deletions python/core/auto_additions/qgsdataprovider.py
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/core/qgsdataprovider.h
QgsDataProvider.DataCapability.baseClass = QgsDataProvider
2 changes: 2 additions & 0 deletions python/core/auto_additions/qgsdatasourceuri.py
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/core/qgsdatasourceuri.h
QgsDataSourceUri.SslMode.baseClass = QgsDataSourceUri
2 changes: 2 additions & 0 deletions python/core/auto_additions/qgsdefaultvalue.py
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/core/qgsdefaultvalue.h
QgsDefaultValue.__bool__ = lambda self: self.isValid()
3 changes: 3 additions & 0 deletions python/core/auto_additions/qgsfieldproxymodel.py
@@ -0,0 +1,3 @@
# The following has been generated automatically from src/core/qgsfieldproxymodel.h
QgsFieldProxyModel.Filters.baseClass = QgsFieldProxyModel
Filters = QgsFieldProxyModel # dirty hack since SIP seems to introduce the flags in module
4 changes: 4 additions & 0 deletions python/core/auto_additions/qgsgeometry.py
@@ -0,0 +1,4 @@
# The following has been generated automatically from src/core/geometry/qgsgeometry.h
QgsGeometry.BufferSide.baseClass = QgsGeometry
QgsGeometry.EndCapStyle.baseClass = QgsGeometry
QgsGeometry.JoinStyle.baseClass = QgsGeometry
3 changes: 3 additions & 0 deletions python/core/auto_additions/qgsmaplayerproxymodel.py
@@ -0,0 +1,3 @@
# The following has been generated automatically from src/core/qgsmaplayerproxymodel.h
QgsMapLayerProxyModel.Filters.baseClass = QgsMapLayerProxyModel
Filters = QgsMapLayerProxyModel # dirty hack since SIP seems to introduce the flags in module
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/core/qgsnetworkcontentfetcherregistry.h
QgsNetworkContentFetcherRegistry.FetchingMode.baseClass = QgsNetworkContentFetcherRegistry
2 changes: 2 additions & 0 deletions python/core/auto_additions/qgsrasterprojector.py
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/core/raster/qgsrasterprojector.h
QgsRasterProjector.Precision.baseClass = QgsRasterProjector
3 changes: 3 additions & 0 deletions python/core/auto_additions/qgssnappingconfig.py
@@ -0,0 +1,3 @@
# The following has been generated automatically from src/core/qgssnappingconfig.h
QgsSnappingConfig.SnappingMode.baseClass = QgsSnappingConfig
QgsSnappingConfig.SnappingType.baseClass = QgsSnappingConfig
2 changes: 2 additions & 0 deletions python/core/auto_additions/qgstolerance.py
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/core/qgstolerance.h
QgsTolerance.UnitType.baseClass = QgsTolerance
6 changes: 6 additions & 0 deletions python/core/auto_additions/qgsunittypes.py
@@ -0,0 +1,6 @@
# The following has been generated automatically from src/core/qgsunittypes.h
QgsUnitTypes.DistanceUnit.baseClass = QgsUnitTypes
QgsUnitTypes.AreaUnit.baseClass = QgsUnitTypes
QgsUnitTypes.AngleUnit.baseClass = QgsUnitTypes
QgsUnitTypes.RenderUnit.baseClass = QgsUnitTypes
QgsUnitTypes.LayoutUnit.baseClass = QgsUnitTypes
5 changes: 5 additions & 0 deletions python/core/auto_additions/qgsvectorsimplifymethod.py
@@ -0,0 +1,5 @@
# The following has been generated automatically from src/core/qgsvectorsimplifymethod.h
QgsVectorSimplifyMethod.SimplifyHint.baseClass = QgsVectorSimplifyMethod
QgsVectorSimplifyMethod.SimplifyHints.baseClass = QgsVectorSimplifyMethod
SimplifyHints = QgsVectorSimplifyMethod # dirty hack since SIP seems to introduce the flags in module
QgsVectorSimplifyMethod.SimplifyAlgorithm.baseClass = QgsVectorSimplifyMethod
3 changes: 3 additions & 0 deletions python/core/auto_generated/auth/qgsauthmanager.sip.in
Expand Up @@ -18,6 +18,9 @@ class QgsAuthManager : QObject
%Docstring
Singleton offering an interface to manage the authentication configuration database
and to utilize configurations through various authentication method plugins

QgsAuthManager should not usually be directly created, but rather accessed through
:py:func:`QgsApplication.authManager()`
%End

%TypeHeaderCode
Expand Down
1 change: 0 additions & 1 deletion python/core/auto_generated/qgsdefaultvalue.sip.in
Expand Up @@ -77,7 +77,6 @@ Returns if this default value should be applied.
:return: false if the expression is a null string.
%End

operator bool() const;

};

Expand Down
49 changes: 0 additions & 49 deletions python/gui/__init__.py

This file was deleted.

Expand Up @@ -2,11 +2,11 @@

"""
***************************************************************************
qgsdefaultvalue.py
__init__.py
---------------------
Date : May 2018
Copyright : (C) 2018 by Denis Rouzaud
Email : denis@opengis.ch
Date : May 2014
Copyright : (C) 2014 by Nathan Woodrow
Email : woodrow dot nathan at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
Expand All @@ -17,6 +17,11 @@
***************************************************************************
"""

__author__ = 'Nathan Woodrow'
__date__ = 'May 2014'
__copyright__ = '(C) 2014, Nathan Woodrow'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'

def _isValid(self):
return self.isValid()
from qgis.PyQt import QtCore
from qgis._gui import *
4 changes: 4 additions & 0 deletions python/gui/auto_additions/__init__.py
@@ -0,0 +1,4 @@
"""
This folder is completed using sipify.pl script
It is not aimed to be manually edited
"""
3 changes: 3 additions & 0 deletions python/gui/auto_additions/qgsadvanceddigitizingdockwidget.py
@@ -0,0 +1,3 @@
# The following has been generated automatically from src/gui/qgsadvanceddigitizingdockwidget.h
QgsAdvancedDigitizingDockWidget.CadCapacities.baseClass = QgsAdvancedDigitizingDockWidget
CadCapacities = QgsAdvancedDigitizingDockWidget # dirty hack since SIP seems to introduce the flags in module
3 changes: 3 additions & 0 deletions python/gui/auto_additions/qgsattributetablefiltermodel.py
@@ -0,0 +1,3 @@
# The following has been generated automatically from src/gui/attributetable/qgsattributetablefiltermodel.h
QgsAttributeTableFilterModel.FilterMode.baseClass = QgsAttributeTableFilterModel
QgsAttributeTableFilterModel.ColumnType.baseClass = QgsAttributeTableFilterModel
2 changes: 2 additions & 0 deletions python/gui/auto_additions/qgsauthsettingswidget.py
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/gui/auth/qgsauthsettingswidget.h
QgsAuthSettingsWidget.WarningType.baseClass = QgsAuthSettingsWidget
2 changes: 2 additions & 0 deletions python/gui/auto_additions/qgscolorbutton.py
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/gui/qgscolorbutton.h
QgsColorButton.Behavior.baseClass = QgsColorButton
2 changes: 2 additions & 0 deletions python/gui/auto_additions/qgscolorwidgets.py
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/gui/qgscolorwidgets.h
QgsColorTextWidget.ColorTextFormat.baseClass = QgsColorTextWidget
2 changes: 2 additions & 0 deletions python/gui/auto_additions/qgsdualview.py
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/gui/attributetable/qgsdualview.h
QgsDualView.ViewMode.baseClass = QgsDualView
2 changes: 2 additions & 0 deletions python/gui/auto_additions/qgsfilterlineedit.py
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/gui/qgsfilterlineedit.h
QgsFilterLineEdit.ClearMode.baseClass = QgsFilterLineEdit
2 changes: 2 additions & 0 deletions python/gui/auto_additions/qgsfloatingwidget.py
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/gui/qgsfloatingwidget.h
QgsFloatingWidget.AnchorPoint.baseClass = QgsFloatingWidget
2 changes: 2 additions & 0 deletions python/gui/auto_additions/qgsfontbutton.py
@@ -0,0 +1,2 @@
# The following has been generated automatically from src/gui/qgsfontbutton.h
QgsFontButton.Mode.baseClass = QgsFontButton
5 changes: 5 additions & 0 deletions python/gui/auto_additions/qgsmaplayeractionregistry.py
@@ -0,0 +1,5 @@
# The following has been generated automatically from src/gui/qgsmaplayeractionregistry.h
QgsMapLayerAction.Targets.baseClass = QgsMapLayerAction
Targets = QgsMapLayerAction # dirty hack since SIP seems to introduce the flags in module
QgsMapLayerAction.Flags.baseClass = QgsMapLayerAction
Flags = QgsMapLayerAction # dirty hack since SIP seems to introduce the flags in module
4 changes: 4 additions & 0 deletions python/gui/auto_additions/qgsmaptoolidentify.py
@@ -0,0 +1,4 @@
# The following has been generated automatically from src/gui/qgsmaptoolidentify.h
QgsMapToolIdentify.IdentifyMode.baseClass = QgsMapToolIdentify
QgsMapToolIdentify.LayerType.baseClass = QgsMapToolIdentify
LayerType = QgsMapToolIdentify # dirty hack since SIP seems to introduce the flags in module
File renamed without changes.
4 changes: 4 additions & 0 deletions python/server/auto_additions/__init__.py
@@ -0,0 +1,4 @@
"""
This folder is completed using sipify.pl script
It is not aimed to be manually edited
"""

0 comments on commit d5afc71

Please sign in to comment.