Added copy behaviour to config file

This commit is contained in:
Maximilien Rigaut 2022-06-12 21:00:10 +02:00
parent ac9f00f363
commit 84d8fad28f
No known key found for this signature in database
GPG Key ID: 4F14B23709ADA5B1
2 changed files with 4 additions and 3 deletions

View File

@ -21,4 +21,4 @@ export:
intermediate_files: true
type: "html"
force_rewrite: true
unparsable_files: "copy" # "copy" or "ignore"
copy_unparsable_files: "copy" # "copy" or "ignore"

View File

@ -118,8 +118,9 @@ class SiteCrawler:
"""
This method is used to copy all the files that could not be parsed.
"""
for root, file in self.files_to_copy:
shutil.copy(os.path.join(self.initial_path, root, file), os.path.join(self.destination_path, root, file))
if self._env.config["parser_config"]["export"]["copy_unparsable_files"].lower() == "copy":
for root, file in self.files_to_copy:
shutil.copy(os.path.join(self.initial_path, root, file), os.path.join(self.destination_path, root, file))
def create_file(self, path):
"""