From ce96ac996111b41856ad03ebd5a3cf9874c1586d Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" Date: Thu, 30 May 2019 22:03:52 +0200 Subject: [PATCH] tags are now case sensitive, and need to be unique --- nw/project/index.py | 17 +++++++++++------ sample/sampleNovel/data_6/36b6aa9b697b_main.nwd | 6 +++--- sample/sampleNovel/meta/sessionInfo.log | 10 ++++++++++ sample/sampleNovel/nwProject.nwx | 8 ++++---- 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/nw/project/index.py b/nw/project/index.py index 5ad504b6..56baf52b 100644 --- a/nw/project/index.py +++ b/nw/project/index.py @@ -240,7 +240,7 @@ class NWIndex(): if sKey == "@": return False, theBits, thePos - theBits.append(sKey.lower()) + theBits.append(sKey) thePos.append(cPos) cPos += len(sKey) + 1 @@ -253,7 +253,7 @@ class NWIndex(): sVal = cVal.strip() rLen = len(cVal.lstrip()) tLen = len(cVal) - theBits.append(sVal.lower()) + theBits.append(sVal) thePos.append(cPos+tLen-rLen) cPos += tLen + 1 @@ -261,16 +261,21 @@ class NWIndex(): def checkThese(self, theBits, tItem): - theBits = [aBit.lower() for aBit in theBits] - nBits = len(theBits) - isGood = [False]*nBits + nBits = len(theBits) + isGood = [False]*nBits if nBits == 0: return [] # If we have a tag, the first value is always OK, rest is ignored if theBits[0] == self.TAG_KEY and nBits > 1: isGood[0] = True - isGood[1] = True + if theBits[1] in self.tagIndex.keys(): + if self.tagIndex[theBits[1]][1] == tItem.itemHandle: + isGood[1] = True + else: + isGood[1] = False + else: + isGood[1] = True return isGood # If we're still here, we better check the references diff --git a/sample/sampleNovel/data_6/36b6aa9b697b_main.nwd b/sample/sampleNovel/data_6/36b6aa9b697b_main.nwd index 60cccf00..831ee9fe 100644 --- a/sample/sampleNovel/data_6/36b6aa9b697b_main.nwd +++ b/sample/sampleNovel/data_6/36b6aa9b697b_main.nwd @@ -3,9 +3,9 @@ ## This is the Subtitle % Begin Meta -@POV: Jane -@Char: Jane, John -@Location: Earth +@pov: Jane +@char: Jane, John +@location: Earth % End Meta Some text here would look good as well, and maybe some "dialogue"? diff --git a/sample/sampleNovel/meta/sessionInfo.log b/sample/sampleNovel/meta/sessionInfo.log index ed02d290..4ac50074 100644 --- a/sample/sampleNovel/meta/sessionInfo.log +++ b/sample/sampleNovel/meta/sessionInfo.log @@ -124,3 +124,13 @@ Start: 2019-05-30 19:43:42 End: 2019-05-30 19:43:49 Words: 0 Start: 2019-05-30 19:45:34 End: 2019-05-30 19:45:59 Words: 0 Start: 2019-05-30 19:53:25 End: 2019-05-30 19:55:00 Words: 0 Start: 2019-05-30 19:55:21 End: 2019-05-30 19:56:16 Words: 0 +Start: 2019-05-30 20:51:36 End: 2019-05-30 20:51:40 Words: 0 +Start: 2019-05-30 20:51:40 End: 2019-05-30 20:51:45 Words: 0 +Start: 2019-05-30 20:25:18 End: 2019-05-30 21:55:25 Words: 0 +Start: 2019-05-30 21:56:09 End: 2019-05-30 21:57:09 Words: 0 +Start: 2019-05-30 21:57:14 End: 2019-05-30 21:58:29 Words: 0 +Start: 2019-05-30 21:58:33 End: 2019-05-30 21:58:59 Words: 0 +Start: 2019-05-30 21:59:33 End: 2019-05-30 22:00:08 Words: 0 +Start: 2019-05-30 22:00:27 End: 2019-05-30 22:01:18 Words: 0 +Start: 2019-05-30 22:01:35 End: 2019-05-30 22:01:57 Words: 0 +Start: 2019-05-30 22:02:05 End: 2019-05-30 22:02:24 Words: 0 diff --git a/sample/sampleNovel/nwProject.nwx b/sample/sampleNovel/nwProject.nwx index 90e826e8..2437ad48 100644 --- a/sample/sampleNovel/nwProject.nwx +++ b/sample/sampleNovel/nwProject.nwx @@ -1,5 +1,5 @@ - + Sample Project Sample Project @@ -8,7 +8,7 @@ True - 636b6aa9b697b + bb2c23b3c42cc None 558 @@ -76,7 +76,7 @@ 656 121 5 - 105 + 69 New File @@ -126,7 +126,7 @@ 55 9 1 - 71 + 25 Locations