From 06031ab7d52467f9107b5cba3a6caf6b4cd1d483 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sun, 1 Dec 2019 16:26:37 +0100 Subject: [PATCH] Started adding split amd merge functions --- nw/project/project.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/nw/project/project.py b/nw/project/project.py index 041029a1..2a88333b 100644 --- a/nw/project/project.py +++ b/nw/project/project.py @@ -369,6 +369,39 @@ class NWProject(): self.clearProject() return True + ## + # Document Methods + ## + + def splitDocument(self, tHandle, headerLevel, folderLevel): + """Split a document into multiple documents under the same + header. Header level threshold determines at what level the + splitting should occur, and folders can also be created at a + certain structure level. + """ + + return True + + def mergeDocuments(self, handleList): + """Merge a list of document handles into a single document. + """ + + fileList = [] + for tHandle in handleList: + tItem = self.getItem(tHandle) + if tItem is None: + continue + if tItem.itemType == nwItemType.FILE: + fileList.append(tHandle) + else: + pass + + mergeText = "" + for tHandle in fileList: + pass + + return True + ## # Set Functions ##