Allow overriding of part of the file-tree
Override some of the templates in one file-tree with that of another file-tree:
new_filetree = filetree.override(user_filetree, required=[...], optional=[...])
This overrides templates in filetree
with values from user_filetree
. They will be added to the filetree
even if they do not exist beforehand.
You should also supply a list of template keys using one of two keywords:
-
required=[...]
: these are keywords are required in theuser_filetree
. If any of these keys are missing fromrequired
an error is raised. -
optional=[...]
: these are keywords that can be overwritten. If they are provided inuser_filetree
, they will be. Otherwise the original values infiletree
will be used.
This can be implemented using the existing add_template
.
Edited by Michiel Cottaar