Skip to content
Permalink
Browse files

[processing] Remove various unused imports and variables

  • Loading branch information
m-kuhn committed Mar 15, 2016
1 parent e9b30a0 commit eb8167d92051b8ed6c0e5336361c3a5c59f73525
Showing with 29 additions and 46 deletions.
  1. +1 −1 python/plugins/processing/algs/qgis/AddTableField.py
  2. +0 −2 python/plugins/processing/algs/qgis/BasicStatisticsNumbers.py
  3. +1 −5 python/plugins/processing/algs/qgis/Datasources2Vrt.py
  4. +1 −3 python/plugins/processing/algs/qgis/DefineProjection.py
  5. +0 −2 python/plugins/processing/algs/qgis/DensifyGeometries.py
  6. +1 −1 python/plugins/processing/algs/qgis/EquivalentNumField.py
  7. +7 −5 python/plugins/processing/algs/qgis/ExecuteSQL.py
  8. +1 −1 python/plugins/processing/algs/qgis/ExtractByAttribute.py
  9. +1 −1 python/plugins/processing/algs/qgis/ExtractByLocation.py
  10. +0 −5 python/plugins/processing/algs/qgis/Grid.py
  11. +0 −2 python/plugins/processing/algs/qgis/JoinAttributes.py
  12. +0 −2 python/plugins/processing/algs/qgis/Merge.py
  13. +1 −1 python/plugins/processing/algs/qgis/PointDistance.py
  14. +1 −1 python/plugins/processing/algs/qgis/Polygonize.py
  15. +2 −0 python/plugins/processing/algs/qgis/QGISAlgorithmProvider.py
  16. +2 −2 python/plugins/processing/algs/qgis/ReverseLineDirection.py
  17. +1 −1 python/plugins/processing/algs/qgis/SelectByAttribute.py
  18. +1 −1 python/plugins/processing/algs/qgis/SelectByAttributeSum.py
  19. +1 −1 python/plugins/processing/algs/qgis/SelectByLocation.py
  20. +1 −1 python/plugins/processing/algs/qgis/SinglePartsToMultiparts.py
  21. +1 −1 python/plugins/processing/algs/qgis/Smooth.py
  22. +1 −3 python/plugins/processing/algs/qgis/SpatialIndex.py
  23. +2 −2 python/plugins/processing/algs/qgis/postgis_utils.py
  24. +2 −2 python/plugins/processing/algs/qgis/spatialite_utils.py
@@ -26,7 +26,7 @@
__revision__ = '$Format:%H$'

from PyQt4.QtCore import QVariant
from qgis.core import QgsField, QgsFeature, QgsGeometry
from qgis.core import QgsField, QgsFeature
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.parameters import ParameterVector
from processing.core.parameters import ParameterString
@@ -26,7 +26,6 @@
__revision__ = '$Format:%H$'

import os
import math
import codecs

from PyQt4.QtGui import QIcon
@@ -121,7 +120,6 @@ def processAlgorithm(self, progress):
nullValues = 0
iqr = 0

isFirst = True
values = []

features = vector.features(layer)
@@ -33,11 +33,7 @@
from processing.core.outputs import OutputFile, OutputString

# algorithm specific imports
from osgeo import ogr, gdal
from string import Template
import tempfile
import logging
import os
from osgeo import ogr
import xml.sax.saxutils


@@ -28,8 +28,6 @@
import os
import re

from PyQt4.QtGui import QIcon

from qgis.core import QgsCoordinateReferenceSystem
from qgis.utils import iface

@@ -38,7 +36,7 @@
from processing.core.parameters import ParameterCrs
from processing.core.outputs import OutputVector

from processing.tools import dataobjects, vector
from processing.tools import dataobjects

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]

@@ -27,8 +27,6 @@

import os

from PyQt4.QtGui import QIcon

from qgis.core import QGis, QgsFeature, QgsGeometry, QgsPoint

from processing.core.GeoAlgorithm import GeoAlgorithm
@@ -26,7 +26,7 @@
__revision__ = '$Format:%H$'

from PyQt4.QtCore import QVariant
from qgis.core import QgsField, QgsFeature, QgsGeometry
from qgis.core import QgsField, QgsFeature
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.parameters import ParameterVector
from processing.core.parameters import ParameterTableField
@@ -25,16 +25,18 @@

__revision__ = '$Format:%H$'

from qgis.core import (QGis, QgsGeometry, QgsFeature,
QgsVirtualLayerDefinition, QgsVectorLayer,
QgsCoordinateReferenceSystem, QgsWKBTypes)
from qgis.core import (
QgsFeature,
QgsVirtualLayerDefinition,
QgsVectorLayer,
QgsCoordinateReferenceSystem,
QgsWKBTypes
)

from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
from processing.core.parameters import ParameterVector
from processing.core.parameters import ParameterString
from processing.core.parameters import ParameterMultipleInput
from processing.core.parameters import ParameterBoolean
from processing.core.parameters import ParameterCrs
from processing.core.parameters import ParameterSelection
from processing.core.outputs import OutputVector
@@ -34,7 +34,7 @@
from processing.core.parameters import ParameterSelection
from processing.core.parameters import ParameterString
from processing.core.outputs import OutputVector
from processing.tools import dataobjects, vector
from processing.tools import dataobjects


class ExtractByAttribute(GeoAlgorithm):
@@ -25,7 +25,7 @@

