pytex/PyTeX/build/utils/conversions.py

21 lines
871 B
Python
Raw Normal View History

from PyTeX.build.paths import PyTeXRootDirType
2022-02-04 21:15:36 +01:00
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]