Skip to content

Commit

Permalink
Fix a bug in parsing orphaned file names
Browse files Browse the repository at this point in the history
  • Loading branch information
vkbo committed Feb 15, 2021
1 parent 8db140f commit 7b7bf5d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nw/core/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ def _scanProjectFolder(self):

if oName:
oName = self.tr("[{0}] {1}").format(
oPrefix, oName.strip("[%s]" % oPrefix).strip()
oPrefix, oName.replace("[%s]" % oPrefix, "").strip()
)
else:
nOrph += 1
Expand Down
2 changes: 1 addition & 1 deletion tests/test_core/test_core_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 7b7bf5d

Please sign in to comment.