Started adding framework for document tokenizer.

This commit is contained in:
Veronica K. B. Olsen
2019-05-05 23:16:53 +02:00
parent fd3b05f118
commit 7166dfbb2e
4 changed files with 80 additions and 0 deletions
+17
View File
@@ -28,6 +28,7 @@ from nw.gui.statusbar import GuiMainStatus
from nw.project.project import NWProject
from nw.project.document import NWDoc
from nw.project.item import NWItem
from nw.convert.tokenizer import Tokenizer
from nw.enum import nwItemType
logger = logging.getLogger(__name__)
@@ -189,6 +190,22 @@ class GuiMain(QMainWindow):
self.docEditor.setDocumentChanged(False)
return
def _previewDocument(self):
theHandles = self.treeView.getSelectedHandles()
if len(theHandles) == 0:
return
theDocs = []
self.treeView.saveTreeOrder()
for tHandle in self.theProject.treeOrder:
if tHandle not in theHandles:
continue
aDoc = Tokenizer(self.theProject, self)
aDoc.tokenizeText(tHandle)
return
##
# Tree Item Actions
##