|
|
|
@ -308,10 +308,11 @@ class TemplateWrapper:
|
|
|
|
|
|
|
|
|
|
self._check_user_changes()
|
|
|
|
|
|
|
|
|
|
if self.target_type is not None and self.contents_matching:
|
|
|
|
|
# Удаляем целевой файл, если append = 'replace'
|
|
|
|
|
if self.parameters.append and self.parameters.append == "replace":
|
|
|
|
|
self.remove_original = True
|
|
|
|
|
# if self.target_type is not None and self.contents_matching:
|
|
|
|
|
# # Удаляем целевой файл, если append = 'replace'
|
|
|
|
|
# if (self.parameters.append and
|
|
|
|
|
# self.parameters.append == "replace"):
|
|
|
|
|
# self.remove_original = True
|
|
|
|
|
|
|
|
|
|
def _check_type_conflicts(self) -> NoReturn:
|
|
|
|
|
'''Метод для проверки конфликтов типов.'''
|
|
|
|
@ -1034,6 +1035,8 @@ class TemplateExecutor:
|
|
|
|
|
# Если шаблон пуст, параметром source задан входной файл,
|
|
|
|
|
# и при этом формат шаблона raw и append = 'replace'
|
|
|
|
|
# значит этот шаблон предназначен для копирования.
|
|
|
|
|
if template_object.target_type is not None:
|
|
|
|
|
self._remove_file(template_object.target_path)
|
|
|
|
|
output_file_md5 = self._copy_from_source(template_object,
|
|
|
|
|
chown=chown,
|
|
|
|
|
chmod=chmod)
|
|
|
|
@ -1049,6 +1052,9 @@ class TemplateExecutor:
|
|
|
|
|
|
|
|
|
|
input_text = self._get_input_text(template_object,
|
|
|
|
|
replace=replace)
|
|
|
|
|
if (replace and template_object.target_type is not None and
|
|
|
|
|
os.path.exists(output_path)):
|
|
|
|
|
self._clear_file(output_path)
|
|
|
|
|
|
|
|
|
|
# Если шаблон не исполнительный разбираем входной текст.
|
|
|
|
|
parsed_input = template_format(
|
|
|
|
|