def navbarItems(activePage): pages = ["Students", "Assistants", "Experiments", "Appointments", "Groups", "Users", "Semesters"] items = [] for page in pages: active = "" lowerPage = page.lower().replace(" ", "_") if lowerPage == activePage: active = " active" items.append('' + page + '') return items def makeTable(headerAndDataList, rows): def cellString(cell): cell = str(cell) if cell == "[]": return "None" excludeChars = """<>"'[]""" for c in excludeChars: if c in cell: cell = cell.replace(c, "") return cell def td(cell): return "" + cellString(cell) + "" def th(cell): return '' + cellString(cell) + '' table = '''''' for i in headerAndDataList: table += th(i[0]) table += '''\n''' for row in rows: table += '' for i in headerAndDataList: table += td(eval(i[1])) table += '\n' table += '''



''' return table def appointmentDate(date): return date.strftime("%a %d.%m.%Y") def randomPassword(): return ''.join(random.choice(string.ascii_letters + string.digits) for i in range(12))