Fixed pycodestyle E7 errors
This commit is contained in:
+1
-1
@@ -1272,7 +1272,7 @@ class GuiDocEditor(QTextEdit):
|
||||
try:
|
||||
isFind = self.lastFind[0] == theCursor.selectionStart()
|
||||
isFind &= self.lastFind[1] == theCursor.selectionEnd()
|
||||
except:
|
||||
except Exception:
|
||||
isFind = False
|
||||
|
||||
if isFind:
|
||||
|
||||
+4
-4
@@ -193,7 +193,7 @@ class GuiOutline(QTreeWidget):
|
||||
tHandle = tItem.data(self.colIndex[nwOutline.TITLE], Qt.UserRole)
|
||||
try:
|
||||
tLine = int(tItem.text(self.colIndex[nwOutline.LINE]))
|
||||
except:
|
||||
except Exception:
|
||||
tLine = 1
|
||||
|
||||
logger.verbose("User selected entry with handle %s on line %s" % (tHandle, tLine))
|
||||
@@ -254,7 +254,7 @@ class GuiOutline(QTreeWidget):
|
||||
for hName in tempOrder:
|
||||
try:
|
||||
treeOrder.append(nwOutline[hName])
|
||||
except:
|
||||
except Exception:
|
||||
logger.warning("Ignored unknown outline column '%s'" % str(hName))
|
||||
|
||||
# Add columns that was not in the file to the treeOrder array.
|
||||
@@ -276,14 +276,14 @@ class GuiOutline(QTreeWidget):
|
||||
for hName in tmpWidth:
|
||||
try:
|
||||
self.colWidth[nwOutline[hName]] = self.mainConf.pxInt(tmpWidth[hName])
|
||||
except:
|
||||
except Exception:
|
||||
logger.warning("Ignored unknown outline column '%s'" % str(hName))
|
||||
|
||||
tmpHidden = self.optState.getValue("GuiOutline", "columnHidden", {})
|
||||
for hName in tmpHidden:
|
||||
try:
|
||||
self.colHidden[nwOutline[hName]] = tmpHidden[hName]
|
||||
except:
|
||||
except Exception:
|
||||
logger.warning("Ignored unknown outline column '%s'" % str(hName))
|
||||
|
||||
self.headerMenu.setHiddenState(self.colHidden)
|
||||
|
||||
@@ -237,7 +237,7 @@ class GuiOutlineDetails(QScrollArea):
|
||||
nwItem = self.theProject.projTree[tHandle]
|
||||
novIdx = self.theIndex.novelIndex[tHandle][sTitle]
|
||||
theRefs = self.theIndex.getReferences(tHandle, sTitle)
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
if novIdx["level"] in self.LVL_MAP:
|
||||
|
||||
+1
-1
@@ -756,7 +756,7 @@ class GuiProjectTree(QTreeWidget):
|
||||
if nHandle is not None and nHandle in self.theMap:
|
||||
try:
|
||||
byIndex = self.theMap[pHandle].indexOfChild(self.theMap[nHandle])
|
||||
except:
|
||||
except Exception:
|
||||
logger.error("Failed to get index of item with handle %s" % nHandle)
|
||||
if byIndex >= 0:
|
||||
self.theMap[pHandle].insertChild(byIndex+1, newItem)
|
||||
|
||||
+2
-2
@@ -242,9 +242,9 @@ class StatusLED(QAbstractButton):
|
||||
"""
|
||||
if theState is None:
|
||||
self._theCol = self.colNone
|
||||
elif theState == True:
|
||||
elif theState:
|
||||
self._theCol = self.colTrue
|
||||
elif theState == False:
|
||||
elif not theState:
|
||||
self._theCol = self.colFalse
|
||||
else:
|
||||
self._theCol = self.colNone
|
||||
|
||||
+3
-3
@@ -182,7 +182,7 @@ class GuiTheme:
|
||||
for fontFam in listdir(fontAssets):
|
||||
fontDir = path.join(fontAssets, fontFam)
|
||||
if path.isdir(fontDir):
|
||||
if not fontFam in self.guiFontDB.families():
|
||||
if fontFam not in self.guiFontDB.families():
|
||||
for fontFile in listdir(fontDir):
|
||||
ttfFile = path.join(fontDir, fontFile)
|
||||
if path.isfile(ttfFile) and fontFile.endswith(".ttf"):
|
||||
@@ -438,7 +438,7 @@ class GuiTheme:
|
||||
outData.append(int(inData[0]))
|
||||
outData.append(int(inData[1]))
|
||||
outData.append(int(inData[2]))
|
||||
except:
|
||||
except Exception:
|
||||
logger.error("Could not load theme colours for '%s' from config file" % cnfName)
|
||||
outData = [0, 0, 0]
|
||||
else:
|
||||
@@ -456,7 +456,7 @@ class GuiTheme:
|
||||
readCol.append(int(inData[0]))
|
||||
readCol.append(int(inData[1]))
|
||||
readCol.append(int(inData[2]))
|
||||
except:
|
||||
except Exception:
|
||||
logger.error("Could not load theme colours for '%s' from config file" % cnfName)
|
||||
return
|
||||
if len(readCol) == 3:
|
||||
|
||||
Reference in New Issue
Block a user