pytex/PyTeX/format/copy_formatter.py

22 lines
570 B
Python
Raw Normal View History

2022-02-18 11:32:48 +01:00
from .formatting_config import FormattingConfig
from .pytex_formatter import PyTeXFormatter
from pathlib import Path
import shutil
from typing import List, Tuple
class CopyFormatter(PyTeXFormatter):
2022-02-18 16:27:03 +01:00
@property
2022-02-18 11:32:48 +01:00
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 []
2022-02-18 16:27:03 +01:00
@property
2022-02-18 11:32:48 +01:00
def dependencies(self) -> List[str]:
return [] # TODO