repytex/notes_tools/generate_bilan/__main__.py
Benjamin Bertrand 5e096c6aa6 reorga files
2016-11-13 18:54:11 +03:00

60 lines
1.5 KiB
Python

#!/usr/bin/env python
# encoding: utf-8
from .generate_bilan import generate_bilan
import optparse
import os
from path import Path
# Defaults settings
default_template = "tpl_bilan.tex"
def main():
parser = optparse.OptionParser()
parser.add_option("-c",
"--classe",
action="store",
type="string",
dest="classe",
help="The classe")
parser.add_option("-e",
"--evaluation",
action="store",
type="string",
dest="ds_name",
help="The evaluation name.")
parser.add_option("-p",
"--path",
action="store",
type="string",
dest="path",
default=Path("./"),
help="Path where xlsx are stored")
parser.add_option("-t",
"--template",
action="store",
type="string",
dest="template",
default=default_template,
help="The template file")
(options, args) = parser.parse_args()
if not options.classe:
raise ValueError("Need to pass a class with -c. See -h for help")
if not options.ds_name:
raise ValueError("Need to pass a evaluation name with -e. See -h for help")
generate_bilan(options.classe,
options.ds_name,
options.path,
options.template)
if __name__ == "__main__":
main()
# -----------------------------
# Reglages pour 'vim'
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
# cursor: 16 del