From 0dbeffe0a854f8d5d3336b2ca595cd22c046ff7d Mon Sep 17 00:00:00 2001 From: magical Date: Sun, 14 Feb 2021 22:22:06 +0000 Subject: [PATCH] filter out bogus entries from user feels lists Before: > your recorded feels, listed by date: [ 0 ] 2021-01-31 (1 word) (nopub) [ 1 ] .202-10-214.txt (3 words) [ 2 ] .202-10-131.txt (1 word) ( page 1 of 1; type 'u' or 'd' to scroll up and down) pick an entry from the list, or type 'q' to go back: After: > your recorded feels, listed by date: [ 0 ] 2021-01-31 (1 word) (nopub) ( page 1 of 1; type 'u' or 'd' to scroll up and down) pick an entry from the list, or type 'q' to go back: --- ttbp/ttbp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ttbp/ttbp.py b/ttbp/ttbp.py index 7df3f6e..8e7fd1d 100644 --- a/ttbp/ttbp.py +++ b/ttbp/ttbp.py @@ -854,7 +854,8 @@ def generate_feels_list(user): entryDir = os.path.join("/home", user, ".ttbp", "entries") for entry in os.listdir(entryDir): - filenames.append(os.path.join(entryDir, entry)) + if core.valid(entry): + filenames.append(os.path.join(entryDir, entry)) metas = core.meta(filenames) metas.sort(key = lambda entry:entry[4]) metas.reverse()