From cbd7ac3d1a0158b02d894d2a6391930b525e1ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Mon, 7 Feb 2022 01:15:14 +0100 Subject: [PATCH] finish implementing reading from yaml / json --- PyTeX/format/formatting_config.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/PyTeX/format/formatting_config.py b/PyTeX/format/formatting_config.py index de61a8a..19ff37a 100644 --- a/PyTeX/format/formatting_config.py +++ b/PyTeX/format/formatting_config.py @@ -106,6 +106,33 @@ class FormattingConfig(Config): extra[YAML_PATH] if extra[YAML_PATH] else extra[YAML_TEXT] ) + repo = header[YAML_REPO] + self._include_repo_info_text = repo[YAML_INCLUDE_INFO_TEXT] + self._include_repo_version = repo[YAML_INCLUDE_VERSION] + self._repo_info_text = GenericText( + repo[YAML_PATH] if repo[YAML_PATH] else repo[YAML_TEXT] + ) + + pytex = header[YAML_PYTEX] + self._include_pytex_info_text = pytex[YAML_INCLUDE_INFO_TEXT] + self._include_pytex_version = pytex[YAML_INCLUDE_VERSION] + self._pytex_info_text = GenericText( + pytex[YAML_PATH] if pytex[YAML_PATH] else pytex[YAML_TEXT] + ) + + self._include_time = header[YAML_INCLUDE_TIME] + + license = header[YAML_LICENSE] + self._include_license = license[YAML_INCLUDE_LICENSE] + self._license = GenericText( + license[YAML_PATH] if license[YAML_PATH] else license[YAML_TEXT] + ) + + docstrip = content[YAML_DOCSTRIP] + self._include_drv = docstrip[YAML_INCLUDE_DRV] + self._include_ins = docstrip[YAML_INCLUDE_INS] + self._docstrip_guards = docstrip[YAML_DOCSTRIP_GUARDS] + @classmethod def from_yaml(cls, content: Path): with open(content, 'r') as config: