Moved the project tree into its own iterable class NWTree

This commit is contained in:
Veronica K. B. Olsen
2020-05-07 23:08:15 +02:00
parent 64ae52e7aa
commit 58eb8e78ba
18 changed files with 342 additions and 176 deletions
+2 -2
View File
@@ -164,12 +164,12 @@ class TextFile():
* Items that appear in the TRASH folder
"""
theItem = self.theProject.getItem(tHandle)
theItem = self.theProject.projTree[tHandle]
isNone = theItem.itemType != nwItemType.FILE
isNone |= theItem.itemLayout == nwItemLayout.NO_LAYOUT
isNone |= theItem.itemClass == nwItemClass.NO_CLASS
isNone |= theItem.itemClass == nwItemClass.TRASH
isNone |= theItem.parHandle == self.theProject.trashRoot
isNone |= theItem.parHandle == self.theProject.projTree.trashRoot()
isNote = theItem.itemLayout == nwItemLayout.NOTE
isNovel = not isNone and not isNote
+1 -1
View File
@@ -142,7 +142,7 @@ class Tokenizer():
def setText(self, theHandle, theText=None):
self.theHandle = theHandle
self.theItem = self.theProject.getItem(theHandle)
self.theItem = self.theProject.projTree[theHandle]
if theText is not None:
# If the text is set, just use that