89 lines
1.8 KiB
Python
89 lines
1.8 KiB
Python
#!/usr/bin/env python
|
|
# encoding: utf-8
|
|
|
|
|
|
import click
|
|
from .bopytex import produce_and_compile
|
|
|
|
@click.command()
|
|
@click.argument(
|
|
"template",
|
|
type=click.Path(exists=True),
|
|
nargs=1,
|
|
# help="File with the template. The name should have the following form tpl_... .",
|
|
)
|
|
@click.option(
|
|
"-w",
|
|
"--working-dir",
|
|
type=click.Path(exists=True),
|
|
help="Where fed templates and compiled files will be placed",
|
|
)
|
|
@click.option(
|
|
"-s",
|
|
"--students-csv",
|
|
type=str,
|
|
default="",
|
|
help="CSV containing list of students names",
|
|
)
|
|
@click.option(
|
|
"-d", "--dirty", is_flag=True, default=False, help="Do not clean after compilation",
|
|
)
|
|
@click.option(
|
|
"-n",
|
|
"--no-compile",
|
|
is_flag=True,
|
|
default=False,
|
|
help="Do not compile source code",
|
|
)
|
|
@click.option(
|
|
"-N",
|
|
"--number_subjects",
|
|
type=int,
|
|
default=1,
|
|
help="The number of subjects to make",
|
|
)
|
|
@click.option(
|
|
"-j",
|
|
"--no-join",
|
|
is_flag=True,
|
|
default=False,
|
|
help="Do not join pdfs to a single pdf and remove individuals",
|
|
)
|
|
@click.option(
|
|
"-O",
|
|
"--only-corr",
|
|
is_flag=True,
|
|
default=False,
|
|
help="Create and compile only correction from existing subjects",
|
|
)
|
|
@click.option(
|
|
"-c",
|
|
"--corr",
|
|
is_flag=True,
|
|
default=False,
|
|
help="Create and compile correction while making subjects",
|
|
)
|
|
@click.option(
|
|
"-C",
|
|
"--crazy",
|
|
is_flag=True,
|
|
default=False,
|
|
help="Crazy mode. Tries and tries again until template feeding success!",
|
|
)
|
|
def new(**options):
|
|
""" Bopytex
|
|
|
|
Feed the template (tpl_...) and then compile it with latex.
|
|
|
|
"""
|
|
produce_and_compile(options)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
new()
|
|
|
|
# -----------------------------
|
|
# Reglages pour 'vim'
|
|
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
|
|
# cursor: 16 del
|