Browse Source

Remove use of distutils

pull/403/head
Simon Conseil 6 years ago
parent
commit
3d56d8636c
  1. 7
      sigal/writer.py

7
sigal/writer.py

@ -23,9 +23,9 @@
import importlib
import logging
import os
import shutil
import sys
import types
from distutils.dir_util import copy_tree
import jinja2
from jinja2 import ChoiceLoader, Environment, FileSystemLoader, PrefixLoader
@ -95,7 +95,10 @@ class AbstractWriter:
# Copy the theme files in the output dir
self.theme_path = os.path.join(self.output_dir, 'static')
copy_tree(os.path.join(self.theme, 'static'), self.theme_path)
if os.path.isdir(self.theme_path):
shutil.rmtree(self.theme_path)
# FIXME: use dirs_exist_ok when minimum Python is 3.8
shutil.copytree(os.path.join(self.theme, 'static'), self.theme_path)
def generate_context(self, album):
"""Generate the context dict for the given path."""

Loading…
Cancel
Save