Skip to content
Permalink
Browse files

fix flake8 warnings

  • Loading branch information
jef-n committed Mar 13, 2017
1 parent 55e7d93 commit 8bea7422163c1dab68b7d0957731a6f900cdce39
@@ -34,7 +34,7 @@

import json
import os.path
from urllib.request import build_opener, HTTPError, install_opener, HTTPBasicAuthHandler, HTTPHandler, ProxyHandler
from urllib.request import build_opener, install_opener, ProxyHandler

from qgis.PyQt.QtCore import Qt
from qgis.PyQt.QtWidgets import QApplication, QDialog, QDialogButtonBox, QMessageBox, QTreeWidgetItem, QWidget
@@ -40,7 +40,7 @@
from processing.core.Processing import Processing
from processing.gui.ProcessingToolbox import ProcessingToolbox
from processing.gui.HistoryDialog import HistoryDialog
from processing.gui.ConfigDialog import ConfigOptionsPage, ConfigDialog
from processing.gui.ConfigDialog import ConfigOptionsPage
from processing.gui.ResultsDock import ResultsDock
from processing.gui.CommanderWindow import CommanderWindow
from processing.modeler.ModelerDialog import ModelerDialog
@@ -4,7 +4,7 @@
##To_keep=number 1
##Biggest parts=output vector

from qgis.core import Qgis, QgsGeometry, QgsWkbTypes
from qgis.core import QgsGeometry, QgsWkbTypes
from operator import itemgetter

To_keep = int(To_keep)
@@ -32,7 +32,6 @@
from qgis.PyQt import uic
from qgis.PyQt.QtCore import Qt, QEvent
from qgis.PyQt.QtWidgets import (QFileDialog,
QDialog,
QStyle,
QMessageBox,
QStyledItemDelegate,
@@ -41,12 +40,10 @@
QToolButton,
QHBoxLayout,
QComboBox,
QPushButton,
QApplication)
QPushButton)
from qgis.PyQt.QtGui import (QIcon,
QStandardItemModel,
QStandardItem,
QCursor)
QStandardItem)

from qgis.gui import (QgsDoubleSpinBox,
QgsSpinBox,
@@ -667,7 +667,7 @@ def deletefile(layer):
try:
os.remove(filename)
except:
file(filename, "w").close()
open(filename, "w").close()
assert os.path.getsize(filename) == 0, "removal and truncation of {} failed".format(filename)
# print "Deleted file - sleeping"
time.sleep(1)
@@ -65,7 +65,7 @@ def testThemeChanged(self):
self.assertEqual(len(themes_changed_spy), 3)
# remove valid
collection.removeMapTheme('theme1')
self.assertEqual(len(theme_changed_spy), 3) # not changed - removed!
self.assertEqual(len(theme_changed_spy), 3) # not changed - removed!
self.assertEqual(len(themes_changed_spy), 4)

# reinsert
@@ -93,11 +93,11 @@ def testThemeChanged(self):

# now kill layer 2
project.removeMapLayer(layer2)
self.assertEqual(len(theme_changed_spy), 5) # signal should not be emitted - layer is not in record
self.assertEqual(len(theme_changed_spy), 5) # signal should not be emitted - layer is not in record
# now kill layer 1
project.removeMapLayer(layer)
app.processEvents()
self.assertEqual(len(theme_changed_spy), 6) # signal should be emitted - layer is in record
self.assertEqual(len(theme_changed_spy), 6) # signal should be emitted - layer is in record

def testMasterLayerOrder(self):
""" test master layer order"""

0 comments on commit 8bea742

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