__revision__ = '$Format:%H$'

from qgis.core import QGis, QgsFeatureRequest, QgsGeometry
from qgis.core import QgsFeatureRequest
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.parameters import ParameterVector
from processing.core.parameters import ParameterGeometryPredicate
@@ -28,7 +28,6 @@
import os
import math

from PyQt4.QtGui import QIcon
from PyQt4.QtCore import QVariant
from qgis.core import QgsRectangle, QgsCoordinateReferenceSystem, QGis, QgsField, QgsFeature, QgsGeometry, QgsPoint
from processing.core.GeoAlgorithm import GeoAlgorithm
@@ -86,10 +85,6 @@ def processAlgorithm(self, progress):

width = bbox.width()
height = bbox.height()
centerX = bbox.center().x()
centerY = bbox.center().y()
#~ originX = centerX - width / 2.0
#~ originY = centerY - height / 2.0
originX = bbox.xMinimum()
originY = bbox.yMaximum()

@@ -27,8 +27,6 @@

import os

from PyQt4.QtGui import QIcon

from qgis.core import QgsFeature

from processing.core.GeoAlgorithm import GeoAlgorithm
@@ -36,8 +36,6 @@
from processing.core.parameters import ParameterMultipleInput
from processing.core.outputs import OutputVector

from processing.tools import dataobjects, vector

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]


@@ -30,7 +30,7 @@

from PyQt4.QtGui import QIcon

from qgis.core import QgsFeatureRequest, QgsFeature, QgsGeometry, QgsDistanceArea
from qgis.core import QgsFeatureRequest, QgsDistanceArea

from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.parameters import ParameterNumber
@@ -27,7 +27,7 @@

from shapely.ops import polygonize
from shapely.ops import unary_union
from shapely.geometry import Point, MultiLineString
from shapely.geometry import MultiLineString

from PyQt4.QtCore import QVariant
from qgis.core import QGis, QgsFields, QgsField, QgsFeature, QgsGeometry
@@ -29,12 +29,14 @@

try:
import matplotlib.pyplot
assert matplotlib # silence pyflakes
hasMatplotlib = True
except:
hasMatplotlib = False

try:
import shapely
assert shapely # silence pyflakes
hasShapely = True
except:
hasShapely = False
@@ -25,10 +25,10 @@

__revision__ = '$Format:%H$'

from qgis.core import QGis, QgsGeometry, QgsFeature
from qgis.core import QgsGeometry, QgsFeature
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
from processing.core.parameters import ParameterVector, ParameterNumber
from processing.core.parameters import ParameterVector
from processing.core.outputs import OutputVector
from processing.tools import dataobjects, vector

@@ -34,7 +34,7 @@
from processing.core.parameters import ParameterSelection
from processing.core.parameters import ParameterString
from processing.core.outputs import OutputVector
from processing.tools import dataobjects, vector
from processing.tools import dataobjects


class SelectByAttribute(GeoAlgorithm):
@@ -33,7 +33,7 @@
from processing.core.parameters import ParameterTableField
from processing.core.parameters import ParameterNumber
from processing.core.outputs import OutputVector
from processing.tools import dataobjects, vector
from processing.tools import dataobjects


class SelectByAttributeSum(GeoAlgorithm):
@@ -29,7 +29,7 @@

from PyQt4.QtGui import QIcon

from qgis.core import QGis, QgsGeometry, QgsFeatureRequest
from qgis.core import QgsGeometry, QgsFeatureRequest

from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.parameters import ParameterSelection
@@ -126,7 +126,7 @@ def singleToMultiGeom(self, wkbType):
return QGis.WKBMultiPolygon
else:
return QGis.WKBUnknown
except Exception as err:
except Exception:
pass

def extractAsMulti(self, geom):
@@ -25,7 +25,7 @@

__revision__ = '$Format:%H$'

from qgis.core import QGis, QgsGeometry, QgsFeature
from qgis.core import QgsFeature
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
from processing.core.parameters import ParameterVector, ParameterNumber
@@ -27,15 +27,13 @@

import os

from PyQt4.QtGui import QIcon

from qgis.core import QgsVectorDataProvider

from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.parameters import ParameterVector
from processing.core.outputs import OutputVector

from processing.tools import dataobjects, vector
from processing.tools import dataobjects

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]

@@ -724,7 +724,7 @@ def sr_info_for_srid(self, srid):
if x is not None:
srtext = x.group()
return srtext
except DbError as e:
except DbError:
return 'Unknown'

def insert_table_row(self, table, values, schema=None, cursor=None):
@@ -762,7 +762,7 @@ def _exec_sql_and_commit(self, sql):
c = self.con.cursor()
self._exec_sql(c, sql)
self.con.commit()
except DbError as e:
except DbError:
self.con.rollback()
raise

@@ -95,7 +95,7 @@ def check_spatialite(self):
v = c.fetchone()[0]
self.has_geometry_columns = v == 1 or v == 3
self.has_spatialite4 = v == 3
except Exception as e:
except Exception:
self.has_geometry_columns = False
self.has_spatialite4 = False

@@ -117,6 +117,6 @@ def _exec_sql_and_commit(self, sql):
c = self.con.cursor()
self._exec_sql(c, sql)
self.con.commit()
except DbError as e:
except DbError:
self.con.rollback()
raise

0 comments on commit eb8167d

Please sign in to comment.
You can’t perform that action at this time.