Commit 3310433d authored by Lorenz Steinert's avatar Lorenz Steinert

restrucktured the ldap connection

parent 2bd98c8f
This diff is collapsed.
......@@ -85,23 +85,10 @@ def gen_head(share_dir, reg, sprecher, protokollant, date):
return f_head
def resort_fsr(fsr, num_cols=5):
"""resort list for pascal style sorting"""
fsr += [""] * (num_cols - len(fsr) % num_cols)
depth = len(fsr) // num_cols
tmp = [[] for i in range(depth)]
for index, elem in zip(range(len(fsr)), fsr):
tmp[index % depth] += [elem]
return [j for i in tmp for j in i]
def gen_attendance_tab(fsr, num_cols=5, ext=False):
"""generate the atandance tables"""
fsr = resort_fsr(fsr, num_cols)
tabdef = '||' + 'c|l||' * num_cols
fsr_tab = ''
......@@ -192,7 +179,7 @@ if __name__ == "__main__":
NUM_COLS = 5
NUM_COLS_EXT = 5
ESME = FsrLdap(LDAP_SERVER, LDAP_SERVER_BASE, OPT.debug,
ESME = FsrLdap(LDAP_SERVER, LDAP_SERVER_BASE, SHARE_DIR, OPT.debug,
SERVER_TIMEOUT)
print("\n")
......@@ -205,8 +192,7 @@ if __name__ == "__main__":
#Fetch the FSR from the Server
#and if not able to connect fall back to the textfiles
FSR = [ESME.get_fsr_ldap(SHARE_DIR),
ESME.get_fsr_extern_ldap(SHARE_DIR)]
FSR = [ESME.get_fsr(), ESME.get_fsr_extern()]
#Generate the Path for the Protokoll in depandance of OPT.VV
#and make the directory
......
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