repytex/repytex/reports/reports_tools.py

51 lines
1.2 KiB
Python
Executable File

#!/usr/bin/env python
# encoding: utf-8
from repytex.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(__name__)
def print_report_of(classe_ws):
"""TODO: Docstring for list_report.
: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_reports(path):
""" List all report 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_report_of(ws)
# -----------------------------
# Reglages pour 'vim'
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
# cursor: 16 del