summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolderpunk <solderpunk@sdf.org>2020-03-17 21:05:03 +0100
committerSolderpunk <solderpunk@sdf.org>2020-03-17 21:05:03 +0100
commita033b7364017c28ce930c50ffbff09656fa1ebb4 (patch)
tree34a0fdddbcae06627a80c4ce3ca67f7d051a84b6
parent835a7a0ac8dc469968f77a28ea53d50d01224950 (diff)
Use directory as default feed title even when not run as a command line tool.
-rw-r--r--gemfeed.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/gemfeed.py b/gemfeed.py
index 15ef166..b5b1d52 100644
--- a/gemfeed.py
+++ b/gemfeed.py
@@ -35,12 +35,11 @@ def get_feed_title(directory):
the content of the first heading line in the file, otherwise return a
default feed title.
"""
- default = "Just another Gemini feed"
for index_file in ("index.gmi", "index.gemini"):
index_file = os.path.join(directory, index_file)
if os.path.exists(index_file) and is_world_readable(index_file):
return extract_first_heading(index_file, default)
- return default
+ return os.path.basename(directory)
def find_files(directory, n=10):
"""
@@ -168,7 +167,7 @@ def main():
parser.add_argument('-s', '--subtitle', dest='subtitle', type=str,
help='feed subtitle')
parser.add_argument('-t', '--title', dest='title', type=str,
- default=os.path.basename(cwd), help='feed title')
+ help='feed title')
args = parser.parse_args()
# Normalise base URL