From 6f885edfe48021fbc0901889096f2f9cfda36301 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sat, 10 Jul 2021 07:27:06 +0200 Subject: [PATCH] imports inutiles --- app/__init__.py | 5 ++-- app/scodoc/sco_users.py | 13 +-------- app/views/scolar.py | 11 +++----- requirements.txt => requirements-2.7.txt | 1 + requirements-3.7.txt | 34 ++++++++++++++++++++++++ 5 files changed, 42 insertions(+), 22 deletions(-) rename requirements.txt => requirements-2.7.txt (98%) create mode 100644 requirements-3.7.txt diff --git a/app/__init__.py b/app/__init__.py index 4e0cbb04..6ff9c0df 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -5,8 +5,9 @@ import os import sys # Un hack en attendant la migration vers Python3 #sco8 -reload(sys) -sys.setdefaultencoding("UTF8") +if sys.version_info.major < 3: + reload(sys) + sys.setdefaultencoding("UTF8") import logging from logging.handlers import SMTPHandler, RotatingFileHandler diff --git a/app/scodoc/sco_users.py b/app/scodoc/sco_users.py index a0874005..7b51c465 100644 --- a/app/scodoc/sco_users.py +++ b/app/scodoc/sco_users.py @@ -30,14 +30,7 @@ # Anciennement ZScoUsers.py, fonctions de gestion des données réécrite avec flask/SQLAlchemy -import base64 -import jaxml -import md5 -import re -import string -import time - -from flask import current_app, url_for, g +from flask import url_for, g from flask_login import current_user import cracklib # pylint: disable=import-error @@ -48,16 +41,12 @@ from app.auth.models import Permission from app.auth.models import User from app.scodoc import html_sco_header -from app.scodoc import sco_cache from app.scodoc import sco_etud from app.scodoc import sco_excel from app.scodoc import sco_preferences from app.scodoc.gen_tables import GenTable from app.scodoc.notes_log import log from app.scodoc.scolog import logdb -from app.scodoc.sco_etud import format_prenom, format_nom -from app.scodoc.TrivialFormulator import TrivialFormulator, tf_error_message -import app.scodoc.notesdb as ndb import app.scodoc.sco_utils as scu from app.scodoc.sco_exceptions import ( diff --git a/app/views/scolar.py b/app/views/scolar.py index 0be944a5..3ed8d981 100644 --- a/app/views/scolar.py +++ b/app/views/scolar.py @@ -24,20 +24,15 @@ ############################################################################## """ -Module scolar: issu de ScoDoc7 / ZScolar.py +Module scolar: vues de .../ScoDoc//Scolarite + +issu de ScoDoc7 / ZScolar.py Emmanuel Viennet, 2021 """ import sys -import traceback import time -import string -import glob -import re -import cgi -import xml -import jaxml # StringIO => io.StringIO or io.BytesIO for text and data respectively. #py3 try: diff --git a/requirements.txt b/requirements-2.7.txt similarity index 98% rename from requirements.txt rename to requirements-2.7.txt index ae115662..5f6d9e96 100644 --- a/requirements.txt +++ b/requirements-2.7.txt @@ -33,6 +33,7 @@ lazy-object-proxy==1.6.0 Mako==1.1.4 MarkupSafe==1.1.1 mccabe==0.6.1 +modernize==0.7 Pillow==6.2.2 pkg-resources==0.0.0 psycopg2==2.8.6 diff --git a/requirements-3.7.txt b/requirements-3.7.txt new file mode 100644 index 00000000..1983328b --- /dev/null +++ b/requirements-3.7.txt @@ -0,0 +1,34 @@ +alembic==1.6.5 +blinker==1.4 +click==8.0.1 +dnspython==2.1.0 +dominate==2.6.0 +email-validator==1.1.3 +Flask==2.0.1 +Flask-Bootstrap==3.3.7.1 +Flask-Login==0.5.0 +Flask-Mail==0.9.1 +Flask-Migrate==3.0.1 +Flask-Moment==1.0.1 +Flask-SQLAlchemy==2.5.1 +Flask-WTF==0.15.1 +greenlet==1.1.0 +idna==3.2 +importlib-metadata==4.6.1 +itsdangerous==2.0.1 +Jinja2==3.0.1 +Mako==1.1.4 +MarkupSafe==2.0.1 +pkg-resources==0.0.0 +psycopg2==2.9.1 +PyJWT==2.1.0 +python-dateutil==2.8.1 +python-dotenv==0.18.0 +python-editor==1.0.4 +six==1.16.0 +SQLAlchemy==1.4.20 +typing-extensions==3.10.0.0 +visitor==0.1.3 +Werkzeug==2.0.1 +WTForms==2.3.3 +zipp==3.5.0