Fix a bug in parsing orphaned file names

This commit is contained in:
Veronica K. B. Olsen committed 2021-02-16 00:38:15 +01:00
1 parent 8db140fe89
commit 7b7bf5d390
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1397,7 +1397,7 @@ class NWProject():
if oName:
oName = self.tr("[{0}] {1}").format(
oPrefix, oName.strip("[%s]" % oPrefix).strip()
oPrefix, oName.replace("[%s]" % oPrefix, "").strip()
)
else:
nOrph += 1
+1 -1
View File
@@ -928,7 +928,7 @@ def testCoreProject_OrphanedFiles(dummyGUI, nwLipsum):
# First Item with Meta Data
orphPath = os.path.join(nwLipsum, "content", "636b6aa9b697b.nwd")
with open(orphPath, mode="w", encoding="utf8") as outFile:
outFile.write("%%~name:Mars\n")
outFile.write("%%~name:[Recovered] Mars\n")
outFile.write("%%~path:5eaea4e8cdee8/636b6aa9b697b\n")
outFile.write("%%~kind:WORLD/NOTE\n")
outFile.write("%%~invalid\n")