2022-02-04 11:39:15 +01:00
|
|
|
from typing import List, Optional, Union
|
|
|
|
from .enums import NamingScheme, License
|
2022-02-05 22:40:10 +01:00
|
|
|
from .generic_text import GenericText
|
2022-02-04 11:39:15 +01:00
|
|
|
|
|
|
|
|
2022-02-05 19:36:42 +01:00
|
|
|
class FormattingConfig:
|
2022-02-04 11:39:15 +01:00
|
|
|
def __init__(self):
|
2022-02-05 19:36:42 +01:00
|
|
|
self._naming_scheme: Union[NamingScheme, str] = NamingScheme.clean
|
2022-02-04 11:39:15 +01:00
|
|
|
self._license: Optional[List[License]] = None
|
|
|
|
|
|
|
|
self._extra_header: List[str] = []
|
|
|
|
self._include_extra_header: bool = True
|
|
|
|
self._include_build_time: bool = False
|
|
|
|
self._include_pytex_version: bool = False
|
|
|
|
self._include_pytex_info_text: bool = False
|
|
|
|
self._include_repo_version: bool = False
|
|
|
|
self._include_repo_info_text: bool = False
|
|
|
|
|
|
|
|
self._include_drv: bool = True
|
|
|
|
self._include_ins: bool = True
|
2022-02-04 11:46:06 +01:00
|
|
|
self._use_docstrip_guards: Optional[List[str]] = None
|
2022-02-04 11:39:15 +01:00
|
|
|
|
2022-02-05 22:40:10 +01:00
|
|
|
self._author: Optional[str] = None
|
|
|
|
self._licenses = Optional[List[GenericText]]
|
|
|
|
self._extra_header_file: Optional[GenericText] = None
|
|
|
|
self._pytex_version: Optional[str] = None
|
|
|
|
self._pytex_info_text: Optional[GenericText] = None
|
|
|
|
self._repo_version: Optional[str] = None
|
|
|
|
self._repo_info_text: Optional[GenericText] = None
|
|
|
|
|
|
|
|
def merge_with(self, other):
|
|
|
|
"""
|
|
|
|
Merges the other config into this one
|
|
|
|
:param other:
|
|
|
|
:return: self
|
|
|
|
"""
|
|
|
|
return self
|
|
|
|
|
2022-02-04 11:39:15 +01:00
|
|
|
|
2022-02-04 11:46:06 +01:00
|
|
|
class DocFormattingConfig:
|
2022-02-04 11:39:15 +01:00
|
|
|
def __init__(self):
|
|
|
|
self._documents: Optional[List[str]] = None
|
|
|
|
self._dependencies: Optional[List[str]] = None
|