Remove all verbose log entries

This commit is contained in:
Veronica Berglyd Olsen
2022-10-19 08:27:11 +02:00
parent 54fea1d28e
commit 8775b360d8
15 changed files with 79 additions and 98 deletions
+3 -3
View File
@@ -291,8 +291,8 @@ class Config:
self.nwLangPath = os.path.join(self.assetPath, "i18n")
logger.debug("Assets: %s", self.assetPath)
logger.verbose("App path: %s", self.appPath)
logger.verbose("Last path: %s", self.lastPath)
logger.debug("App path: %s", self.appPath)
logger.debug("Last path: %s", self.lastPath)
# If the config and data folders don't not exist, create them
# This assumes that the os config and data folders exist
@@ -704,7 +704,7 @@ class Config:
"""
if thePath in self.recentProj:
del self.recentProj[thePath]
logger.verbose("Removed recent: %s", thePath)
logger.debug("Removed recent: %s", thePath)
self.saveRecentCache()
else:
logger.error("Unknown recent: %s", thePath)
+3 -3
View File
@@ -176,7 +176,7 @@ class NWIndex:
self._indexChange = round(time())
logger.verbose("Index loaded in %.3f ms", (time() - tStart)*1000)
logger.debug("Index loaded in %.3f ms", (time() - tStart)*1000)
return True
@@ -202,7 +202,7 @@ class NWIndex:
logException()
return False
logger.verbose("Index saved in %.3f ms", (time() - tStart)*1000)
logger.debug("Index saved in %.3f ms", (time() - tStart)*1000)
return True
@@ -312,7 +312,7 @@ class NWIndex:
# Prune no longer used tags
for tTag, isActive in itemTags.items():
if not isActive:
logger.verbose("Deleting removed tag '%s'", tTag)
logger.debug("Deleting removed tag '%s'", tTag)
del self._tagsIndex[tTag]
return
+8 -8
View File
@@ -454,7 +454,7 @@ class NWProject:
legacyList = [] # Cleanup is done later
for projItem in os.listdir(self.projPath):
logger.verbose("Project contains: %s", projItem)
logger.debug("Project contains: %s", projItem)
if projItem.startswith("data_") and len(projItem) == 6:
legacyList.append(projItem)
@@ -474,7 +474,7 @@ class NWProject:
self.clearProject()
return False
else:
logger.verbose("Project is not locked")
logger.debug("Project is not locked")
# Open The Project XML File
# =========================
@@ -511,8 +511,8 @@ class NWProject:
hexVersion = xRoot.attrib.get("hexVersion", "0x0")
fileVersion = xRoot.attrib.get("fileVersion", self.tr("Unknown"))
logger.verbose("XML root is '%s'", nwxRoot)
logger.verbose("File version is '%s'", fileVersion)
logger.debug("XML root is '%s'", nwxRoot)
logger.debug("File version is '%s'", fileVersion)
# Check File Type
# ===============
@@ -594,15 +594,15 @@ class NWProject:
continue
if xItem.tag == "name":
self.projName = simplified(checkString(xItem.text, ""))
logger.verbose("Working Title: '%s'", self.projName)
logger.info("Project Name: '%s'", self.projName)
elif xItem.tag == "title":
self.bookTitle = simplified(checkString(xItem.text, ""))
logger.verbose("Title is '%s'", self.bookTitle)
logger.info("Project Title: '%s'", self.bookTitle)
elif xItem.tag == "author":
author = simplified(checkString(xItem.text, ""))
if author:
self.bookAuthors.append(author)
logger.verbose("Author: '%s'", author)
logger.debug("Author: '%s'", author)
elif xItem.tag == "saveCount":
self.saveCount = checkInt(xItem.text, 0)
elif xItem.tag == "autoCount":
@@ -680,7 +680,7 @@ class NWProject:
# Check the project tree consistency
for tItem in self._projTree:
tHandle = tItem.itemHandle
logger.verbose("Checking item '%s'", tHandle)
logger.debug("Checking item '%s'", tHandle)
if not self._projTree.updateItemData(tHandle):
logger.error("There was a problem item '%s', and it has been removed", tHandle)
del self._projTree[tHandle] # The file will be re-added as orphaned
+6 -6
View File
@@ -89,20 +89,20 @@ class NWTree:
logger.warning("Duplicate handle '%s' detected, skipping", tHandle)
return False
logger.verbose("Adding item '%s' with parent '%s'", str(tHandle), str(pHandle))
logger.debug("Adding item '%s' with parent '%s'", str(tHandle), str(pHandle))
nwItem.setHandle(tHandle)
nwItem.setParent(pHandle)
if nwItem.isRootType():
logger.verbose("Item '%s' is a root item", str(tHandle))
logger.debug("Item '%s' is a root item", str(tHandle))
self._treeRoots[tHandle] = nwItem
if nwItem.itemClass == nwItemClass.ARCHIVE:
logger.verbose("Item '%s' is the archive folder", str(tHandle))
logger.debug("Item '%s' is the archive folder", str(tHandle))
self._archRoot = tHandle
elif nwItem.itemClass == nwItemClass.TRASH:
if self._trashRoot is None:
logger.verbose("Item '%s' is the trash folder", str(tHandle))
logger.debug("Item '%s' is the trash folder", str(tHandle))
self._trashRoot = tHandle
else:
logger.error("Only one trash folder allowed")
@@ -349,7 +349,7 @@ class NWTree:
# Save the temp list
self._treeOrder = tmpOrder
self._setTreeChanged(True)
logger.verbose("Project tree order updated")
logger.debug("Project tree order updated")
return
@@ -459,7 +459,7 @@ class NWTree:
"""Generate a unique item handle. In the event that the key
already exists, generate a new one.
"""
logger.verbose("Generating new handle")
logger.debug("Generating new handle")
handle = f"{random.getrandbits(52):013x}"
if handle in self._projTree:
logger.warning("Duplicate handle encountered! Retrying ...")
-4
View File
@@ -158,7 +158,6 @@ class GuiProjectLoad(QDialog):
def _doOpenRecent(self):
"""Close the dialog window with a recent project selected.
"""
logger.verbose("GuiProjectLoad open button clicked")
self._saveSettings()
self.openPath = None
@@ -183,7 +182,6 @@ class GuiProjectLoad(QDialog):
def _doBrowse(self):
"""Browse for a folder path.
"""
logger.verbose("GuiProjectLoad browse button clicked")
extFilter = [
self.tr("novelWriter Project File ({0})").format(nwFiles.PROJ_FILE),
self.tr("All files ({0})").format("*"),
@@ -203,7 +201,6 @@ class GuiProjectLoad(QDialog):
def _doCancel(self):
"""Close the dialog window without doing anything.
"""
logger.verbose("GuiProjectLoad close button clicked")
self.openPath = None
self.openState = self.NONE_STATE
self.close()
@@ -212,7 +209,6 @@ class GuiProjectLoad(QDialog):
def _doNewProject(self):
"""Create a new project.
"""
logger.verbose("GuiProjectLoad new project button clicked")
self._saveSettings()
self.openPath = None
self.openState = self.NEW_STATE
-2
View File
@@ -96,8 +96,6 @@ class GuiProjectSettings(PagedDialog):
def _doSave(self):
"""Save settings and close dialog.
"""
logger.verbose("GuiProjectSettings save button clicked")
projName = self.tabMain.editName.text()
bookTitle = self.tabMain.editTitle.text()
bookAuthors = self.tabMain.editAuthors.toPlainText()
+17 -18
View File
@@ -664,7 +664,7 @@ class GuiDocEditor(QTextEdit):
if theBlock:
self.setCursorPosition(theBlock.position())
self.docFooter.updateLineCount()
logger.verbose("Cursor moved to line %d", theLine)
logger.debug("Cursor moved to line %d", theLine)
return True
@@ -718,7 +718,7 @@ class GuiDocEditor(QTextEdit):
if not self._bigDoc:
self.spellCheckDocument()
logger.verbose("Spell check is set to '%s'", str(theMode))
logger.debug("Spell check is set to '%s'", str(theMode))
return True
@@ -728,7 +728,7 @@ class GuiDocEditor(QTextEdit):
of Qt 5.13, is to clear the text and put it back. This clears
the undo stack, so we only do it for big documents.
"""
logger.verbose("Running spell checker")
logger.debug("Running spell checker")
if self._spellCheck:
bfTime = time()
qApp.setOverrideCursor(QCursor(Qt.WaitCursor))
@@ -763,7 +763,7 @@ class GuiDocEditor(QTextEdit):
logger.error("Not a document action")
return False
logger.verbose("Requesting action: %s", theAction.name)
logger.debug("Requesting action: %s", theAction.name)
self._allowAutoReplace(False)
if theAction == nwDocAction.UNDO:
@@ -944,7 +944,7 @@ class GuiDocEditor(QTextEdit):
logger.error("Invalid keyword '%s'", keyWord)
return False
logger.verbose("Inserting keyword '%s'", keyWord)
logger.debug("Inserting keyword '%s'", keyWord)
theState = self.insertNewBlock("%s: " % keyWord)
return theState
@@ -1172,7 +1172,7 @@ class GuiDocEditor(QTextEdit):
spellCheck &= theWord != ""
if spellCheck:
logger.verbose("Looking up '%s' in the dictionary", theWord)
logger.debug("Looking up '%s' in the dictionary", theWord)
spellCheck &= not self.spEnchant.checkWord(theWord)
if spellCheck:
@@ -1238,11 +1238,11 @@ class GuiDocEditor(QTextEdit):
return
if self.wCounterDoc.isRunning():
logger.verbose("Word counter is busy")
logger.debug("Word counter is busy")
return
if time() - self._lastEdit < 5 * self.wcInterval:
logger.verbose("Running word counter")
logger.debug("Running word counter")
self.mainGui.threadPool.start(self.wCounterDoc)
return
@@ -1254,7 +1254,7 @@ class GuiDocEditor(QTextEdit):
if self._docHandle is None or self._nwItem is None:
return
logger.verbose("Updating word count")
logger.debug("Updating word count")
self._charCount = cCount
self._wordCount = wCount
@@ -1297,7 +1297,7 @@ class GuiDocEditor(QTextEdit):
return
if self.wCounterSel.isRunning():
logger.verbose("Selection word counter is busy")
logger.debug("Selection word counter is busy")
return
self.mainGui.threadPool.start(self.wCounterSel)
@@ -1311,7 +1311,7 @@ class GuiDocEditor(QTextEdit):
if self._docHandle is None or self._nwItem is None:
return
logger.verbose("User selectee %d words", wCount)
logger.debug("User selectee %d words", wCount)
self.docFooter.updateCounts(wCount=wCount, cCount=cCount)
self.wcTimerSel.stop()
@@ -1329,11 +1329,11 @@ class GuiDocEditor(QTextEdit):
QPointF(theSize.width(), theSize.height()), Qt.FuzzyHit
)
if self._queuePos <= thePos:
logger.verbose("Allowed cursor move to %d <= %d", self._queuePos, thePos)
logger.debug("Allowed cursor move to %d <= %d", self._queuePos, thePos)
self.setCursorPosition(self._queuePos)
self._queuePos = None
else:
logger.verbose("Denied cursor move to %d > %d", self._queuePos, thePos)
logger.debug("Denied cursor move to %d > %d", self._queuePos, thePos)
return
@@ -1520,7 +1520,7 @@ class GuiDocEditor(QTextEdit):
theCursor.endEditBlock()
theCursor.setPosition(theCursor.selectionEnd())
self.setTextCursor(theCursor)
logger.verbose(
logger.debug(
"Replaced occurrence of '%s' with '%s' on line %d",
searchFor, replWith, theCursor.blockNumber()
)
@@ -1898,10 +1898,10 @@ class GuiDocEditor(QTextEdit):
return False
if loadTag:
logger.verbose("Attempting to follow tag '%s'", theWord)
logger.debug("Attempting to follow tag '%s'", theWord)
self.loadDocumentTagRequest.emit(theWord, nwDocMode.VIEW)
else:
logger.verbose("Potential tag '%s'", theWord)
logger.debug("Potential tag '%s'", theWord)
return True
@@ -2431,7 +2431,6 @@ class GuiDocEditSearch(QFrame):
self.searchBox.selectAll()
if self.isRegEx:
self._alertSearchValid(True)
logger.verbose("Setting search text to '%s'", theText)
return True
def setReplaceText(self, theText):
@@ -2945,7 +2944,7 @@ class GuiDocEditFooter(QWidget):
"""
self._docHandle = tHandle
if self._docHandle is None:
logger.verbose("No handle set, so clearing the editor footer")
logger.debug("No handle set, so clearing the editor footer")
self._theItem = None
else:
self._theItem = self.theProject.tree[self._docHandle]
+14 -14
View File
@@ -241,7 +241,7 @@ class GuiDocViewer(QTextBrowser):
"""Wrapper function for various document actions on the current
document.
"""
logger.verbose("Requesting action: '%s'", theAction.name)
logger.debug("Requesting action: '%s'", theAction.name)
if self._docHandle is None:
logger.error("No document open")
return False
@@ -264,7 +264,7 @@ class GuiDocViewer(QTextBrowser):
if not isinstance(tAnchor, str):
return False
if tAnchor.startswith("#"):
logger.verbose("Moving to anchor '%s'", tAnchor)
logger.debug("Moving to anchor '%s'", tAnchor)
self.setSource(QUrl(tAnchor))
return True
@@ -350,7 +350,7 @@ class GuiDocViewer(QTextBrowser):
theBlock = self.document().findBlockByLineNumber(theLine)
if theBlock:
self.setCursorPosition(theBlock.position())
logger.verbose("Cursor moved to line %d", theLine)
logger.debug("Cursor moved to line %d", theLine)
return True
def setScrollPosition(self, thePos):
@@ -396,7 +396,7 @@ class GuiDocViewer(QTextBrowser):
"""Process a clicked link internally in the document.
"""
theLink = theURL.url()
logger.verbose("Clicked link: '%s'", theLink)
logger.debug("Clicked link: '%s'", theLink)
if len(theLink) > 0:
theBits = theLink.split("=")
if len(theBits) == 2:
@@ -578,7 +578,7 @@ class GuiDocViewHistory:
def clear(self):
"""Clear the view history.
"""
logger.verbose("View history cleared")
logger.debug("View history cleared")
self._navHistory = []
self._posHistory = []
self._currPos = -1
@@ -592,7 +592,7 @@ class GuiDocViewHistory:
"""
if self._currPos >= 0 and self._currPos < len(self._navHistory):
if tHandle == self._navHistory[self._currPos]:
logger.verbose("Not updating view hsitory")
logger.debug("Not updating view hsitory")
return False
self._truncateHistory(self._currPos)
@@ -607,7 +607,7 @@ class GuiDocViewHistory:
self._dumpHistory()
logger.verbose("Added '%s' to view history", tHandle)
logger.debug("Added '%s' to view history", tHandle)
return True
@@ -616,7 +616,7 @@ class GuiDocViewHistory:
"""
newPos = self._currPos + 1
if newPos < len(self._navHistory):
logger.verbose("Move forward in view history")
logger.debug("Move forward in view history")
self._prevPos = self._currPos
self._updateScrollBar()
@@ -634,7 +634,7 @@ class GuiDocViewHistory:
"""
newPos = self._currPos - 1
if newPos >= 0:
logger.verbose("Move backward in view history")
logger.debug("Move backward in view history")
self._prevPos = self._currPos
self._updateScrollBar()
@@ -680,11 +680,11 @@ class GuiDocViewHistory:
def _dumpHistory(self):
"""Debug function to dump history to the logger. Since it is a
for loop, it is skipped entirely if log level isn't VERBOSE.
for loop, it is skipped entirely if log level isn't DEBUG.
"""
if logger.getEffectiveLevel() < logging.DEBUG:
if logger.getEffectiveLevel() == logging.DEBUG:
for i, (h, p) in enumerate(zip(self._navHistory, self._posHistory)):
logger.verbose(
logger.debug(
"History %02d: %s %13s [x:%d]" % (
i + 1, ">" if i == self._currPos else " ", h, p
)
@@ -1104,7 +1104,7 @@ class GuiDocViewFooter(QWidget):
def _doToggleSticky(self, theState):
"""Toggle the sticky flag for the reference panel.
"""
logger.verbose("Reference sticky is %s", str(theState))
logger.debug("Reference sticky is %s", str(theState))
self.docViewer.stickyRef = theState
if not theState and self.docViewer.docHandle() is not None:
self.viewMeta.refreshReferences(self.docViewer.docHandle())
@@ -1199,7 +1199,7 @@ class GuiDocViewDetails(QScrollArea):
"""Capture the link-click and forward it to the document viewer
class for handling.
"""
logger.verbose("Clicked link: '%s'", theLink)
logger.debug("Clicked link: '%s'", theLink)
if len(theLink) == 21:
tHandle = theLink[:13]
tAnchor = theLink[13:]
+5 -5
View File
@@ -443,14 +443,14 @@ class GuiNovelTree(QTreeWidget):
def refreshTree(self, rootHandle=None, overRide=False):
"""Called whenever the Novel tab is activated.
"""
logger.verbose("Requesting refresh of the novel tree")
logger.debug("Requesting refresh of the novel tree")
if rootHandle is None:
rootHandle = self.theProject.tree.findRoot(nwItemClass.NOVEL)
treeChanged = self.mainGui.projView.changedSince(self._lastBuild)
indexChanged = self.theProject.index.rootChangedSince(rootHandle, self._lastBuild)
if not (treeChanged or indexChanged or overRide):
logger.verbose("No changes have been made to the novel index")
logger.debug("No changes have been made to the novel index")
return
selItem = self.selectedItems()
@@ -519,7 +519,7 @@ class GuiNovelTree(QTreeWidget):
tItem.setBackground(self.C_EXTRA, self.palette().base())
tItem.setBackground(self.C_MORE, self.palette().base())
logger.verbose("Highlighted Novel Tree in %.3f ms", (time() - tStart)*1000)
logger.debug("Highlighted Novel Tree in %.3f ms", (time() - tStart)*1000)
return
@@ -603,7 +603,7 @@ class GuiNovelTree(QTreeWidget):
"""
self.clearContent()
tStart = time()
logger.verbose("Building novel tree for root item '%s'", rootHandle)
logger.debug("Building novel tree for root item '%s'", rootHandle)
novStruct = self.theProject.index.novelStructure(rootHandle=rootHandle, skipExcl=True)
for tKey, tHandle, sTitle, novIdx in novStruct:
@@ -636,7 +636,7 @@ class GuiNovelTree(QTreeWidget):
self.setActiveHandle(self._actHandle)
logger.verbose("Novel Tree built in %.3f ms", (time() - tStart)*1000)
logger.debug("Novel Tree built in %.3f ms", (time() - tStart)*1000)
self._lastBuild = time()
return
+1 -3
View File
@@ -484,7 +484,7 @@ class GuiOutlineTree(QTreeWidget):
# was last built, we rebuild the tree from the updated index.
indexChanged = self.theProject.index.rootChangedSince(rootHandle, self._lastBuild)
if not (novelChanged or indexChanged or overRide):
logger.verbose("No changes have been made to the novel index")
logger.debug("No changes have been made to the novel index")
return
self._populateTree(rootHandle)
@@ -554,11 +554,9 @@ class GuiOutlineTree(QTreeWidget):
"""Receive the changes to column visibility forwarded by the
column selection menu.
"""
logger.verbose("User toggled Outline column '%s'", theItem.name)
if theItem in self._colIdx:
self.setColumnHidden(self._colIdx[theItem], not isChecked)
self._saveHeaderState()
return
##
+4 -4
View File
@@ -352,7 +352,7 @@ class GuiProjectToolBar(QWidget):
def buildQuickLinkMenu(self):
"""Build the quick link menu.
"""
logger.verbose("Rebuilding quick links menu")
logger.debug("Rebuilding quick links menu")
self.mQuick.clear()
for n, (tHandle, nwItem) in enumerate(self.theProject.tree.iterRoots(None)):
@@ -615,7 +615,7 @@ class GuiProjectTree(QTreeWidget):
tHandle = self.getSelectedHandle()
trItem = self._getTreeItem(tHandle)
if trItem is None:
logger.verbose("No item selected")
logger.debug("No item selected")
return False
pItem = trItem.parent()
@@ -760,7 +760,7 @@ class GuiProjectTree(QTreeWidget):
logger.info("Action cancelled by user")
return False
logger.verbose("Deleting %d file(s) from Trash", nTrash)
logger.debug("Deleting %d file(s) from Trash", nTrash)
for tHandle in reversed(self.getTreeFromHandle(trashHandle)):
if tHandle == trashHandle:
continue
@@ -986,7 +986,7 @@ class GuiProjectTree(QTreeWidget):
srcOK = isinstance(srcItem, QTreeWidgetItem)
dstOk = isinstance(dstItem, QTreeWidgetItem)
if not srcOK or not dstOk or dstIndex is None:
logger.verbose("No tree move to undo")
logger.debug("No tree move to undo")
return False
if srcItem not in self._treeMap.values():
+13 -13
View File
@@ -142,8 +142,8 @@ class GuiTheme:
self.guiDPI = qApp.primaryScreen().logicalDotsPerInchX()
self.guiScale = qApp.primaryScreen().logicalDotsPerInchX()/96.0
self.mainConf.guiScale = self.guiScale
logger.verbose("GUI DPI: %.1f", self.guiDPI)
logger.verbose("GUI Scale: %.2f", self.guiScale)
logger.debug("GUI DPI: %.1f", self.guiDPI)
logger.debug("GUI Scale: %.2f", self.guiScale)
# Fonts
self.guiFont = qApp.font()
@@ -160,12 +160,12 @@ class GuiTheme:
self.guiFontFixed.setPointSizeF(0.95*self.fontPointSize)
self.guiFontFixed.setFamily(QFontDatabase.systemFont(QFontDatabase.FixedFont).family())
logger.verbose("GUI Font Family: %s", self.guiFont.family())
logger.verbose("GUI Font Point Size: %.2f", self.fontPointSize)
logger.verbose("GUI Font Pixel Size: %d", self.fontPixelSize)
logger.verbose("GUI Base Icon Size: %d", self.baseIconSize)
logger.verbose("Text 'N' Height: %d", self.textNHeight)
logger.verbose("Text 'N' Width: %d", self.textNWidth)
logger.debug("GUI Font Family: %s", self.guiFont.family())
logger.debug("GUI Font Point Size: %.2f", self.fontPointSize)
logger.debug("GUI Font Pixel Size: %d", self.fontPixelSize)
logger.debug("GUI Base Icon Size: %d", self.baseIconSize)
logger.debug("Text 'N' Height: %d", self.textNHeight)
logger.debug("Text 'N' Width: %d", self.textNWidth)
return
@@ -358,7 +358,7 @@ class GuiTheme:
confParser = NWConfigParser()
for themeKey, themePath in self._availThemes.items():
logger.verbose("Checking theme config for '%s'", themeKey)
logger.debug("Checking theme config for '%s'", themeKey)
themeName = _loadInternalName(confParser, themePath)
if themeName:
self._themeList.append((themeKey, themeName))
@@ -375,7 +375,7 @@ class GuiTheme:
confParser = NWConfigParser()
for syntaxKey, syntaxPath in self._availSyntax.items():
logger.verbose("Checking theme syntax for '%s'", syntaxKey)
logger.debug("Checking theme syntax for '%s'", syntaxKey)
syntaxName = _loadInternalName(confParser, syntaxPath)
if syntaxName:
self._syntaxList.append((syntaxKey, syntaxName))
@@ -561,7 +561,7 @@ class GuiIcons:
iconPath = os.path.join(self._themePath, iconFile)
if os.path.isfile(iconPath):
self._themeMap[iconName] = iconPath
logger.verbose("Icon slot '%s' using file '%s'", iconName, iconFile)
logger.debug("Icon slot '%s' using file '%s'", iconName, iconFile)
else:
logger.error("Icon file '%s' not in theme folder", iconFile)
@@ -680,7 +680,7 @@ class GuiIcons:
if not os.path.isdir(themePath):
continue
logger.verbose("Checking icon theme config for '%s'", themeDir)
logger.debug("Checking icon theme config for '%s'", themeDir)
themeConf = os.path.join(themePath, self._confName)
themeName = _loadInternalName(confParser, themeConf)
if themeName:
@@ -728,7 +728,7 @@ class GuiIcons:
# Otherwise, we load from the theme folder
if iconKey in self._themeMap:
relPath = os.path.relpath(self._themeMap[iconKey], self._iconPath)
logger.verbose("Loading: %s", relPath)
logger.debug("Loading: %s", relPath)
return QIcon(self._themeMap[iconKey])
# If we didn't find one, give up and return an empty icon
+3 -13
View File
@@ -666,21 +666,18 @@ class GuiMain(QMainWindow):
logger.debug("Viewing document, but no handle provided")
if self.docEditor.hasFocus():
logger.verbose("Trying editor document")
tHandle = self.docEditor.docHandle()
if tHandle is not None:
self.saveDocument()
else:
logger.verbose("Trying selected document")
tHandle = self.projView.getSelectedHandle()
if tHandle is None:
logger.verbose("Trying last viewed document")
tHandle = self.theProject.lastViewed
if tHandle is None:
logger.verbose("No document to view, giving up")
logger.debug("No document to view, giving up")
return False
# Make sure main tab is in Editor view
@@ -851,7 +848,7 @@ class GuiMain(QMainWindow):
if tItem is None: # pragma: no cover
continue # This is a bug trap
logger.verbose("Indexing '%s'", tItem.itemName)
logger.debug("Indexing '%s'", tItem.itemName)
if self.theProject.index.reIndexHandle(tItem.itemHandle):
# Update Word Counts
self.projView.propagateCount(tItem.itemHandle, tItem.wordCount, countChildren=True)
@@ -1524,7 +1521,6 @@ class GuiMain(QMainWindow):
if not self.hasProject:
self.statusBar.setProjectStats(0, 0)
logger.verbose("Updating total word count")
self.theProject.updateWordCounts()
if self.mainConf.incNotesWCount:
currWords = self.theProject.currWCount
@@ -1561,13 +1557,9 @@ class GuiMain(QMainWindow):
def _mainStackChanged(self, stIndex):
"""Activated when the main window tab is changed.
"""
if stIndex == self.idxEditorView:
logger.verbose("Editor View activated")
elif stIndex == self.idxOutlineView:
logger.verbose("Outline View activated")
if stIndex == self.idxOutlineView:
if self.hasProject:
self.outlineView.refreshTree()
return
@pyqtSlot(int)
@@ -1577,11 +1569,9 @@ class GuiMain(QMainWindow):
sHandle = None
if stIndex == self.idxProjView:
logger.verbose("Project Tree View activated")
sHandle = self.projView.getSelectedHandle()
elif stIndex == self.idxNovelView:
logger.verbose("Novel Tree View activated")
if self.hasProject:
self.novelView.refreshTree()
sHandle, _ = self.novelView.getSelectedHandle()
+1 -1
View File
@@ -214,7 +214,7 @@ class ProjWizardFolderPage(QWizardPage):
setPath = os.path.abspath(os.path.expanduser(self.projPath.text()))
parPath = os.path.dirname(setPath)
logger.verbose("Path is: %s", setPath)
logger.debug("Path is: %s", setPath)
if parPath and not os.path.isdir(parPath):
self.errLabel.setText(self.tr(
"Error: A project folder cannot be created using this path."
+1 -1
View File
@@ -449,7 +449,7 @@ class GuiWritingStats(QDialog):
if inLine.startswith("#"):
if inLine.startswith("# Offset"):
self.wordOffset = checkInt(inLine[9:].strip(), 0)
logger.verbose(
logger.debug(
"Initial word count when log was started is %d" % self.wordOffset
)
continue