add description attribute to formatting config

This commit is contained in:
Maximilian Keßler 2022-02-06 16:52:24 +01:00
parent 6a09adac85
commit a5a3ec0dfa
2 changed files with 16 additions and 4 deletions

View file

@ -9,6 +9,7 @@ class FormattingConfig(Config):
def __init__(self):
self._naming_scheme: Optional[Union[NamingScheme, str]] = None
self._license: Optional[List[License]] = None
self._description: Optional[str] = None
self._include_extra_header: Optional[bool] = None
self._include_build_time: Optional[bool] = None
@ -195,6 +196,13 @@ class FormattingConfig(Config):
else:
return self._escape_character
@property
def description(self) -> str:
if self._description is None:
return ''
else:
return self._description
class DocFormattingConfig:
def __init__(self):

View file

@ -116,7 +116,11 @@ class PyTeXFormatter(FormatterIF):
return self._header
def format_header(self, **kwargs) -> None:
self._header = self.header.format(
**kwargs
) # TODO: add standard keywords here
def format_header(self, **kwargs) -> str:
return '\n'.join(
[
'%'*80,
self.header.format(**kwargs), # TODO: add standard keywords here
'%'*80
]
)