From cb2bca2edbb9692cf530847e95d6f35e2f78b6b2 Mon Sep 17 00:00:00 2001 From: Solderpunk Date: Tue, 17 Mar 2020 15:12:11 +0100 Subject: Remove support for .gem extension, as the Best Practices document mentions only .gmi and .gemini. --- gemfeed.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gemfeed.py b/gemfeed.py index 04b9217..39dd8ad 100644 --- a/gemfeed.py +++ b/gemfeed.py @@ -14,15 +14,14 @@ def is_world_readable(filename): def get_feed_title(): default = "Just another Gemini feed" - for extension in ("gmi", "gem", "gemini"): - filename = "index.{}".format(extension) - if os.path.exists(filename) and is_world_readable(filename): - return extract_first_heading(filename, default) + for index_file in ("index.gmi", "index.gemini"): + if os.path.exists(index_file) and is_world_readable(index_file): + return extract_first_heading(index_file, default) return default def find_files(n=10): files = [] - for extension in ("gmi", "gem", "gemini"): + for extension in ("gmi", "gemini"): files.extend(glob.glob("*.{}".format(extension))) index = "index.{}".format(extension) if index in files: -- cgit v1.2.3-54-g00ecf