1
0

Update to-photoblog script

This commit is contained in:
Noah 2023-04-29 09:51:43 -07:00
parent e46a62adbb
commit bd6651c8bd

View File

@ -26,12 +26,13 @@ def main(args):
if not m: if not m:
print(f"File '{name}' doesn't match usual naming convention. Use --custom to upload custom file names.") print(f"File '{name}' doesn't match usual naming convention. Use --custom to upload custom file names.")
quit() quit()
file_map[name] = f"{m.group(1)}.{m.group(2)}" file_map[name] = f"{m.group(1)}.{m.group(2)}"
print(f"Going to photoblog: {list(file_map.values())}") print(f"Going to photoblog: {list(file_map.values())}")
# Test each file doesn't already exist. # Test each file doesn't already exist.
not_existing = list()
if not args.lazy: if not args.lazy:
print(f"Checking each file isn't already uploaded...") print(f"Checking each file isn't already uploaded...")
problems = False 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") print(f"Warning: file '{name}' already existed at '{test_url}' and won't be uploaded without --lazy")
problems = True problems = True
except: except:
not_existing.append(name)
pass pass
print(f"New files not found on the blog: {not_existing}")
if problems: if problems:
quit() quit()
print("Looks good! Sending to server...") print("Looks good! Sending to server...")
if args.test: if args.test:
print("NOTE: Test run (--test), not actually uploading") print("NOTE: Test run (--test), not actually uploading")
@ -83,4 +87,4 @@ if __name__ == "__main__":
) )
args = parser.parse_args() args = parser.parse_args()
main(args) main(args)