From bd6651c8bd373b853b0bd7f0427f990d7f22f63e Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Sat, 29 Apr 2023 09:51:43 -0700 Subject: [PATCH] Update to-photoblog script --- home/bin/to-photoblog | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/home/bin/to-photoblog b/home/bin/to-photoblog index 8993515..a05f5c4 100755 --- a/home/bin/to-photoblog +++ b/home/bin/to-photoblog @@ -26,12 +26,13 @@ def main(args): if not m: print(f"File '{name}' doesn't match usual naming convention. Use --custom to upload custom file names.") quit() - + file_map[name] = f"{m.group(1)}.{m.group(2)}" - + print(f"Going to photoblog: {list(file_map.values())}") # Test each file doesn't already exist. + not_existing = list() if not args.lazy: print(f"Checking each file isn't already uploaded...") problems = False @@ -46,11 +47,14 @@ def main(args): print(f"Warning: file '{name}' already existed at '{test_url}' and won't be uploaded without --lazy") problems = True except: + not_existing.append(name) pass - + + print(f"New files not found on the blog: {not_existing}") + if problems: quit() - + print("Looks good! Sending to server...") if args.test: print("NOTE: Test run (--test), not actually uploading") @@ -83,4 +87,4 @@ if __name__ == "__main__": ) args = parser.parse_args() - main(args) \ No newline at end of file + main(args)