|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def main(): |
|
|
def main(): |
|
|
|
|
|
print("Loading galleries... ", end="") |
|
|
pictures_folder = os.path.join(os.curdir, PICTURES_DIR_NAME) |
|
|
pictures_folder = os.path.join(os.curdir, PICTURES_DIR_NAME) |
|
|
galleries = list(list_galleries_in(pictures_folder)) |
|
|
galleries = list(list_galleries_in(pictures_folder)) |
|
|
if len(galleries) == 0: |
|
|
if len(galleries) == 0: |
|
|
return |
|
|
return |
|
|
|
|
|
|
|
|
galleries.sort(key=itemgetter("name")) |
|
|
galleries.sort(key=itemgetter("name")) |
|
|
|
|
|
print(f"{len(galleries)} galleries found.") |
|
|
|
|
|
|
|
|
|
|
|
print("Generating output folder... ", end="") |
|
|
output_path = generate_output_dir() |
|
|
output_path = generate_output_dir() |
|
|
|
|
|
print("✔️") |
|
|
|
|
|
print("Generating style folder... ", end="") |
|
|
generate_style(output_path) |
|
|
generate_style(output_path) |
|
|
|
|
|
print("✔️") |
|
|
|
|
|
print("Generating index file... ", end="") |
|
|
generate_index(output_path, galleries) |
|
|
generate_index(output_path, galleries) |
|
|
|
|
|
print("✔️") |
|
|
for gallery in galleries: |
|
|
for gallery in galleries: |
|
|
|
|
|
print(f"Generating {gallery['name']} gallery... ", end="") |
|
|
generate_gallery(output_path, gallery) |
|
|
generate_gallery(output_path, gallery) |
|
|
|
|
|
print("✔️") |
|
|
|
|
|
print("Galleries generated 🎉") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
if __name__ == "__main__": |