summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolderpunk <solderpunk@sdf.org>2020-03-17 15:12:11 +0100
committerSolderpunk <solderpunk@sdf.org>2020-03-17 15:12:11 +0100
commitcb2bca2edbb9692cf530847e95d6f35e2f78b6b2 (patch)
treee58d5ea8b9134921658a3ec19027f8d52578ec55
parent63365f07426d618791a54ce879bcb4163da2e814 (diff)
Remove support for .gem extension, as the Best Practices document mentions only .gmi and .gemini.
-rw-r--r--gemfeed.py9
1 files 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: