fix some simple bugs

This commit is contained in:
Maximilian Keßler 2022-02-18 16:27:03 +01:00
parent b168b4f7fc
commit d41ecb2398
4 changed files with 15 additions and 7 deletions

View file

@ -44,12 +44,12 @@ def formatter_from_file_extension(
'dict.pytex': DictFormatter
}
tex_formatter_switcher = {
'.ins': NothingFormatter,
'.drv': NothingFormatter,
'.dtx': DocStripFormatter,
'.dict': CopyFormatter,
'.cls': CopyFormatter,
'.sty': CopyFormatter,
'ins': NothingFormatter,
'drv': NothingFormatter,
'dtx': DocStripFormatter,
'dict': CopyFormatter,
'cls': CopyFormatter,
'sty': CopyFormatter,
}
documentation_formatter_switcher = {

View file

@ -7,6 +7,8 @@ from typing import List, Tuple
class CopyFormatter(PyTeXFormatter):
@property
def output_files(self) -> List[str]:
return [self.input_file.name]
@ -14,5 +16,6 @@ class CopyFormatter(PyTeXFormatter):
shutil.copy(self.input_file, build_dir / self.input_file.name)
return []
@property
def dependencies(self) -> List[str]:
return [] # TODO

View file

@ -11,6 +11,8 @@ from typing import List, Tuple
class DocStripFormatter(PyTeXFormatter):
@property
def output_files(self) -> List[str]:
if self.config.tex_out_type == TeXType.TeXClass:
return self.name + '.cls'
@ -41,7 +43,7 @@ class DocStripFormatter(PyTeXFormatter):
)
if not result.returncode == 0:
raise NotImplementedError
for file in self.output_files():
for file in self.output_files:
outfile = tmp_dir / file
if not outfile.exists():
raise NotImplementedError
@ -49,5 +51,6 @@ class DocStripFormatter(PyTeXFormatter):
shutil.rmtree(tmp_dir)
return [] # No future config
@property
def dependencies(self) -> List[str]:
return [] # TODO

View file

@ -25,5 +25,7 @@ builder = PyTeXBuilder(conf_path)
builder.build_tex_sources()
builder.build_tex_files()
pass