Skip to content
Permalink
Browse files

pep8/pyflakes3 cleanups

  • Loading branch information
jef-n committed Mar 4, 2017
1 parent a10c890 commit ecc5bb508e4231c5c7065eae0637b96d63c0ae5d
Showing with 177 additions and 187 deletions.
  1. +36 −34 python/console/console.py
  2. +25 −25 python/console/console_editor.py
  3. +3 −3 python/console/console_output.py
  4. +15 −15 python/console/console_sci.py
  5. +1 −1 python/console/console_settings.py
  6. +1 −1 python/plugins/MetaSearch/util.py
  7. +13 −13 python/plugins/db_manager/db_plugins/oracle/plugin.py
  8. +1 −1 python/plugins/db_manager/db_plugins/plugin.py
  9. +1 −1 python/plugins/db_manager/layer_preview.py
  10. +5 −5 python/plugins/db_manager/sqledit.py
  11. +5 −5 python/plugins/processing/algs/gdal/GdalUtils.py
  12. +2 −2 python/plugins/processing/algs/r/RUtils.py
  13. +1 −1 python/plugins/processing/core/GeoAlgorithm.py
  14. +1 −1 python/plugins/processing/core/ProcessingConfig.py
  15. +4 −4 python/plugins/processing/gui/AlgorithmDialogBase.py
  16. +1 −1 python/plugins/processing/gui/ConfigDialog.py
  17. +6 −6 python/plugins/processing/gui/ScriptEdit.py
  18. +1 −1 python/plugins/processing/gui/wrappers.py
  19. +4 −9 python/plugins/processing/modeler/ModelerDialog.py
  20. +2 −2 python/plugins/processing/script/AddScriptFromFileAction.py
  21. +5 −6 python/plugins/processing/tools/dataobjects.py
  22. +2 −2 python/plugins/processing/tools/postgis.py
  23. +1 −2 python/plugins/processing/tools/vector.py
  24. +1 −2 python/pyplugin_installer/installer.py
  25. +8 −8 python/pyplugin_installer/installer_data.py
  26. +1 −2 tests/src/python/acceptable_missing_doc.py
  27. +6 −5 tests/src/python/test_db_manager_gpkg.py
  28. +1 −1 tests/src/python/test_provider_db2.py
  29. +1 −0 tests/src/python/test_provider_mssql.py
  30. +1 −0 tests/src/python/test_provider_oracle.py
  31. +5 −8 tests/src/python/test_provider_postgres.py
  32. +3 −2 tests/src/python/test_provider_shapefile.py
  33. +3 −2 tests/src/python/test_provider_wfs.py
  34. +4 −4 tests/src/python/test_provider_wfs_gui.py
  35. +4 −5 tests/src/python/test_qgsfieldformatters.py
  36. +1 −2 tests/src/python/test_qgsnewgeopackagelayerdialog.py
  37. +2 −5 tests/src/python/test_qgspallabeling_server.py
@@ -64,6 +64,7 @@ def show_console():

return _console


_console_output = None

# hook for python console so all output will be redirected
@@ -81,7 +82,7 @@ def __init__(self, parent=None):
QDockWidget.__init__(self, parent)
self.setObjectName("PythonConsole")
self.setWindowTitle(QCoreApplication.translate("PythonConsole", "Python Console"))
#self.setAllowedAreas(Qt.BottomDockWidgetArea)
# self.setAllowedAreas(Qt.BottomDockWidgetArea)

self.console = PythonConsoleWidget(self)
self.setWidget(self.console)
@@ -114,7 +115,7 @@ def __init__(self, parent=None):
self.shellOut = ShellOutputScintilla(self)
self.tabEditorWidget = EditorTabWidget(self)

##------------ UI -------------------------------
# ------------ UI -------------------------------

self.splitterEditor = QSplitter(self)
self.splitterEditor.setOrientation(Qt.Horizontal)
@@ -133,13 +134,13 @@ def __init__(self, parent=None):
self.splitter.addWidget(self.shellOutWidget)
self.splitter.addWidget(self.shell)

#self.splitterEditor.addWidget(self.tabEditorWidget)
# self.splitterEditor.addWidget(self.tabEditorWidget)

self.splitterObj = QSplitter(self.splitterEditor)
self.splitterObj.setHandleWidth(3)
self.splitterObj.setOrientation(Qt.Horizontal)
#self.splitterObj.setSizes([0, 0])
#self.splitterObj.setStretchFactor(0, 1)
# self.splitterObj.setSizes([0, 0])
# self.splitterObj.setStretchFactor(0, 1)

self.widgetEditor = QWidget(self.splitterObj)
self.widgetFind = QWidget(self)
@@ -151,9 +152,9 @@ def __init__(self, parent=None):
self.listClassMethod.setColumnHidden(1, True)
self.listClassMethod.setAlternatingRowColors(True)

#self.splitterEditor.addWidget(self.widgetEditor)
#self.splitterObj.addWidget(self.listClassMethod)
#self.splitterObj.addWidget(self.widgetEditor)
# self.splitterEditor.addWidget(self.widgetEditor)
# self.splitterObj.addWidget(self.listClassMethod)
# self.splitterObj.addWidget(self.widgetEditor)

