|
|
|
|
|
|
|
|
|
|
|
|
|
|
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"]: |