51 lines
1.2 KiB
Python
Executable File
51 lines
1.2 KiB
Python
Executable File
#!/usr/bin/env python
|
|
# encoding: utf-8
|
|
|
|
from notes_tools.tools import extract_flat_marks, get_class_ws, list_classes
|
|
import pandas as pd
|
|
import numpy as np
|
|
import xlrd
|
|
from path import Path
|
|
|
|
import logging
|
|
logger = logging.getLogger("generate_bilan")
|
|
|
|
|
|
def print_bilan_of(classe_ws):
|
|
"""TODO: Docstring for list_bilan.
|
|
|
|
:param arg1: TODO
|
|
:returns: TODO
|
|
|
|
"""
|
|
try:
|
|
df = extract_flat_marks(classe_ws)
|
|
# TODO: il faudrait renommer l'exeption |lun. nov. 28 16:17:21 EAT 2016
|
|
except ValueError:
|
|
print("Erreur avec cette feuille de calcul")
|
|
return None
|
|
print("Évaluations")
|
|
for e in df["Nom"].unique():
|
|
print("\t-{}".format(e))
|
|
print("Trimestre")
|
|
for t in df['Trimestre'].unique():
|
|
print("\t-Trimestre {}".format(t))
|
|
|
|
def print_bilan(path):
|
|
""" List all bilan which can be generate in the directory
|
|
|
|
:param path: the directory
|
|
:returns: TODO
|
|
|
|
"""
|
|
print("Liste des bilans disponibles")
|
|
for c in list_classes(path):
|
|
print("Classe de {}".format(c))
|
|
ws = get_class_ws(c, path)
|
|
print_bilan_of(ws)
|
|
|
|
# -----------------------------
|
|
# Reglages pour 'vim'
|
|
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
|
|
# cursor: 16 del
|