add copy formatter

This commit is contained in:
Maximilian Keßler 2022-02-18 11:32:48 +01:00
parent 4c8d144e32
commit 958ecb140f

View file

@ -0,0 +1,18 @@
from .formatting_config import FormattingConfig
from .pytex_formatter import PyTeXFormatter
from pathlib import Path
import shutil
from typing import List, Tuple
class CopyFormatter(PyTeXFormatter):
def output_files(self) -> List[str]:
return [self.input_file.name]
def format(self, build_dir: Path, overwrite: bool = False) -> List[Tuple[str, FormattingConfig]]:
shutil.copy(self.input_file, build_dir / self.input_file.name)
return []
def dependencies(self) -> List[str]:
return [] # TODO