pytex/main.py

29 lines
571 B
Python

import signal
import shutil
from pathlib import Path
from PyTeX.build.build import PyTeXBuilder
from PyTeX.build.build.pytex_config import PyTeXConfig
from PyTeX.format.formatting_config import FormattingConfig
if Path('.pytex').exists():
shutil.rmtree('.pytex')
def interrupt_handler(signum, frame):
if Path('.pytex').exists():
shutil.rmtree('.pytex')
print('Interrupted execution')
quit(1)
signal.signal(signal.SIGINT, interrupt_handler)
conf_path = Path('.pytexrc')
builder = PyTeXBuilder(conf_path)
builder.build_tex_sources()
pass