From 3491cc784378895795d2a48ffa110408ce283ffa Mon Sep 17 00:00:00 2001 From: endorphant Date: Wed, 4 May 2016 20:22:14 -0400 Subject: [PATCH] fixing more eject bugs --- bin/ttbp.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/bin/ttbp.py b/bin/ttbp.py index 88e820c..bb04e2f 100644 --- a/bin/ttbp.py +++ b/bin/ttbp.py @@ -382,12 +382,15 @@ def view_feed(): entryDir = os.path.join("/home", townie, ".ttbp", "entries") filenames = os.listdir(entryDir) for entry in filenames: - feedList.append(os.path.join(entryDir, entry)) - + ### REALLY MAKE A REAL FILENAME VALIDATOR + fileSplit = os.path.splitext(entry) + if len(fileSplit[0]) == 8 and fileSplit[1] == ".txt": + feedList.append(os.path.join(entryDir, entry)) + metas = core.meta(feedList) metas.sort(key = lambda entry:entry[3]) metas.reverse() - + entries = [] for entry in metas[0:10]: pad = "" @@ -421,7 +424,10 @@ def list_select(options, prompt): invalid = True while invalid: - choice = raw_input("\n\n"+prompt) + try: + choice = raw_input("\n\n"+prompt) + except KeyboardInterrupt: + list_select(options, prompt) try: ans = int(choice)