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:
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)
main(args)