Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing] Remove various unused imports and variables
  • Loading branch information
m-kuhn committed Mar 15, 2016
1 parent e9b30a0 commit eb8167d
Show file tree
Hide file tree
Showing 24 changed files with 29 additions and 46 deletions.
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/AddTableField.py
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions python/plugins/processing/algs/qgis/BasicStatisticsNumbers.py
Expand Up @@ -26,7 +26,6 @@
__revision__ = '$Format:%H$'

import os
import math
import codecs

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

isFirst = True
values = []

features = vector.features(layer)
Expand Down
6 changes: 1 addition & 5 deletions python/plugins/processing/algs/qgis/Datasources2Vrt.py
Expand Up @@ -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


Expand Down
4 changes: 1 addition & 3 deletions python/plugins/processing/algs/qgis/DefineProjection.py
Expand Up @@ -28,8 +28,6 @@
import os
import re

from PyQt4.QtGui import QIcon

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

Expand All @@ -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]

Expand Down
2 changes: 0 additions & 2 deletions python/plugins/processing/algs/qgis/DensifyGeometries.py
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/EquivalentNumField.py
Expand Up @@ -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
Expand Down
12 changes: 7 additions & 5 deletions python/plugins/processing/algs/qgis/ExecuteSQL.py
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/ExtractByAttribute.py
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/ExtractByLocation.py
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions python/plugins/processing/algs/qgis/Grid.py
Expand Up @@ -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
Expand Down Expand Up @@ -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()

Expand Down
2 changes: 0 additions & 2 deletions python/plugins/processing/algs/qgis/JoinAttributes.py
Expand Up @@ -27,8 +27,6 @@

import os

from PyQt4.QtGui import QIcon

from qgis.core import QgsFeature

from processing.core.GeoAlgorithm import GeoAlgorithm
Expand Down
2 changes: 0 additions & 2 deletions python/plugins/processing/algs/qgis/Merge.py
Expand Up @@ -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]


Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/PointDistance.py
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/Polygonize.py
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions python/plugins/processing/algs/qgis/QGISAlgorithmProvider.py
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/algs/qgis/ReverseLineDirection.py
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/SelectByAttribute.py
Expand Up @@ -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):
Expand Down
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/SelectByLocation.py
Expand Up @@ -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
Expand Down
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/Smooth.py
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions python/plugins/processing/algs/qgis/SpatialIndex.py
Expand Up @@ -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]

Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/algs/qgis/postgis_utils.py
Expand Up @@ -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):
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/algs/qgis/spatialite_utils.py
Expand Up @@ -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

Expand All @@ -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.