Wrap some long or too long code lines
This commit is contained in:
+13
-10
@@ -119,16 +119,19 @@ class GuiAbout(QDialog):
|
||||
"<h2>About {name:s}</h2>"
|
||||
"<p>{copyright:s}.</p>"
|
||||
"<p>Website: <a href='{website:s}'>{domain:s}</a></p>"
|
||||
"<p>{name:s} is a markdown-like text editor designed for organising and writing "
|
||||
"novels. It is written in Python 3 with a Qt5 GUI, using PyQt5.</p>"
|
||||
"<p>{name:s} is free software: you can redistribute it and/or modify it under the "
|
||||
"terms of the GNU General Public License as published by the Free Software Foundation, "
|
||||
"either version 3 of the License, or (at your option) any later version.</p>"
|
||||
"<p>{name:s} is distributed in the hope that it will be useful, but WITHOUT ANY "
|
||||
"WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A "
|
||||
"PARTICULAR PURPOSE.</p>"
|
||||
"<p>See the License tab for the full text, or visit the GNU website at "
|
||||
"<a href='https://www.gnu.org/licenses/gpl-3.0.html'>GPL v3.0</a> for more details.</p>"
|
||||
"<p>{name:s} is a markdown-like text editor designed for "
|
||||
"organising and writing novels. It is written in Python 3 with a "
|
||||
"Qt5 GUI, using PyQt5.</p>"
|
||||
"<p>{name:s} is free software: you can redistribute it and/or "
|
||||
"modify it under the terms of the GNU General Public License as "
|
||||
"published by the Free Software Foundation, either version 3 of "
|
||||
"the License, or (at your option) any later version.</p>"
|
||||
"<p>{name:s} is distributed in the hope that it will be useful, "
|
||||
"but WITHOUT ANY WARRANTY; without even the implied warranty of "
|
||||
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p>"
|
||||
"<p>See the License tab for the full text, or visit the GNU website "
|
||||
"at <a href='https://www.gnu.org/licenses/gpl-3.0.html'>GPL v3.0</a> "
|
||||
"for more details.</p>"
|
||||
"<h3>Credits</h3>"
|
||||
"<p>{credits:s}</p>"
|
||||
).format(
|
||||
|
||||
@@ -150,7 +150,9 @@ class GuiDocSplit(QDialog):
|
||||
), nwAlert.ERROR)
|
||||
return
|
||||
|
||||
fHandle = self.theProject.newFolder(srcItem.itemName, srcItem.itemClass, srcItem.parHandle)
|
||||
fHandle = self.theProject.newFolder(
|
||||
srcItem.itemName, srcItem.itemClass, srcItem.parHandle
|
||||
)
|
||||
self.theParent.treeView.revealTreeItem(fHandle)
|
||||
logger.verbose("Creating folder %s" % fHandle)
|
||||
|
||||
@@ -174,7 +176,9 @@ class GuiDocSplit(QDialog):
|
||||
newItem = self.theProject.projTree[nHandle]
|
||||
newItem.setLayout(itemLayout)
|
||||
logger.verbose(
|
||||
"Creating new document %s with text from line %d to %d" % (nHandle, iStart, iEnd-1)
|
||||
"Creating new document %s with text from line %d to %d" % (
|
||||
nHandle, iStart, iEnd-1
|
||||
)
|
||||
)
|
||||
|
||||
theText = "\n".join(theLines[iStart:iEnd])
|
||||
@@ -227,7 +231,9 @@ class GuiDocSplit(QDialog):
|
||||
|
||||
spLevel = self.splitLevel.currentData()
|
||||
self.optState.setValue("GuiDocSplit", "spLevel", spLevel)
|
||||
logger.debug("Scanning document %s for headings level <= %d" % (self.sourceItem, spLevel))
|
||||
logger.debug(
|
||||
"Scanning document %s for headings level <= %d" % (self.sourceItem, spLevel)
|
||||
)
|
||||
|
||||
lineNo = 0
|
||||
for aLine in theText.splitlines():
|
||||
|
||||
@@ -180,11 +180,15 @@ class GuiSessionLogView(QDialog):
|
||||
inData = inLine.split()
|
||||
if len(inData) != 8:
|
||||
continue
|
||||
dStart = datetime.strptime("%s %s" % (inData[1],inData[2]), nwConst.tStampFmt)
|
||||
dEnd = datetime.strptime("%s %s" % (inData[4],inData[5]), nwConst.tStampFmt)
|
||||
dStart = datetime.strptime(
|
||||
"%s %s" % (inData[1],inData[2]), nwConst.tStampFmt
|
||||
)
|
||||
dEnd = datetime.strptime(
|
||||
"%s %s" % (inData[4],inData[5]), nwConst.tStampFmt
|
||||
)
|
||||
nWords = int(inData[7])
|
||||
tDiff = dEnd - dStart
|
||||
sDiff = tDiff.total_seconds()
|
||||
tDiff = dEnd - dStart
|
||||
sDiff = tDiff.total_seconds()
|
||||
|
||||
self.timeTotal += sDiff
|
||||
if abs(nWords) > 0:
|
||||
@@ -196,7 +200,9 @@ class GuiSessionLogView(QDialog):
|
||||
if hideNegative and nWords < 0:
|
||||
continue
|
||||
|
||||
newItem = QTreeWidgetItem([str(dStart),self._formatTime(sDiff),str(nWords),""])
|
||||
newItem = QTreeWidgetItem(
|
||||
[str(dStart), self._formatTime(sDiff), str(nWords), ""]
|
||||
)
|
||||
|
||||
newItem.setTextAlignment(1,Qt.AlignRight)
|
||||
newItem.setTextAlignment(2,Qt.AlignRight)
|
||||
@@ -208,7 +214,9 @@ class GuiSessionLogView(QDialog):
|
||||
self.listBox.addTopLevelItem(newItem)
|
||||
|
||||
except Exception as e:
|
||||
self.theParent.makeAlert(["Failed to read session log file.",str(e)], nwAlert.ERROR)
|
||||
self.theParent.makeAlert(
|
||||
["Failed to read session log file.",str(e)], nwAlert.ERROR
|
||||
)
|
||||
return False
|
||||
|
||||
self.labelFilter.setText(self._formatTime(self.timeFilter))
|
||||
|
||||
Reference in New Issue
Block a user