From 82f0612883b74b5184bfe49d6d16a939c304ba44 Mon Sep 17 00:00:00 2001 From: viennet Date: Mon, 4 Jan 2021 13:53:19 +0100 Subject: [PATCH] pylint --- gen_tables.py | 2 +- sco_pdf.py | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/gen_tables.py b/gen_tables.py index c1a84d18c..fbd8309c7 100644 --- a/gen_tables.py +++ b/gen_tables.py @@ -693,7 +693,7 @@ class SeqGenTable: def excel(self): """Export des genTables dans un unique fichier excel avec plusieurs feuilles tagguées""" - book = sco_excel.Workbook() # Le fichier xls en devenir + book = sco_excel.Workbook() # pylint: disable=no-member for (_, gt) in self.genTables.items(): gt.excel(wb=book) # Ecrit dans un fichier excel return book.savetostr() diff --git a/sco_pdf.py b/sco_pdf.py index 0d14e7930..23e5c7ff0 100644 --- a/sco_pdf.py +++ b/sco_pdf.py @@ -31,7 +31,10 @@ Tout accès à ReportLab doit donc être précédé d'un PDFLOCK.acquire() et terminé par un PDFLOCK.release() """ -import time, cStringIO +import time +import cStringIO +import re +import os from types import StringType import unicodedata import traceback @@ -49,9 +52,12 @@ from reportlab.lib.enums import TA_LEFT, TA_RIGHT, TA_CENTER, TA_JUSTIFY from reportlab.lib import styles from reportlab.lib.pagesizes import letter, A4, landscape -from sco_utils import * +import sco_utils as scu +from sco_utils import CONFIG, SCO_ENCODING, SCODOC_LOGOS_DIR, LOGOS_IMAGES_ALLOWED_TYPES from notes_log import log +from sco_exceptions import ScoGenError from SuppressAccents import suppression_diacritics +import VERSION from VERSION import SCOVERSION, SCONAME PAGE_HEIGHT = defaultPageSize[1] @@ -107,7 +113,7 @@ def makeParas(txt, style, suppress_empty=False): if suppress_empty: r = [] for para in paras: - m = re.match("\s*<\s*para.*>\s*(.*)\s*<\s*/\s*para\s*>\s*", para) + m = re.match(r"\s*<\s*para.*>\s*(.*)\s*<\s*/\s*para\s*>\s*", para) if not m: r.append(para) # not a paragraph, keep it else: @@ -229,7 +235,10 @@ class ScolarsPageTemplate(PageTemplate): # ---- Logo: a small image, positionned at top left of the page if self.logo is not None: # draws the logo if it exists - ((width, height), image) = self.logo + ( # pylint: disable=unpacking-non-sequence + (width, height), + image, + ) = self.logo canvas.drawImage(image, inch, doc.pagesize[1] - inch, width, height) # ---- Filigranne (texte en diagonal en haut a gauche de chaque page)