Commit 9ecb9e8f authored by Lorenz Steinert's avatar Lorenz Steinert

moved header into its own file

parent 985b1835
......@@ -33,7 +33,7 @@ def build_parser():
return parser.parse_args()
def gen_head(share_dir, reg, sprecher, protokollant, date):
def gen_header(share_dir, reg, sprecher, protokollant, date):
"""generate the head of the protokoll"""
# look for the name.tex and if not found ignore it
if os.path.isfile(os.path.join(share_dir, 'name.tex')):
......@@ -123,7 +123,7 @@ def gen_attendance_tab(fsr, num_cols=5, ext=False):
return fsr_tab
def gen_foot(share_dir, vollversamlung, reg, sprecher, protokollant, date):
def gen_footer(share_dir, vollversamlung, reg, sprecher, protokollant, date):
"""generate the foot of the protokoll"""
# look for the foot*.tex skripts
# if not found abort
......@@ -212,31 +212,41 @@ if __name__ == "__main__":
OUTDIR = os.path.join(get_path(RUNDIR, CONFIG, OPT.path), DATE[1],
"fsr_physik_vollversamlung_"
+ '-'.join(DATE[1:]))
# Generate the path of the .tex file
OUTFILE = os.path.join(OUTDIR, "fsr_physik_protokoll_vv_"
+ '-'.join(DATE[1:]) + ".tex")
# Generate the path of the .tex files
OUTFILE_HEADER = os.path.join(OUTDIR, "fsr_physik_protokoll_vv_"
+ '-'.join(DATE[1:]) + "_header.tex")
OUTFILE_BODY = os.path.join(OUTDIR, "fsr_physik_protokoll_vv_"
+ '-'.join(DATE[1:]) + ".tex")
else:
OUTDIR = os.path.join(get_path(RUNDIR, CONFIG, OPT.path), DATE[1],
"fsr_physik_sitzung_" + '-'.join(DATE[1:]))
# Generate the path of the .tex file
OUTFILE = os.path.join(OUTDIR, "fsr_physik_protokoll_"
+ '-'.join(DATE[1:]) + ".tex")
OUTFILE_HEADER = os.path.join(OUTDIR, "fsr_physik_protokoll_"
+ '-'.join(DATE[1:]) + "_header.tex")
OUTFILE_BODY = os.path.join(OUTDIR, "fsr_physik_protokoll_"
+ '-'.join(DATE[1:]) + ".tex")
if not os.path.exists(OUTDIR):
os.makedirs(OUTDIR)
shutil.copyfile(os.path.join(SHARE_DIR, "FS-Logo.pdf"),
os.path.join(OUTDIR, "FS-Logo.pdf"))
msg = gen_head(SHARE_DIR, REG, SPRECHER, PROTOKOLLANT, DATE)
header = gen_header(SHARE_DIR, REG, SPRECHER, PROTOKOLLANT, DATE)
body = "\\input{" + OUTFILE_HEADER + "}\n"
msg += "~\\newline\n"
body += "~\\newline\n"
if not OPT.Vollversamlung:
msg += gen_attendance_tab(FSR[0], NUM_COLS)
msg += gen_attendance_tab(FSR[1], NUM_COLS_EXT, ext=True)
body += gen_attendance_tab(FSR[0], NUM_COLS)
body += gen_attendance_tab(FSR[1], NUM_COLS_EXT, ext=True)
footer = gen_footer(SHARE_DIR, OPT.Vollversamlung, REG,
SPRECHER, PROTOKOLLANT, DATE)
msg += gen_foot(SHARE_DIR, OPT.Vollversamlung, REG,
SPRECHER, PROTOKOLLANT, DATE)
body += footer
with codecs.open(OUTFILE, 'w', 'utf-8') as fobj_out:
fobj_out.write(msg)
with codecs.open(OUTFILE_HEADER, 'w', 'utf-8') as fobj_out:
fobj_out.write(header)
with codecs.open(OUTFILE_BODY, 'w', 'utf-8') as fobj_out:
fobj_out.write(body)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment