From a8b8b2615dc2a57f99070a680e8e18d524af1bf3 Mon Sep 17 00:00:00 2001 From: mco-system Date: Mon, 10 Apr 2023 11:12:26 +1100 Subject: [PATCH] wip: programme --- Makefile | 8 +++++--- requirements.txt | 1 + setup.cfg | 1 + src/thsf/__init__.py | 3 ++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index bb154db..5f27d87 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: clean install run stop +.PHONY: clean distclean install run stop install: set -e ;\ @@ -35,9 +35,11 @@ clean: -set -e ;\ THSF_DIR=$$(pwd); \ echo [+] Nettoyage dans $$THSF_DIR; \ - rm -Rf ./build ;\ - rm -Rf ./src/thsf.egg-info; \ + rm -Rf ./build ./src/thsf.egg-info ./thsf.pid ./thsf.log; \ . thsf_venv/bin/activate; \ pip3 uninstall thsf -y +distclean: clean + rm -Rf thsf_venv/ + all: stop clean install run diff --git a/requirements.txt b/requirements.txt index dfbb3d4..62c69fa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,7 @@ build wheel flask +Flask-Minify gunicorn pyYAML requests diff --git a/setup.cfg b/setup.cfg index da00782..65b6405 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,6 +20,7 @@ include_package_data = True python_requires = >=3.7 install_requires = flask + Flask-Minify gunicorn pyYAML requests diff --git a/src/thsf/__init__.py b/src/thsf/__init__.py index c94fa12..643073d 100644 --- a/src/thsf/__init__.py +++ b/src/thsf/__init__.py @@ -5,6 +5,7 @@ import logging from logging import config import yaml from flask import Flask, render_template, redirect, request, url_for +from flask_minify import minify from thsf.backend import Backend from thsf.schedule import Schedule from thsf.navbar import Navbar @@ -23,7 +24,7 @@ class AppConfig: # ------------------------------------------------------------------------------ logger = logging.getLogger('wsgi') app = Flask(__name__) - +minify(app=app, html=True, js=True, cssless=True) # ------------------------------------------------------------------------------ # -- Local configuration