Fixed pycodestyle E231 errors

This commit is contained in:
Veronica K. B. Olsen
2020-08-12 20:51:22 +02:00
parent 28ab689dab
commit 95ee2bf874
25 changed files with 162 additions and 162 deletions
+2 -2
View File
@@ -1475,12 +1475,12 @@ class GuiDocEditSearch(QFrame):
self.showReplace.setStyleSheet(r"QToolButton {border: none; background: transparent;}")
self.showReplace.toggled.connect(self._doToggleReplace)
self.searchButton = QPushButton(self.theTheme.getIcon("search"),"")
self.searchButton = QPushButton(self.theTheme.getIcon("search"), "")
self.searchButton.setFixedSize(QSize(bPx, bPx))
self.searchButton.setToolTip("Find in current document")
self.searchButton.clicked.connect(self._doSearch)
self.replaceButton = QPushButton(self.theTheme.getIcon("search-replace"),"")
self.replaceButton = QPushButton(self.theTheme.getIcon("search-replace"), "")
self.replaceButton.setFixedSize(QSize(bPx, bPx))
self.replaceButton.setToolTip("Find and replace in current document")
self.replaceButton.clicked.connect(self._doReplace)
+13 -13
View File
@@ -55,18 +55,18 @@ class GuiDocHighlighter(QSyntaxHighlighter):
self.hRules = []
self.hStyles = {}
self.colHead = QColor(0,0,0)
self.colHeadH = QColor(0,0,0)
self.colEmph = QColor(0,0,0)
self.colDialN = QColor(0,0,0)
self.colDialD = QColor(0,0,0)
self.colDialS = QColor(0,0,0)
self.colComm = QColor(0,0,0)
self.colKey = QColor(0,0,0)
self.colVal = QColor(0,0,0)
self.colSpell = QColor(0,0,0)
self.colTagErr = QColor(0,0,0)
self.colRepTag = QColor(0,0,0)
self.colHead = QColor(0, 0, 0)
self.colHeadH = QColor(0, 0, 0)
self.colEmph = QColor(0, 0, 0)
self.colDialN = QColor(0, 0, 0)
self.colDialD = QColor(0, 0, 0)
self.colDialS = QColor(0, 0, 0)
self.colComm = QColor(0, 0, 0)
self.colKey = QColor(0, 0, 0)
self.colVal = QColor(0, 0, 0)
self.colSpell = QColor(0, 0, 0)
self.colTagErr = QColor(0, 0, 0)
self.colRepTag = QColor(0, 0, 0)
self.initHighlighter()
@@ -143,7 +143,7 @@ class GuiDocHighlighter(QSyntaxHighlighter):
# Quoted Strings
if self.mainConf.highlightQuotes:
self.hRules.append((
"{:s}(.+?){:s}".format('"','"'), {
"{:s}(.+?){:s}".format('"', '"'), {
0 : self.hStyles["dialogue1"],
}
))
+1 -1
View File
@@ -238,7 +238,7 @@ class GuiItemDetails(QWidget):
else:
self.labelFlag.setPixmap(self.expCross)
else:
self.labelFlag.setPixmap(QPixmap(1,1))
self.labelFlag.setPixmap(QPixmap(1, 1))
self.statusFlag.setPixmap(flagIcon.pixmap(self.sPx, self.sPx))
self.classFlag.setText(nwLabels.CLASS_FLAG[nwItem.itemClass])
if nwItem.itemLayout == nwItemLayout.NO_LAYOUT:
+1 -1
View File
@@ -96,7 +96,7 @@ class GuiItemEditor(QDialog):
for itemLayout in nwItemLayout:
if itemLayout in self.validLayouts:
self.editLayout.addItem(nwLabels.LAYOUT_NAME[itemLayout],itemLayout)
self.editLayout.addItem(nwLabels.LAYOUT_NAME[itemLayout], itemLayout)
# Export Switch
self.textExport = QLabel("Include when building project")
+6 -6
View File
@@ -607,9 +607,9 @@ class GuiMainMenu(QMenuBar):
self.aFindNext = QAction("Find Next", self)
self.aFindNext.setStatusTip("Find next occurrence text in document")
if self.mainConf.osDarwin:
self.aFindNext.setShortcuts(["Ctrl+G","F3"])
self.aFindNext.setShortcuts(["Ctrl+G", "F3"])
else:
self.aFindNext.setShortcuts(["F3","Ctrl+G"])
self.aFindNext.setShortcuts(["F3", "Ctrl+G"])
self.aFindNext.triggered.connect(lambda: self._docAction(nwDocAction.GO_NEXT))
self.srcMenu.addAction(self.aFindNext)
@@ -617,9 +617,9 @@ class GuiMainMenu(QMenuBar):
self.aFindPrev = QAction("Find Previous", self)
self.aFindPrev.setStatusTip("Find previous occurrence text in document")
if self.mainConf.osDarwin:
self.aFindPrev.setShortcuts(["Ctrl+Shift+G","Shift+F3"])
self.aFindPrev.setShortcuts(["Ctrl+Shift+G", "Shift+F3"])
else:
self.aFindPrev.setShortcuts(["Shift+F3","Ctrl+Shift+G"])
self.aFindPrev.setShortcuts(["Shift+F3", "Ctrl+Shift+G"])
self.aFindPrev.triggered.connect(lambda: self._docAction(nwDocAction.GO_PREV))
self.srcMenu.addAction(self.aFindPrev)
@@ -717,7 +717,7 @@ class GuiMainMenu(QMenuBar):
# Format > Remove Block Format
self.aFmtNoFormat = QAction("Remove Block Format", self)
self.aFmtNoFormat.setStatusTip("Strips block format")
self.aFmtNoFormat.setShortcuts(["Ctrl+0","Ctrl+Shift+/"])
self.aFmtNoFormat.setShortcuts(["Ctrl+0", "Ctrl+Shift+/"])
self.aFmtNoFormat.triggered.connect(lambda: self._docAction(nwDocAction.BLOCK_TXT))
self.fmtMenu.addAction(self.aFmtNoFormat)
@@ -870,7 +870,7 @@ class GuiMainMenu(QMenuBar):
if self.mainConf.hasHelp and self.mainConf.hasAssistant:
self.aHelpWeb.setShortcut("Shift+F1")
else:
self.aHelpWeb.setShortcuts(["F1","Shift+F1"])
self.aHelpWeb.setShortcuts(["F1", "Shift+F1"])
self.helpMenu.addAction(self.aHelpWeb)
# Document > Go to Website
+1 -1
View File
@@ -342,7 +342,7 @@ class GuiConfigEditGeneralTab(QWidget):
dlgOpt |= QFileDialog.ShowDirsOnly
dlgOpt |= QFileDialog.DontUseNativeDialog
newDir = QFileDialog.getExistingDirectory(
self,"Backup Directory",currDir,options=dlgOpt
self, "Backup Directory", currDir, options=dlgOpt
)
if newDir:
self.backupPath = newDir
+9 -9
View File
@@ -69,11 +69,11 @@ class GuiProjectSettings(PagedDialog):
self.tabImport = GuiProjectEditStatus(self.theParent, self.theProject, False)
self.tabReplace = GuiProjectEditReplace(self.theParent, self.theProject)
self.addTab(self.tabMain, "Settings")
self.addTab(self.tabMeta, "Details")
self.addTab(self.tabStatus, "Status")
self.addTab(self.tabImport, "Importance")
self.addTab(self.tabReplace,"Auto-Replace")
self.addTab(self.tabMain, "Settings")
self.addTab(self.tabMeta, "Details")
self.addTab(self.tabStatus, "Status")
self.addTab(self.tabImport, "Importance")
self.addTab(self.tabReplace, "Auto-Replace")
self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
self.buttonBox.accepted.connect(self._doSave)
@@ -331,7 +331,7 @@ class GuiProjectEditStatus(QWidget):
self.saveButton = QPushButton("Save")
self.colPixmap = QPixmap(self.iPx, self.iPx)
self.colPixmap.fill(QColor(120, 120, 120))
self.colButton = QPushButton(QIcon(self.colPixmap),"Colour")
self.colButton = QPushButton(QIcon(self.colPixmap), "Colour")
self.colButton.setIconSize(self.colPixmap.rect().size())
self.newButton.clicked.connect(self._newItem)
@@ -513,7 +513,7 @@ class GuiProjectEditReplace(QWidget):
self.optState.getInt("GuiProjectSettings", "replaceColW", 100)
)
self.listBox = QTreeWidget()
self.listBox.setHeaderLabels(["Keyword","Replace With"])
self.listBox.setHeaderLabels(["Keyword", "Replace With"])
self.listBox.itemSelectionChanged.connect(self._selectedItem)
self.listBox.setColumnWidth(0, wCol0)
self.listBox.setIndentation(0)
@@ -601,8 +601,8 @@ class GuiProjectEditReplace(QWidget):
saveKey = self._stripNotAllowed(newKey)
if len(saveKey) > 0 and len(newVal) > 0:
selItem.setText(0,"<%s>" % saveKey)
selItem.setText(1,newVal)
selItem.setText(0, "<%s>" % saveKey)
selItem.setText(1, newVal)
self.editKey.clear()
self.editValue.clear()
self.editKey.setEnabled(False)
+2 -2
View File
@@ -543,7 +543,7 @@ class GuiProjectTree(QTreeWidget):
self.theProject.setProjectWordCount(nWords)
sWords = self.theProject.getSessionWordCount()
self.theParent.statusBar.setStats(nWords,sWords)
self.theParent.statusBar.setStats(nWords, sWords)
return
@@ -841,7 +841,7 @@ class GuiProjectTree(QTreeWidget):
self.setTreeItemValues(tHandle)
self._setTreeChanged(True)
logger.debug("The parent of item %s has been changed to %s" % (tHandle,pHandle))
logger.debug("The parent of item %s has been changed to %s" % (tHandle, pHandle))
return True
+1 -1
View File
@@ -214,7 +214,7 @@ class ProjWizardFolderPage(QWizardPage):
dlgOpt |= QFileDialog.ShowDirsOnly
dlgOpt |= QFileDialog.DontUseNativeDialog
projDir = QFileDialog.getExistingDirectory(
self,"Select Project Folder", lastPath, options=dlgOpt
self, "Select Project Folder", lastPath, options=dlgOpt
)
if projDir:
projName = self.field("projName")
+1 -1
View File
@@ -212,7 +212,7 @@ class GuiMainStatus(QStatusBar):
tH = int(tM/60)
tM = tM - tH*60
tS = tS - tM*60 - tH*3600
theTime = "%02d:%02d:%02d" % (tH,tM,tS)
theTime = "%02d:%02d:%02d" % (tH, tM, tS)
self.timeText.setText(theTime)
return
+4 -4
View File
@@ -431,8 +431,8 @@ class GuiTheme:
def _loadColour(self, confParser, cnfSec, cnfName):
"""Load a colour value from a config string.
"""
if confParser.has_option(cnfSec,cnfName):
inData = confParser.get(cnfSec,cnfName).split(",")
if confParser.has_option(cnfSec, cnfName):
inData = confParser.get(cnfSec, cnfName).split(",")
outData = []
try:
outData.append(int(inData[0]))
@@ -450,8 +450,8 @@ class GuiTheme:
"""Set a palette colour value from a config string.
"""
readCol = []
if confParser.has_option(cnfSec,cnfName):
inData = confParser.get(cnfSec,cnfName).split(",")
if confParser.has_option(cnfSec, cnfName):
inData = confParser.get(cnfSec, cnfName).split(",")
try:
readCol.append(int(inData[0]))
readCol.append(int(inData[1]))
+2 -2
View File
@@ -450,7 +450,7 @@ class GuiWritingStats(QDialog):
except Exception as e:
self.theParent.makeAlert(
["Failed to read session log file.",str(e)], nwAlert.ERROR
["Failed to read session log file.", str(e)], nwAlert.ERROR
)
return False
@@ -577,6 +577,6 @@ class GuiWritingStats(QDialog):
tH = int(tM/60)
tM = tM - tH*60
tS = tS - tM*60 - tH*3600
return "%02d:%02d:%02d" % (tH,tM,tS)
return "%02d:%02d:%02d" % (tH, tM, tS)
# END Class GuiWritingStats