Fix a bug in parsing orphaned file names

This commit is contained in:
Veronica K. B. Olsen
2021-02-16 00:38:15 +01:00
parent 8db140fe89
commit 7b7bf5d390
2 changed files with 2 additions and 2 deletions
+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")