# Hide side editor on start up
self.splitterObj.hide()
@@ -164,13 +165,13 @@ def __init__(self, parent=None):
sizes = self.splitter.sizes()
self.splitter.setSizes(sizes)

##----------------Restore Settings------------------------------------
# ----------------Restore Settings------------------------------------

self.restoreSettingsConsole()

##------------------Toolbar Editor-------------------------------------
# ------------------Toolbar Editor-------------------------------------

## Action for Open File
# Action for Open File
openFileBt = QCoreApplication.translate("PythonConsole", "Open Script...")
self.openFileButton = QAction(self)
self.openFileButton.setCheckable(False)
@@ -190,7 +191,7 @@ def __init__(self, parent=None):
self.openInEditorButton.setIconVisibleInMenu(True)
self.openInEditorButton.setToolTip(openExtEditorBt)
self.openInEditorButton.setText(openExtEditorBt)
## Action for Save File
# Action for Save File
saveFileBt = QCoreApplication.translate("PythonConsole", "Save")
self.saveFileButton = QAction(self)
self.saveFileButton.setCheckable(False)
@@ -200,7 +201,7 @@ def __init__(self, parent=None):
self.saveFileButton.setIconVisibleInMenu(True)
self.saveFileButton.setToolTip(saveFileBt)
self.saveFileButton.setText(saveFileBt)
## Action for Save File As
# Action for Save File As
saveAsFileBt = QCoreApplication.translate("PythonConsole", "Save As...")
self.saveAsFileButton = QAction(self)
self.saveAsFileButton.setCheckable(False)
@@ -210,7 +211,7 @@ def __init__(self, parent=None):
self.saveAsFileButton.setIconVisibleInMenu(True)
self.saveAsFileButton.setToolTip(saveAsFileBt)
self.saveAsFileButton.setText(saveAsFileBt)
## Action Cut
# Action Cut
cutEditorBt = QCoreApplication.translate("PythonConsole", "Cut")
self.cutEditorButton = QAction(self)
self.cutEditorButton.setCheckable(False)
@@ -220,7 +221,7 @@ def __init__(self, parent=None):
self.cutEditorButton.setIconVisibleInMenu(True)
self.cutEditorButton.setToolTip(cutEditorBt)
self.cutEditorButton.setText(cutEditorBt)
## Action Copy
# Action Copy
copyEditorBt = QCoreApplication.translate("PythonConsole", "Copy")
self.copyEditorButton = QAction(self)
self.copyEditorButton.setCheckable(False)
@@ -230,7 +231,7 @@ def __init__(self, parent=None):
self.copyEditorButton.setIconVisibleInMenu(True)
self.copyEditorButton.setToolTip(copyEditorBt)
self.copyEditorButton.setText(copyEditorBt)
## Action Paste
# Action Paste
pasteEditorBt = QCoreApplication.translate("PythonConsole", "Paste")
self.pasteEditorButton = QAction(self)
self.pasteEditorButton.setCheckable(False)
@@ -240,7 +241,7 @@ def __init__(self, parent=None):
self.pasteEditorButton.setIconVisibleInMenu(True)
self.pasteEditorButton.setToolTip(pasteEditorBt)
self.pasteEditorButton.setText(pasteEditorBt)
## Action Run Script (subprocess)
# Action Run Script (subprocess)
runScriptEditorBt = QCoreApplication.translate("PythonConsole", "Run script")
self.runScriptEditorButton = QAction(self)
self.runScriptEditorButton.setCheckable(False)
@@ -250,7 +251,7 @@ def __init__(self, parent=None):
self.runScriptEditorButton.setIconVisibleInMenu(True)
self.runScriptEditorButton.setToolTip(runScriptEditorBt)
self.runScriptEditorButton.setText(runScriptEditorBt)
## Action Run Script (subprocess)
# Action Run Script (subprocess)
commentEditorBt = QCoreApplication.translate("PythonConsole", "Comment")
self.commentEditorButton = QAction(self)
self.commentEditorButton.setCheckable(False)
@@ -260,7 +261,7 @@ def __init__(self, parent=None):
self.commentEditorButton.setIconVisibleInMenu(True)
self.commentEditorButton.setToolTip(commentEditorBt)
self.commentEditorButton.setText(commentEditorBt)
## Action Run Script (subprocess)
# Action Run Script (subprocess)
uncommentEditorBt = QCoreApplication.translate("PythonConsole", "Uncomment")
self.uncommentEditorButton = QAction(self)
self.uncommentEditorButton.setCheckable(False)
@@ -270,7 +271,7 @@ def __init__(self, parent=None):
self.uncommentEditorButton.setIconVisibleInMenu(True)
self.uncommentEditorButton.setToolTip(uncommentEditorBt)
self.uncommentEditorButton.setText(uncommentEditorBt)
## Action for Object browser
# Action for Object browser
objList = QCoreApplication.translate("PythonConsole", "Object Inspector...")
self.objectListButton = QAction(self)
self.objectListButton.setCheckable(True)
@@ -281,7 +282,7 @@ def __init__(self, parent=None):
self.objectListButton.setIconVisibleInMenu(True)
self.objectListButton.setToolTip(objList)
self.objectListButton.setText(objList)
## Action for Find text
# Action for Find text
findText = QCoreApplication.translate("PythonConsole", "Find Text")
self.findTextButton = QAction(self)
self.findTextButton.setCheckable(True)
@@ -292,9 +293,9 @@ def __init__(self, parent=None):
self.findTextButton.setToolTip(findText)
self.findTextButton.setText(findText)

