2022-02-17 21:31:15 +01:00
|
|
|
import signal
|
|
|
|
import shutil
|
2022-02-05 21:44:52 +01:00
|
|
|
from pathlib import Path
|
2022-02-07 18:36:30 +01:00
|
|
|
from PyTeX.build.build import PyTeXBuilder
|
2022-02-07 18:33:00 +01:00
|
|
|
from PyTeX.build.build.pytex_config import PyTeXConfig
|
2022-02-06 15:11:45 +01:00
|
|
|
from PyTeX.format.formatting_config import FormattingConfig
|
2022-02-05 21:44:52 +01:00
|
|
|
|
2022-02-17 23:01:23 +01:00
|
|
|
if Path('.pytex').exists():
|
|
|
|
shutil.rmtree('.pytex')
|
|
|
|
|
2022-02-17 21:31:15 +01:00
|
|
|
|
|
|
|
def interrupt_handler(signum, frame):
|
|
|
|
if Path('.pytex').exists():
|
|
|
|
shutil.rmtree('.pytex')
|
|
|
|
print('Interrupted execution')
|
|
|
|
quit(1)
|
|
|
|
|
|
|
|
|
|
|
|
signal.signal(signal.SIGINT, interrupt_handler)
|
|
|
|
|
|
|
|
|
2022-02-08 19:01:18 +01:00
|
|
|
conf_path = Path('.pytexrc')
|
2022-02-07 19:00:25 +01:00
|
|
|
|
|
|
|
builder = PyTeXBuilder(conf_path)
|
|
|
|
|
2022-02-07 23:12:17 +01:00
|
|
|
builder.build_tex_sources()
|
|
|
|
|
2022-02-08 19:01:18 +01:00
|
|
|
|
2022-02-07 01:09:05 +01:00
|
|
|
pass
|