pytex/PyTeX/build/build/conversions.py

20 lines
878 B
Python

from PyTeX.build.build.enums import PyTeXRootDirType
from PyTeX.build.build.enums 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]