conversions of type

This commit is contained in:
Maximilian Keßler 2022-02-04 21:15:36 +01:00
parent 81de8ae3f9
commit 6d158ebea9
2 changed files with 20 additions and 0 deletions

0
PyTeX/utils/__init__.py Normal file
View file

View file

@ -0,0 +1,20 @@
from PyTeX.paths import PyTeXRootDirType
from PyTeX.build.pytex_file import PyTeXFileType
def pytex_file_type2pytex_root_dir(pytex_file_type: PyTeXFileType) -> PyTeXRootDirType:
return {
PyTeXFileType.PyTeXSourceFile: PyTeXRootDirType.PYTEX_SOURCE,
PyTeXFileType.TeXOutputFile: PyTeXRootDirType.BUILD,
PyTeXFileType.TeXDocumentationFile: PyTeXRootDirType.DOC,
PyTeXFileType.TeXSourceFile: PyTeXRootDirType.TEX_SOURCE
}[pytex_file_type]
def pytex_root_dir2pytex_file_type(pytex_root_dir: PyTeXRootDirType) -> PyTeXFileType:
return {
PyTeXRootDirType.PYTEX_SOURCE: PyTeXFileType.PyTeXSourceFile,
PyTeXRootDirType.BUILD: PyTeXFileType.TeXOutputFile,
PyTeXRootDirType.DOC: PyTeXFileType.TeXDocumentationFile,
PyTeXRootDirType.TEX_SOURCE: PyTeXFileType.TeXSourceFile,
}[pytex_root_dir]