pytex/PyTeX/format/simple_tex_formatter.py

26 lines
817 B
Python
Raw Normal View History

from .formatting_config import FormattingConfig
2022-02-06 19:40:14 +01:00
from .tex_formatter import TexFormatter
2022-02-08 17:04:16 +01:00
from pathlib import Path
from typing import Optional, List, Tuple, Dict
2022-02-06 19:40:14 +01:00
class SimpleTeXFormatter(TexFormatter):
2022-02-08 17:04:16 +01:00
def open_output_stream(self, build_dir: Path):
out_file = build_dir / self.input_file.with_suffix('').name
if out_file.exists():
raise NotImplementedError
else:
self._output_file = out_file.open()
def close_output_stream(self):
self._output_file.close()
def future_config(self) -> List[Tuple[str, FormattingConfig]]:
return [] # TODO
2022-02-08 17:04:16 +01:00
def dependencies(self) -> List[str]:
2022-02-08 17:40:08 +01:00
return [] # sty / cls file does not depend on anything
2022-02-08 17:04:16 +01:00
def output_files(self) -> List[str]:
return [self.input_file.with_suffix('').name]