implement getting pytex files
This commit is contained in:
parent
dd65ab626b
commit
d28205311c
2 changed files with 10 additions and 10 deletions
|
@ -23,11 +23,11 @@ class BuildDirConfig(Config):
|
||||||
def set_from_json(self, content: Optional[Dict]):
|
def set_from_json(self, content: Optional[Dict]):
|
||||||
content = self._fill_keys(content)
|
content = self._fill_keys(content)
|
||||||
|
|
||||||
self._tex_source_root = content[YAML_TEX_SOURCE_ROOT]
|
self._tex_source_root = Path(content[YAML_TEX_SOURCE_ROOT])
|
||||||
self._pytex_source_root = content[YAML_PYTEX_SOURCE_ROOT]
|
self._pytex_source_root = Path(content[YAML_PYTEX_SOURCE_ROOT])
|
||||||
self._build_root = content[YAML_BUILD_ROOT]
|
self._build_root = Path(content[YAML_BUILD_ROOT])
|
||||||
self._doc_root = content[YAML_DOC_ROOT]
|
self._doc_root = Path(content[YAML_DOC_ROOT])
|
||||||
self._wrapper_dir = content[YAML_WRAPPER_DIR]
|
self._wrapper_dir = Path(content[YAML_WRAPPER_DIR])
|
||||||
|
|
||||||
def to_json(self) -> Dict:
|
def to_json(self) -> Dict:
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -16,7 +16,6 @@ class PyTeXBuilder:
|
||||||
pytex_config: Optional[Union[PyTeXConfig, Path, str]] = None,
|
pytex_config: Optional[Union[PyTeXConfig, Path, str]] = None,
|
||||||
root_dir: Optional[Path] = None
|
root_dir: Optional[Path] = None
|
||||||
):
|
):
|
||||||
|
|
||||||
self._build_target_type: Optional[PyTeXRootDirType] = None
|
self._build_target_type: Optional[PyTeXRootDirType] = None
|
||||||
if isinstance(pytex_config, Path) or isinstance(pytex_config, str):
|
if isinstance(pytex_config, Path) or isinstance(pytex_config, str):
|
||||||
config_file = Path(pytex_config)
|
config_file = Path(pytex_config)
|
||||||
|
@ -72,11 +71,12 @@ class PyTeXBuilder:
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def source_root(self) -> Path:
|
def source_root(self) -> Path:
|
||||||
return {
|
switcher = {
|
||||||
PyTeXRootDirType.BUILD: self.pytex_config.build_dir_specification.tex_source_root,
|
PyTeXRootDirType.BUILD: self.pytex_config.build_dir_specification.tex_source_root,
|
||||||
PyTeXRootDirType.DOC: 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,
|
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):
|
def get_git_version_info(self):
|
||||||
pass
|
pass
|
||||||
|
@ -116,8 +116,8 @@ class PyTeXBuilder:
|
||||||
self._pytex_files.append(
|
self._pytex_files.append(
|
||||||
PyTeXSourceFile(
|
PyTeXSourceFile(
|
||||||
relative_path=RelativePath(
|
relative_path=RelativePath(
|
||||||
file,
|
self.source_root,
|
||||||
root_dir=self.source_root
|
file
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue