Commit 3c18243f authored by Lorenz Steinert's avatar Lorenz Steinert

ini_file should be working and help added

parent 9f5c5b07
......@@ -62,7 +62,9 @@ class Protokollskript:
'ACRON': re.compile('%%ACRONAME'),
'FSRN': re.compile('%%FSRNAME')}
self.fsr = sorted([re.sub(re.escape('\t'),
self.fsr = ['','']
self.fsr[0] = sorted([re.sub(re.escape('\t'),
' ',
line.rstrip('\n'))
for line in codecs.open('./fsr',
......@@ -70,19 +72,18 @@ class Protokollskript:
'utf-8').readlines()],
key=lambda x: ''.join(x.split(' ')[::-1]))
self.fsr_extern = sorted([re.sub(re.escape('\t'),
self.fsr[1] = sorted([re.sub(re.escape('\t'),
' ',
line.rstrip('\n'))
for line in codecs.open('./fsr_extern', 'r',
'utf-8').readlines()],
key=lambda x: ''.join(x.split(' ')[::-1]))
self.opt = {'-d': False, '-VV': False}
self.opt = {'-d': False, '-VV': False, '-h': False}
for i in opt[1:]:
if i in self.opt.keys():
self.opt[i] = True
print(self.opt)
else:
print(i + ' ist keine Option für das Protokollskript. \
\nVerfügbare Optionen sind: \n' +
......@@ -193,7 +194,7 @@ class Protokollskript:
if len(mon) < 2: mon = "0" + mon
if len(day) < 2: day = "0" + day
date = day + "." + mon + "." + year
return date, day, mon, year
return (date, year, mon, day)
return date
@staticmethod
......@@ -204,16 +205,27 @@ class Protokollskript:
return etmp
return editor
@staticmethod
def help():
print('')
print('proto.py : Erstellt ein Sitzungs-Protokoll')
print('proto.py -h : Gibt diese Hilfe aus.')
print('proto.py -VV: erstellt ein VV-Protokoll.')
raise SystemExit(0)
def main(self):
"""main function of the class"""
if self.opt['-h']: self.help()
num_cols = self.config['DEFAULT'].getint('num_cols')
num_cols_ext = self.config['DEFAULT'].getint('num_cols_ext')
print("\n")
protokollant = self.get_protokollant_ldap(self.config['DEFAULT']['Protokollant'])
self.fsr = self.get_fsr_ldap(self.fsr)
self.fsr_extern = self.get_fsr_extern_ldap(self.fsr_extern)
self.fsr[0] = self.get_fsr_ldap(self.fsr[0])
self.fsr[1] = self.get_fsr_extern_ldap(self.fsr[1])
print("\n")
print("Wenn der Standardwert (in []) stimmt einfach Enter!\n")
......@@ -276,7 +288,7 @@ class Protokollskript:
msg += "FSR-Mitglieder\\\\\n\\\\\n\\scriptsize{\\begin{tabular}{" \
+ tabdef + "}\n\\hline\n"
for i in zip(self.fsr, range(len(self.fsr))):
for i in zip(self.fsr[0], range(len(self.fsr[0]))):
if i[1] % num_cols == 0:
msg += " "
else:
......@@ -292,8 +304,8 @@ class Protokollskript:
else:
msg += "\n"
if not len(self.fsr)%num_cols == 0:
for i in range(num_cols - len(self.fsr)%num_cols):
if not len(self.fsr[0])%num_cols == 0:
for i in range(num_cols - len(self.fsr[0])%num_cols):
msg += "& &\n"
msg += "\\\\\\hline\n"
......@@ -307,7 +319,7 @@ class Protokollskript:
+ r"\scriptsize{\begin{tabular}{" \
+ tabdef + "}\n\\hline\n"
for i in zip(self.fsr_extern, range(len(self.fsr_extern))):
for i in zip(self.fsr[1], range(len(self.fsr[1]))):
if i[1] % num_cols_ext == 0:
msg += " "
else:
......@@ -322,6 +334,12 @@ class Protokollskript:
msg += "\\\\\\hline\n"
else:
msg += "\n"
if not len(self.fsr[1])%num_cols_ext == 0:
for i in range(num_cols_ext - len(self.fsr[1])%num_cols_ext):
msg += "& &\n"
msg += "\\\\\\hline\n"
msg += "\\end{tabular}}\\normalsize"
msg += f_foot
......
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