From f7961a135a56b3230c4c2881a2c1699b90adbec9 Mon Sep 17 00:00:00 2001 From: Place Jean-Marie Date: Sat, 18 Sep 2021 11:08:04 +0200 Subject: [PATCH] finalisation --- app/scodoc/sco_excel.py | 24 ++++-------------------- app/scodoc/sco_placement.py | 9 ++------- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/app/scodoc/sco_excel.py b/app/scodoc/sco_excel.py index 3533dc06..1e70858a 100644 --- a/app/scodoc/sco_excel.py +++ b/app/scodoc/sco_excel.py @@ -59,22 +59,6 @@ class COLORS(Enum): LIGHT_YELLOW = "FFFFFF99" -# def send_excel_file(request, data, filename, mime=scu.XLSX_MIMETYPE): -# """publication fichier. -# (on ne doit rien avoir émis avant, car ici sont générés les entetes) -# """ -# filename = ( -# scu.unescape_html(scu.suppress_accents(filename)) -# .replace("&", "") -# .replace(" ", "_") -# ) -# request.RESPONSE.setHeader("content-type", mime) -# request.RESPONSE.setHeader( -# "content-disposition", 'attachment; filename="%s"' % filename -# ) -# return data - - # Un style est enregistré comme un dictionnaire qui précise la valeur d'un attributdans la liste suivante: # font, border, number_format, fill,... # (cf https://openpyxl.readthedocs.io/en/stable/styles.html#working-with-styles) @@ -351,10 +335,10 @@ class ScoExcelSheet: Ce flux pourra ensuite être repris dans send_excel_file (classeur mono feille) ou pour la génération d'un classeur multi-feuilles """ - for col in self.column_dimensions.keys(): - self.ws.column_dimensions[col] = self.column_dimensions[col] - for col in self.row_dimensions.keys(): - self.ws.row_dimensions[col] = self.row_dimensions[col] + for row in self.column_dimensions.keys(): + self.ws.column_dimensions[row] = self.column_dimensions[row] + for row in self.row_dimensions.keys(): + self.ws.row_dimensions[row] = self.row_dimensions[row] for row in self.rows: self.ws.append(row) diff --git a/app/scodoc/sco_placement.py b/app/scodoc/sco_placement.py index d0e19c67..ac12fcb0 100644 --- a/app/scodoc/sco_placement.py +++ b/app/scodoc/sco_placement.py @@ -34,10 +34,6 @@ import random import time from copy import copy -import flask -from flask import request - -from app.scodoc.sco_exceptions import ScoValueError import wtforms.validators from flask import request, render_template from flask_login import current_user @@ -50,7 +46,6 @@ from wtforms import ( RadioField, HiddenField, SelectMultipleField, - BooleanField, ) import app.scodoc.sco_utils as scu import app.scodoc.notesdb as ndb @@ -69,8 +64,8 @@ from app.scodoc.gen_tables import GenTable from app.scodoc import sco_etud import sco_version -# _ = lambda x: x # sans babel -# _l = _ +_ = lambda x: x # sans babel +_l = _ COORD = "Coordonnées" SEQ = "Continue"