update config
This commit is contained in:
parent
c6b9bb6a77
commit
81de8ae3f9
3 changed files with 23 additions and 10 deletions
|
@ -0,0 +1,2 @@
|
|||
from .formatting_config import BasicFormattingConfig
|
||||
from .global_config import GlobalPyTeXConfig
|
|
@ -21,14 +21,6 @@ class BasicFormattingConfig:
|
|||
self._use_docstrip_guards: Optional[List[str]] = None
|
||||
|
||||
|
||||
class PyTeXFormattingConfig(BasicFormattingConfig):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self._available_docstrip_guards: Optional[List[str]] = None
|
||||
self._doc_dependencies: Optional[List[str]] = None
|
||||
self._tex_dependencies: Optional[List[str]] = None
|
||||
|
||||
|
||||
class DocFormattingConfig:
|
||||
def __init__(self):
|
||||
self._documents: Optional[List[str]] = None
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from pathlib import Path
|
||||
from pathlib import Path, PurePath
|
||||
from typing import Optional
|
||||
from .formatting_config import BasicFormattingConfig
|
||||
|
||||
|
@ -8,7 +8,7 @@ class GlobalPyTeXConfig:
|
|||
_build_root: Optional[Path] = None
|
||||
_doc_root: Optional[Path] = None
|
||||
_tex_root: Optional[Path] = None
|
||||
_wrapper_dir: Optional[Path] = None
|
||||
_wrapper_dir: Optional[PurePath] = None
|
||||
|
||||
_default_formatting_config: Optional[BasicFormattingConfig] = None
|
||||
|
||||
|
@ -18,6 +18,21 @@ class GlobalPyTeXConfig:
|
|||
|
||||
_allow_dirty: bool = False
|
||||
|
||||
@classmethod
|
||||
def init(
|
||||
cls,
|
||||
source_root: Optional[Path] = None,
|
||||
build_root: Optional[Path] = None,
|
||||
doc_root: Optional[Path] = None,
|
||||
tex_root: Optional[Path] = None,
|
||||
wrapper_dir: Optional[PurePath] = None
|
||||
):
|
||||
cls._source_root = source_root
|
||||
cls._build_root = build_root
|
||||
cls._doc_root = doc_root
|
||||
cls._tex_root = tex_root
|
||||
cls._wrapper_dir = wrapper_dir
|
||||
|
||||
@classmethod
|
||||
def build_root(cls) -> Path:
|
||||
return cls._build_root
|
||||
|
@ -33,3 +48,7 @@ class GlobalPyTeXConfig:
|
|||
@classmethod
|
||||
def tex_root(cls) -> Path:
|
||||
return cls._tex_root
|
||||
|
||||
@classmethod
|
||||
def wrapper_dir(cls) -> PurePath:
|
||||
return cls._wrapper_dir
|
||||
|
|
Loading…
Reference in a new issue