Skip to content

Commit ecc5bb5

Browse files
committed
pep8/pyflakes3 cleanups
1 parent a10c890 commit ecc5bb5

37 files changed

+177
-187
lines changed

python/console/console.py

+36-34
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def show_console():
6464

6565
return _console
6666

67+
6768
_console_output = None
6869

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

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

117-
##------------ UI -------------------------------
118+
# ------------ UI -------------------------------
118119

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

136-
#self.splitterEditor.addWidget(self.tabEditorWidget)
137+
# self.splitterEditor.addWidget(self.tabEditorWidget)
137138

138139
self.splitterObj = QSplitter(self.splitterEditor)
139140
self.splitterObj.setHandleWidth(3)
140141
self.splitterObj.setOrientation(Qt.Horizontal)
141-
#self.splitterObj.setSizes([0, 0])
142-
#self.splitterObj.setStretchFactor(0, 1)
142+
# self.splitterObj.setSizes([0, 0])
143+
# self.splitterObj.setStretchFactor(0, 1)
143144

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

154-
#self.splitterEditor.addWidget(self.widgetEditor)
155-
#self.splitterObj.addWidget(self.listClassMethod)
156-
#self.splitterObj.addWidget(self.widgetEditor)
155+
# self.splitterEditor.addWidget(self.widgetEditor)
156+
# self.splitterObj.addWidget(self.listClassMethod)
157+
# self.splitterObj.addWidget(self.widgetEditor)
157158

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

167-
##----------------Restore Settings------------------------------------
168+
# ----------------Restore Settings------------------------------------
168169

169170
self.restoreSettingsConsole()
170171

171-
##------------------Toolbar Editor-------------------------------------
172+
# ------------------Toolbar Editor-------------------------------------
172173

173-
## Action for Open File
174+
# Action for Open File
174175
openFileBt = QCoreApplication.translate("PythonConsole", "Open Script...")
175176
self.openFileButton = QAction(self)
176177
self.openFileButton.setCheckable(False)
@@ -190,7 +191,7 @@ def __init__(self, parent=None):
190191
self.openInEditorButton.setIconVisibleInMenu(True)
191192
self.openInEditorButton.setToolTip(openExtEditorBt)
192193
self.openInEditorButton.setText(openExtEditorBt)
193-
## Action for Save File
194+
# Action for Save File
194195
saveFileBt = QCoreApplication.translate("PythonConsole", "Save")
195196
self.saveFileButton = QAction(self)
196197
self.saveFileButton.setCheckable(False)
@@ -200,7 +201,7 @@ def __init__(self, parent=None):
200201
self.saveFileButton.setIconVisibleInMenu(True)
201202
self.saveFileButton.setToolTip(saveFileBt)
202203
self.saveFileButton.setText(saveFileBt)
203-
## Action for Save File As
204+
# Action for Save File As
204205
saveAsFileBt = QCoreApplication.translate("PythonConsole", "Save As...")
205206
self.saveAsFileButton = QAction(self)
206207
self.saveAsFileButton.setCheckable(False)
@@ -210,7 +211,7 @@ def __init__(self, parent=None):
210211
self.saveAsFileButton.setIconVisibleInMenu(True)
211212
self.saveAsFileButton.setToolTip(saveAsFileBt)
212213
self.saveAsFileButton.setText(saveAsFileBt)
213-
## Action Cut
214+
# Action Cut
214215
cutEditorBt = QCoreApplication.translate("PythonConsole", "Cut")
215216
self.cutEditorButton = QAction(self)
216217
self.cutEditorButton.setCheckable(False)
@@ -220,7 +221,7 @@ def __init__(self, parent=None):
220221
self.cutEditorButton.setIconVisibleInMenu(True)
221222
self.cutEditorButton.setToolTip(cutEditorBt)
222223
self.cutEditorButton.setText(cutEditorBt)
223-
## Action Copy
224+
# Action Copy
224225
copyEditorBt = QCoreApplication.translate("PythonConsole", "Copy")
225226
self.copyEditorButton = QAction(self)
226227
self.copyEditorButton.setCheckable(False)
@@ -230,7 +231,7 @@ def __init__(self, parent=None):
230231
self.copyEditorButton.setIconVisibleInMenu(True)
231232
self.copyEditorButton.setToolTip(copyEditorBt)
232233
self.copyEditorButton.setText(copyEditorBt)
233-
## Action Paste
234+
# Action Paste
234235
pasteEditorBt = QCoreApplication.translate("PythonConsole", "Paste")
235236
self.pasteEditorButton = QAction(self)
236237
self.pasteEditorButton.setCheckable(False)
@@ -240,7 +241,7 @@ def __init__(self, parent=None):
240241
self.pasteEditorButton.setIconVisibleInMenu(True)
241242
self.pasteEditorButton.setToolTip(pasteEditorBt)
242243
self.pasteEditorButton.setText(pasteEditorBt)
243-
## Action Run Script (subprocess)
244+
# Action Run Script (subprocess)
244245
runScriptEditorBt = QCoreApplication.translate("PythonConsole", "Run script")
245246
self.runScriptEditorButton = QAction(self)
246247
self.runScriptEditorButton.setCheckable(False)
@@ -250,7 +251,7 @@ def __init__(self, parent=None):
250251
self.runScriptEditorButton.setIconVisibleInMenu(True)
251252
self.runScriptEditorButton.setToolTip(runScriptEditorBt)
252253
self.runScriptEditorButton.setText(runScriptEditorBt)
253-
## Action Run Script (subprocess)
254+
# Action Run Script (subprocess)
254255
commentEditorBt = QCoreApplication.translate("PythonConsole", "Comment")
255256
self.commentEditorButton = QAction(self)
256257
self.commentEditorButton.setCheckable(False)
@@ -260,7 +261,7 @@ def __init__(self, parent=None):
260261
self.commentEditorButton.setIconVisibleInMenu(True)
261262
self.commentEditorButton.setToolTip(commentEditorBt)
262263
self.commentEditorButton.setText(commentEditorBt)
263-
## Action Run Script (subprocess)
264+
# Action Run Script (subprocess)
264265
uncommentEditorBt = QCoreApplication.translate("PythonConsole", "Uncomment")
265266
self.uncommentEditorButton = QAction(self)
266267
self.uncommentEditorButton.setCheckable(False)
@@ -270,7 +271,7 @@ def __init__(self, parent=None):
270271
self.uncommentEditorButton.setIconVisibleInMenu(True)
271272
self.uncommentEditorButton.setToolTip(uncommentEditorBt)
272273
self.uncommentEditorButton.setText(uncommentEditorBt)
273-
## Action for Object browser
274+
# Action for Object browser
274275
objList = QCoreApplication.translate("PythonConsole", "Object Inspector...")
275276
self.objectListButton = QAction(self)
276277
self.objectListButton.setCheckable(True)
@@ -281,7 +282,7 @@ def __init__(self, parent=None):
281282
self.objectListButton.setIconVisibleInMenu(True)
282283
self.objectListButton.setToolTip(objList)
283284
self.objectListButton.setText(objList)
284-
## Action for Find text
285+
# Action for Find text
285286
findText = QCoreApplication.translate("PythonConsole", "Find Text")
286287
self.findTextButton = QAction(self)
287288
self.findTextButton.setCheckable(True)
@@ -292,9 +293,9 @@ def __init__(self, parent=None):
292293
self.findTextButton.setToolTip(findText)
293294
self.findTextButton.setText(findText)
294295

