From 8dbaa6bbd92af032872c00a26fdc94afb9bb066c Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Mon, 14 Nov 2022 18:59:47 +0100 Subject: [PATCH] Remove no longer needed index function --- novelwriter/core/index.py | 8 -------- tests/test_core/test_core_index.py | 10 ---------- 2 files changed, 18 deletions(-) diff --git a/novelwriter/core/index.py b/novelwriter/core/index.py index fb7c5f28..fdedb526 100644 --- a/novelwriter/core/index.py +++ b/novelwriter/core/index.py @@ -520,14 +520,6 @@ class NWIndex: hCount[iLevel] += 1 return hCount - def getHandleWordCounts(self, tHandle): - """Get all header word counts for a specific handle. - """ - return [ - (f"{tHandle}:{sTitle}", hItem.wordCount) - for sTitle, hItem in self._itemIndex.iterItemHeaders(tHandle) - ] - def getHandleHeaderCount(self, tHandle): """Get the number of headers in an item. """ diff --git a/tests/test_core/test_core_index.py b/tests/test_core/test_core_index.py index 7ea81ed2..dd94155f 100644 --- a/tests/test_core/test_core_index.py +++ b/tests/test_core/test_core_index.py @@ -775,16 +775,6 @@ def testCoreIndex_ExtractData(mockGUI, fncPath, mockRnd): (f"{nHandle}:T0002", 1, "Hello World!", 22), ] - # Header Word Counts - bHandle = "0000000000000" - assert theIndex.getHandleWordCounts(bHandle) == [] - assert theIndex.getHandleWordCounts(hHandle) == [("%s:T0001" % hHandle, 2)] - assert theIndex.getHandleWordCounts(sHandle) == [("%s:T0001" % sHandle, 2)] - assert theIndex.getHandleWordCounts(tHandle) == [("%s:T0001" % tHandle, 2)] - assert theIndex.getHandleWordCounts(nHandle) == [ - (f"{nHandle}:T0001", 12), (f"{nHandle}:T0002", 16) - ] - assert theIndex.saveIndex() is True assert theProject.saveProject() is True assert theProject.closeProject() is True