From e912b72382976f5023a563ba04684e2f8373f1c6 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Fri, 17 Nov 2023 11:53:30 +0000 Subject: [PATCH] Minor comment adjustemnts --- src/main.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/main.py b/src/main.py index c5aebb3..7f37aa6 100644 --- a/src/main.py +++ b/src/main.py @@ -3,22 +3,17 @@ import image_processing import os, sys, time -#### -# CURRENT ISSUES -#### -# -# Pixelfed API doesn't honour newlines. - Possibly look at HTML formatting? -# Pixelfed publishing is missing date - Needs parsing and appending to description - - def main(): if len(sys.argv) < 2: - print("Usage: social-photos ") + print("Usage: social-photos ", file=sys.stderr) + sys.exit(1) else: path = sys.argv[1] + + # Check whether path points to a file or a directory. If neither, exit. if not os.path.exists(path): - print(f"'{path}' does not exist.") + print(f"'{path}' does not exist.", file=sys.stderr) sys.exit(1) elif os.path.isfile(path): print(f"'{path}' is a file.") @@ -27,7 +22,7 @@ def main(): print(f"'{path}' is a directory.") files = list_files_in_directory(path) else: - print(f"'{path}' is neither a file nor a directory.") + print(f"'{path}' is neither a file nor a directory.", file=sys.stderr) sys.exit(1) print("These files will be uploaded:")