Skip to content

Commit

Permalink
minor change in _entryFromRaw
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Dec 6, 2024
1 parent bcf4e11 commit 41a075a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pyglossary/glossary_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,18 @@ def _entryToRaw(self, entry: EntryType) -> RawEntryType:
def _entryFromRaw(self, rawEntry: RawEntryType) -> EntryType:
defiFormat = rawEntry[0].decode("ascii") or self._defaultDefiFormat
defi = rawEntry[1].decode("utf-8")
word = [b.decode("utf-8") for b in rawEntry[2:]]

if defiFormat == "b":
fname = word
fname = rawEntry[2].decode("utf-8")
if isinstance(fname, list):
fname = fname[0] # NESTED 4
return DataEntry(fname, tmpPath=defi) # pyright: ignore[reportReturnType]

return Entry(word, defi, defiFormat=defiFormat) # pyright: ignore[reportReturnType]
return Entry(
[b.decode("utf-8") for b in rawEntry[2:]],
defi,
defiFormat=defiFormat,
) # pyright: ignore[reportReturnType]

@property
def rawEntryCompress(self) -> bool:
Expand Down

0 comments on commit 41a075a

Please sign in to comment.