implement getting pytex files

This commit is contained in:
Maximilian Keßler 2022-02-07 23:33:32 +01:00
parent dd65ab626b
commit d28205311c
2 changed files with 10 additions and 10 deletions

View file

@ -23,11 +23,11 @@ class BuildDirConfig(Config):
def set_from_json(self, content: Optional[Dict]):
content = self._fill_keys(content)
self._tex_source_root = content[YAML_TEX_SOURCE_ROOT]
self._pytex_source_root = content[YAML_PYTEX_SOURCE_ROOT]
self._build_root = content[YAML_BUILD_ROOT]
self._doc_root = content[YAML_DOC_ROOT]
self._wrapper_dir = content[YAML_WRAPPER_DIR]
self._tex_source_root = Path(content[YAML_TEX_SOURCE_ROOT])
self._pytex_source_root = Path(content[YAML_PYTEX_SOURCE_ROOT])
self._build_root = Path(content[YAML_BUILD_ROOT])
self._doc_root = Path(content[YAML_DOC_ROOT])
self._wrapper_dir = Path(content[YAML_WRAPPER_DIR])
def to_json(self) -> Dict:
return {

View file

@ -16,7 +16,6 @@ class PyTeXBuilder:
pytex_config: Optional[Union[PyTeXConfig, Path, str]] = None,
root_dir: Optional[Path] = None
):
self._build_target_type: Optional[PyTeXRootDirType] = None
if isinstance(pytex_config, Path) or isinstance(pytex_config, str):
config_file = Path(pytex_config)
@ -72,11 +71,12 @@ class PyTeXBuilder:
@property
def source_root(self) -> Path:
return {
switcher = {
PyTeXRootDirType.BUILD: self.pytex_config.build_dir_specification.tex_source_root,
PyTeXRootDirType.DOC: self.pytex_config.build_dir_specification.tex_source_root,
PyTeXRootDirType.TEX_SOURCE: self.pytex_config.build_dir_specification.pytex_source_root,
}[self._build_target_type]
}
return switcher[self._build_target_type]
def get_git_version_info(self):
pass
@ -116,8 +116,8 @@ class PyTeXBuilder:
self._pytex_files.append(
PyTeXSourceFile(
relative_path=RelativePath(
file,
root_dir=self.source_root
self.source_root,
file
)
)
)