Add test coverage of doc tools
This commit is contained in:
@@ -110,7 +110,7 @@ class DocMerger:
|
||||
if docText:
|
||||
self._targetText.insert(0, docText)
|
||||
|
||||
status = outDoc.writeDocument("\n\n".join(self._targetText))
|
||||
status = outDoc.writeDocument("\n\n".join(self._targetText) + "\n\n")
|
||||
if not status:
|
||||
self._error = outDoc.getError()
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@ class NWProject():
|
||||
self._projTree.updateItemData(newItem.itemHandle)
|
||||
return newItem.itemHandle
|
||||
|
||||
def writeNewFile(self, tHandle, hLevel, isDocument):
|
||||
def writeNewFile(self, tHandle, hLevel, isDocument, addText=""):
|
||||
"""Write content to a new document after it is created. This
|
||||
will not run if the file exists and is not empty.
|
||||
"""
|
||||
@@ -191,7 +191,7 @@ class NWProject():
|
||||
return False
|
||||
|
||||
hshText = "#"*minmax(hLevel, 1, 4)
|
||||
newText = f"{hshText} {tItem.itemName}\n\n"
|
||||
newText = f"{hshText} {tItem.itemName}\n\n{addText}"
|
||||
if tItem.isNovelLike() and isDocument:
|
||||
tItem.setLayout(nwItemLayout.DOCUMENT)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user