diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2021-08-06 09:43:28 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2021-08-06 09:43:33 +0200 |
commit | ac954b825bf22851fad303e33bd27f76ab70c510 (patch) | |
tree | f07ca599ec7118f666ebab98a2c5c124e7b97ca8 | |
parent | 83ed6b960eafdc4763c6a0aebc691ec2ef3d2db2 (diff) | |
download | epubgrep-ac954b825bf22851fad303e33bd27f76ab70c510.tar.gz |
Make sure title is always assigned in _metadata search
Fixes #1
-rwxr-xr-x | epubgrep.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/epubgrep.py b/epubgrep.py index 718554a..b6c3720 100755 --- a/epubgrep.py +++ b/epubgrep.py @@ -95,6 +95,7 @@ def _metadata_search(mdata: dict, sre: re.Pattern, fname: str, :param: col: should we colorize the output """ out = '' + title = '' decoded_line = mdata.get('description') tags = mdata.get('subject') @@ -104,7 +105,6 @@ def _metadata_search(mdata: dict, sre: re.Pattern, fname: str, title = f'\n{fname}' out += title + '\n' out += _colorize_found(decoded_line, res, col) - title = '' if tags: for tag in tags: res = sre.search(tag) |