From a033b7364017c28ce930c50ffbff09656fa1ebb4 Mon Sep 17 00:00:00 2001 From: Solderpunk Date: Tue, 17 Mar 2020 21:05:03 +0100 Subject: Use directory as default feed title even when not run as a command line tool. --- gemfeed.py | 5 ++--- 1 file 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 -- cgit v1.2.3-54-g00ecf