add copy formatter
This commit is contained in:
parent
4c8d144e32
commit
958ecb140f
1 changed files with 18 additions and 0 deletions
18
PyTeX/format/copy_formatter.py
Normal file
18
PyTeX/format/copy_formatter.py
Normal 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
|
Loading…
Reference in a new issue