Browse Source

Fix generation of output

master
Marien Fressinaud 5 years ago
parent
commit
b29c985a39
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      boop.py

+ 3
- 2
boop.py View File

@@ -52,7 +52,6 @@ def list_photos_in(gallery_dir):

def generate_output_dir():
output_path = os.path.join(os.curdir, OUTPUT_DIR_NAME)
shutil.rmtree(output_path)
if not os.path.isdir(output_path):
os.mkdir(output_path)
return output_path
@@ -61,6 +60,8 @@ def generate_output_dir():
def generate_style(output_path):
style_path = os.path.join(os.curdir, THEME, "style")
style_output_path = os.path.join(output_path, "style")
if os.path.isdir(style_output_path):
shutil.rmtree(style_output_path)
shutil.copytree(style_path, style_output_path)


@@ -101,7 +102,7 @@ def generate_gallery_index(output_path, gallery):

def generate_gallery_dir(output_path, gallery):
gallery_output_path = os.path.join(output_path, gallery["name"])
if os.path.isdir(gallery_output_path):
if not os.path.isdir(gallery_output_path):
os.mkdir(gallery_output_path)

for photo in gallery["photos"]:

Loading…
Cancel
Save