repytex/generate_bilan/__main__.py

57 lines
1.4 KiB
Python
Raw Normal View History

2016-11-08 08:07:03 +00:00
#!/usr/bin/env python
# encoding: utf-8
from generate_bilan import generate_bilan
import optparse
import os
from path import Path
# Defaults settings
this_dir, this_filename = os.path.split(__file__)
default_template = Path(this_dir + "/tpl_bilan.tex")
2016-11-08 08:07:03 +00:00
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")
2016-11-08 08:07:03 +00:00
(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")
build_bilan(options.classe,
options.ds_name,
options.path,
options.template)
2016-11-08 08:07:03 +00:00
# -----------------------------
# Reglages pour 'vim'
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
# cursor: 16 del