fix some simple bugs
This commit is contained in:
parent
b168b4f7fc
commit
d41ecb2398
4 changed files with 15 additions and 7 deletions
|
@ -44,12 +44,12 @@ def formatter_from_file_extension(
|
||||||
'dict.pytex': DictFormatter
|
'dict.pytex': DictFormatter
|
||||||
}
|
}
|
||||||
tex_formatter_switcher = {
|
tex_formatter_switcher = {
|
||||||
'.ins': NothingFormatter,
|
'ins': NothingFormatter,
|
||||||
'.drv': NothingFormatter,
|
'drv': NothingFormatter,
|
||||||
'.dtx': DocStripFormatter,
|
'dtx': DocStripFormatter,
|
||||||
'.dict': CopyFormatter,
|
'dict': CopyFormatter,
|
||||||
'.cls': CopyFormatter,
|
'cls': CopyFormatter,
|
||||||
'.sty': CopyFormatter,
|
'sty': CopyFormatter,
|
||||||
}
|
}
|
||||||
documentation_formatter_switcher = {
|
documentation_formatter_switcher = {
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,8 @@ from typing import List, Tuple
|
||||||
|
|
||||||
|
|
||||||
class CopyFormatter(PyTeXFormatter):
|
class CopyFormatter(PyTeXFormatter):
|
||||||
|
|
||||||
|
@property
|
||||||
def output_files(self) -> List[str]:
|
def output_files(self) -> List[str]:
|
||||||
return [self.input_file.name]
|
return [self.input_file.name]
|
||||||
|
|
||||||
|
@ -14,5 +16,6 @@ class CopyFormatter(PyTeXFormatter):
|
||||||
shutil.copy(self.input_file, build_dir / self.input_file.name)
|
shutil.copy(self.input_file, build_dir / self.input_file.name)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
@property
|
||||||
def dependencies(self) -> List[str]:
|
def dependencies(self) -> List[str]:
|
||||||
return [] # TODO
|
return [] # TODO
|
||||||
|
|
|
@ -11,6 +11,8 @@ from typing import List, Tuple
|
||||||
|
|
||||||
|
|
||||||
class DocStripFormatter(PyTeXFormatter):
|
class DocStripFormatter(PyTeXFormatter):
|
||||||
|
|
||||||
|
@property
|
||||||
def output_files(self) -> List[str]:
|
def output_files(self) -> List[str]:
|
||||||
if self.config.tex_out_type == TeXType.TeXClass:
|
if self.config.tex_out_type == TeXType.TeXClass:
|
||||||
return self.name + '.cls'
|
return self.name + '.cls'
|
||||||
|
@ -41,7 +43,7 @@ class DocStripFormatter(PyTeXFormatter):
|
||||||
)
|
)
|
||||||
if not result.returncode == 0:
|
if not result.returncode == 0:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
for file in self.output_files():
|
for file in self.output_files:
|
||||||
outfile = tmp_dir / file
|
outfile = tmp_dir / file
|
||||||
if not outfile.exists():
|
if not outfile.exists():
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
@ -49,5 +51,6 @@ class DocStripFormatter(PyTeXFormatter):
|
||||||
shutil.rmtree(tmp_dir)
|
shutil.rmtree(tmp_dir)
|
||||||
return [] # No future config
|
return [] # No future config
|
||||||
|
|
||||||
|
@property
|
||||||
def dependencies(self) -> List[str]:
|
def dependencies(self) -> List[str]:
|
||||||
return [] # TODO
|
return [] # TODO
|
||||||
|
|
2
main.py
2
main.py
|
@ -25,5 +25,7 @@ builder = PyTeXBuilder(conf_path)
|
||||||
|
|
||||||
builder.build_tex_sources()
|
builder.build_tex_sources()
|
||||||
|
|
||||||
|
builder.build_tex_files()
|
||||||
|
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in a new issue