295-
##----------------Toolbar Console-------------------------------------
296+
# ----------------Toolbar Console-------------------------------------
296297

297-
## Action Show Editor
298+
# Action Show Editor
298299
showEditor = QCoreApplication.translate("PythonConsole", "Show Editor")
299300
self.showEditorButton = QAction(self)
300301
self.showEditorButton.setEnabled(True)
@@ -304,7 +305,7 @@ def __init__(self, parent=None):
304305
self.showEditorButton.setIconVisibleInMenu(True)
305306
self.showEditorButton.setToolTip(showEditor)
306307
self.showEditorButton.setText(showEditor)
307-
## Action for Clear button
308+
# Action for Clear button
308309
clearBt = QCoreApplication.translate("PythonConsole", "Clear Console")
309310
self.clearButton = QAction(self)
310311
self.clearButton.setCheckable(False)
@@ -314,7 +315,7 @@ def __init__(self, parent=None):
314315
self.clearButton.setIconVisibleInMenu(True)
315316
self.clearButton.setToolTip(clearBt)
316317
self.clearButton.setText(clearBt)
317-
## Action for settings
318+
# Action for settings
318319
optionsBt = QCoreApplication.translate("PythonConsole", "Options...")
319320
self.optionsButton = QAction(self)
320321
self.optionsButton.setCheckable(False)
@@ -324,7 +325,7 @@ def __init__(self, parent=None):
324325
self.optionsButton.setIconVisibleInMenu(True)
325326
self.optionsButton.setToolTip(optionsBt)
326327
self.optionsButton.setText(optionsBt)
327-
## Action menu for class
328+
# Action menu for class
328329
actionClassBt = QCoreApplication.translate("PythonConsole", "Import Class")
329330
self.actionClass = QAction(self)
330331
self.actionClass.setCheckable(False)
@@ -334,7 +335,7 @@ def __init__(self, parent=None):
334335
self.actionClass.setIconVisibleInMenu(True)
335336
self.actionClass.setToolTip(actionClassBt)
336337
self.actionClass.setText(actionClassBt)
337-
## Action for Run script
338+
# Action for Run script
338339
runBt = QCoreApplication.translate("PythonConsole", "Run Command")
339340
self.runButton = QAction(self)
340341
self.runButton.setCheckable(False)
@@ -344,7 +345,7 @@ def __init__(self, parent=None):
344345
self.runButton.setIconVisibleInMenu(True)
345346
self.runButton.setToolTip(runBt)
346347
self.runButton.setText(runBt)
347-
## Help action
348+
# Help action
348349
helpBt = QCoreApplication.translate("PythonConsole", "Help...")
349350
self.helpButton = QAction(self)
350351
self.helpButton.setCheckable(False)
@@ -399,7 +400,7 @@ def __init__(self, parent=None):
399400
self.toolBarEditor.addSeparator()
400401
self.toolBarEditor.addAction(self.objectListButton)
401402

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

447-
##------------ Layout -------------------------------
448+
# ------------ Layout -------------------------------
448449

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

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

503-
##------------ Add first Tab in Editor -------------------------------
504+
# ------------ Add first Tab in Editor -------------------------------
504505

505-
#self.tabEditorWidget.newTabEditor(tabName='first', filename=None)
506+
# self.tabEditorWidget.newTabEditor(tabName='first', filename=None)
506507

507-
##------------ Signal -------------------------------
508+
# ------------ Signal -------------------------------
508509

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

732+
731733
if __name__ == '__main__':
732734
a = QApplication(sys.argv)
733735
console = PythonConsoleWidget()

0 commit comments

Comments
 (0)