read in FormattingConfig correctly

This commit is contained in:
Maximilian Keßler 2022-02-09 19:14:00 +01:00
parent 8a6bfef421
commit e84030978c

View file

@ -53,31 +53,35 @@ class FormattingConfig(Config):
header = filled_content[YAML_HEADER]
extra = header[YAML_EXTRA]
self._include_extra_header = extra[YAML_INCLUDE_EXTRA_HEADER]
self._extra_header = GenericText(
extra[YAML_PATH] if extra[YAML_PATH] else extra[YAML_TEXT]
)
if extra[YAML_PATH] or extra[YAML_TEXT]:
self._extra_header = GenericText(
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]
)
if repo[YAML_PATH] or repo[YAML_TEXT]:
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]
)
if pytex[YAML_PATH] or pytex[YAML_TEXT]:
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]
)
if license_[YAML_PATH] or license_[YAML_TEXT]:
self._license = GenericText(
license_[YAML_PATH] if license_[YAML_PATH] else license_[YAML_TEXT]
)
docstrip = filled_content[YAML_DOCSTRIP]
self._include_drv = docstrip[YAML_INCLUDE_DRV]