##----------------Toolbar Console-------------------------------------
# ----------------Toolbar Console-------------------------------------

## Action Show Editor
# Action Show Editor
showEditor = QCoreApplication.translate("PythonConsole", "Show Editor")
self.showEditorButton = QAction(self)
self.showEditorButton.setEnabled(True)
@@ -304,7 +305,7 @@ def __init__(self, parent=None):
self.showEditorButton.setIconVisibleInMenu(True)
self.showEditorButton.setToolTip(showEditor)
self.showEditorButton.setText(showEditor)
## Action for Clear button
# Action for Clear button
clearBt = QCoreApplication.translate("PythonConsole", "Clear Console")
self.clearButton = QAction(self)
self.clearButton.setCheckable(False)
@@ -314,7 +315,7 @@ def __init__(self, parent=None):
self.clearButton.setIconVisibleInMenu(True)
self.clearButton.setToolTip(clearBt)
self.clearButton.setText(clearBt)
## Action for settings
# Action for settings
optionsBt = QCoreApplication.translate("PythonConsole", "Options...")
self.optionsButton = QAction(self)
self.optionsButton.setCheckable(False)
@@ -324,7 +325,7 @@ def __init__(self, parent=None):
self.optionsButton.setIconVisibleInMenu(True)
self.optionsButton.setToolTip(optionsBt)
self.optionsButton.setText(optionsBt)
## Action menu for class
# Action menu for class
actionClassBt = QCoreApplication.translate("PythonConsole", "Import Class")
self.actionClass = QAction(self)
self.actionClass.setCheckable(False)
@@ -334,7 +335,7 @@ def __init__(self, parent=None):
self.actionClass.setIconVisibleInMenu(True)
self.actionClass.setToolTip(actionClassBt)
self.actionClass.setText(actionClassBt)
## Action for Run script
# Action for Run script
runBt = QCoreApplication.translate("PythonConsole", "Run Command")
self.runButton = QAction(self)
self.runButton.setCheckable(False)
@@ -344,7 +345,7 @@ def __init__(self, parent=None):
self.runButton.setIconVisibleInMenu(True)
self.runButton.setToolTip(runBt)
self.runButton.setText(runBt)
## Help action
# Help action
helpBt = QCoreApplication.translate("PythonConsole", "Help...")
self.helpButton = QAction(self)
self.helpButton.setCheckable(False)
@@ -399,7 +400,7 @@ def __init__(self, parent=None):
self.toolBarEditor.addSeparator()
self.toolBarEditor.addAction(self.objectListButton)

## Menu Import Class
# Menu Import Class
default_command = {
(QCoreApplication.translate("PythonConsole", "Import Processing Class"),
QgsApplication.getThemeIcon("console/iconProcessingConsole.png")):
@@ -444,7 +445,7 @@ def __init__(self, parent=None):
self.shellOut.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
self.shell.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)

##------------ Layout -------------------------------
# ------------ Layout -------------------------------

self.mainLayout = QGridLayout(self)
self.mainLayout.setMargin(0)
@@ -462,7 +463,7 @@ def __init__(self, parent=None):
self.layoutEditor.addWidget(self.tabEditorWidget, 1, 1, 1, 1)
self.layoutEditor.addWidget(self.widgetFind, 2, 1, 1, 1)

## Layout for the find widget
# Layout for the find widget
self.layoutFind = QGridLayout(self.widgetFind)
self.layoutFind.setContentsMargins(0, 0, 0, 0)
self.lineEditFind = QgsFilterLineEdit()
@@ -500,11 +501,11 @@ def __init__(self, parent=None):
self.layoutFind.addWidget(self.wholeWord, 0, 5, 1, 1)
self.layoutFind.addWidget(self.wrapAround, 0, 6, 1, 1)

##------------ Add first Tab in Editor -------------------------------
# ------------ Add first Tab in Editor -------------------------------

#self.tabEditorWidget.newTabEditor(tabName='first', filename=None)
# self.tabEditorWidget.newTabEditor(tabName='first', filename=None)

##------------ Signal -------------------------------
# ------------ Signal -------------------------------

self.findTextButton.triggered.connect(self._toggleFind)
self.objectListButton.toggled.connect(self.toggleObjectListWidget)
@@ -728,6 +729,7 @@ def restoreSettingsConsole(self):
self.splitterEditor.restoreState(self.settings.value("pythonConsole/splitterEditor", QByteArray()))
self.splitterObj.restoreState(self.settings.value("pythonConsole/splitterObj", QByteArray()))


if __name__ == '__main__':
a = QApplication(sys.argv)
console = PythonConsoleWidget()

0 comments on commit ecc5bb5

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