Browse Source

Fix generation of output

master
Marien Fressinaud 6 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



def generate_output_dir(): def generate_output_dir():
output_path = os.path.join(os.curdir, OUTPUT_DIR_NAME) output_path = os.path.join(os.curdir, OUTPUT_DIR_NAME)
shutil.rmtree(output_path)
if not os.path.isdir(output_path): if not os.path.isdir(output_path):
os.mkdir(output_path) os.mkdir(output_path)
return output_path return output_path
def generate_style(output_path): def generate_style(output_path):
style_path = os.path.join(os.curdir, THEME, "style") style_path = os.path.join(os.curdir, THEME, "style")
style_output_path = os.path.join(output_path, "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) shutil.copytree(style_path, style_output_path)






def generate_gallery_dir(output_path, gallery): def generate_gallery_dir(output_path, gallery):
gallery_output_path = os.path.join(output_path, gallery["name"]) 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) os.mkdir(gallery_output_path)


for photo in gallery["photos"]: for photo in gallery["photos"]:

Loading…
Cancel
Save