Commit 32b75d68 authored by Lorenz Steinert's avatar Lorenz Steinert

is running and building the tex

parent ad5580cc
......@@ -4,7 +4,7 @@ Nico Fink
Kai Hawerkamp
Silvia Hiebel
Malte Koster
Sahra Kova\v{c}
Sahra Kova\\\\v{c}
Ruthger Kuwertz
Felix Lang
Annika Lesch
......
......@@ -49,6 +49,8 @@ class Protokollskript:
self.reg_O = re.compile('\"O')
self.reg_U = re.compile('\"U')
self.reg_Kovac = re.compile('Kovac')
self.reg_spr = re.compile("%%SPRECHER")
self.reg_prot = re.compile("%%PROTOKOLLANT")
self.fsr = [re.sub(re.escape('\t'), ' ', line.rstrip('\n')) for line in open('fsr', 'r').readlines()]
self.fsr_extern = [re.sub(re.escape('\t'), ' ' , line.rstrip('\n')) for line in open('fsr_extern', 'r').readlines()]
......@@ -77,7 +79,7 @@ class Protokollskript:
if conn.search('ou=group,'+self.base,fil,attributes=['memberUid']):
for i in conn.entries[0]['memberUid']:
if conn.search('ou=people,'+self.base,'(uid='+i+')',attributes=['gecos']):
fsr_ += [self.reg_Kovac.sub('Kova\v{c}', self.reg_A.sub('Ä', self.reg_O.sub('Ö', self.reg_U.sub('Ü', self.reg_a.sub('ä', self.reg_o.sub('ö', self.reg_u.sub('ü', str(conn.entries[0]['gecos']))))))))]
fsr_ += [self.reg_Kovac.sub("Kova"+r"\v"+"{c}", self.reg_A.sub('Ä', self.reg_O.sub('Ö', self.reg_U.sub('Ü', self.reg_a.sub('ä', self.reg_o.sub('ö', self.reg_u.sub('ü', str(conn.entries[0]['gecos']))))))))]
fsr_.sort()
fsr_ = [" ".join(i.split(', ')[::-1]) for i in fsr_]
return fsr_
......@@ -96,7 +98,7 @@ class Protokollskript:
if conn.search('ou=group,'+self.base,fil,attributes=['memberUid']):
for i in conn.entries[0]['memberUid']:
if conn.search('ou=people,'+self.base,'(uid='+i+')',attributes=['gecos']):
fsr_extern_ += [self.reg_Kovac.sub('Kova\v{c}', self.reg_A.sub('Ä', self.reg_O.sub('Ö', self.reg_U.sub('Ü', self.reg_a.sub('ä', self.reg_o.sub('ö', self.reg_u.sub('ü', str(conn.entries[0]['gecos']))))))))]
fsr_extern_ += [self.reg_Kovac.sub("Kova"+r"\v"+"{c}", self.reg_A.sub('Ä', self.reg_O.sub('Ö', self.reg_U.sub('Ü', self.reg_a.sub('ä', self.reg_o.sub('ö', self.reg_u.sub('ü', str(conn.entries[0]['gecos']))))))))]
fsr_extern_.sort()
fsr_extern_ = [" ".join(i.split(', ')[::-1]) for i in fsr_extern_]
return fsr_extern_
......@@ -147,9 +149,6 @@ class Protokollskript:
self.fsr = self.get_fsr_ldap(self.fsr)
self.fsr_extern = self.get_fsr_extern_ldap(self.fsr_extern)
print(self.fsr)
print(self.fsr_extern)
outdir = "../"+str(self.year)+"/fsr_physik_sitzung_"+str(self.year)+"-"+str(self.mon)+"-"+str(self.day)+"/"
if not os.path.exists(outdir):
os.makedirs(outdir)
......@@ -158,15 +157,72 @@ class Protokollskript:
with open('head.tex','r') as f:
f_head = f.read()
f.closed
f_head = self.reg_spr.sub(self.sprecher,f_head)
f_head = self.reg_prot.sub(self.protokollant,f_head)
with open('foot.tex','r') as f:
f_foot = f.read()
print(f_head)
print(f_foot)
#print(daten,daten_ext,head,foot)
f.closed
f_foot = self.reg_spr.sub(self.sprecher,f_foot)
f_foot = self.reg_prot.sub(self.protokollant,f_foot)
with open(outfile,'w') as f:
f.write(f_head)
f.write("~\\newline\n")
tabdef="||"
for i in range(self.num_cols):
tabdef += "c|l||"
f.write("FSR-Mitglieder\\\\\n\\\\\n\scriptsize{\\begin{tabular}{"+tabdef+"}\n\hline\n")
for i in zip(self.fsr,range(len(self.fsr))):
if i[1]%self.num_cols==0:
f.write(" ")
else:
f.write("&")
if "Sarah" in i[0]:
f.write(r" &Sarah Anna Kova\v{c}")
else:
f.write(" &"+i[0])
if i[1]%self.num_cols==3:
f.write("\\\\hline\n")
else:
f.write("\n")
f.write("\end{tabular}}\\normalsize\\vspace{1em}\n")
f.write("\\newline\n")
tabdef=""
for i in range(self.num_cols_ext):
tabdef += "c|l||"
f.write("Externe-Refferenten\\\\\n\\\\\n\scriptsize{\\begin{tabular}{"+tabdef+"}\n\hline\n")
for i in zip(self.fsr_extern,range(len(self.fsr_extern))):
if i[1]%self.num_cols==0:
f.write(" ")
else:
f.write("&")
if "Sarah" in i[0]:
f.write(r" &Sarah Anna Kova\v{c}")
else:
f.write(" &"+i[0])
if i[1]%self.num_cols==3:
f.write("\\\\hline\n")
else:
f.write("\n")
f.write("\end{tabular}}\\normalsize")
f.write(f_foot)
f.closed
if __name__=="__main__":
s = Protokollskript()
......
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