Release v1.0
This commit is contained in:
14
cemento.py
14
cemento.py
@@ -1,11 +1,18 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import sys
|
||||
import os
|
||||
|
||||
# 1. PERCORSO LIBRERIE SPECIFICO PER SYNOLOGY (Identificato con il test)
|
||||
# Questo permette a Gitea di trovare Flask anche se l'utente è diverso
|
||||
sys.path.append('/var/services/homes/Francesco/.local/lib/python3.8/site-packages')
|
||||
|
||||
from flask import Flask, render_template, request, Response
|
||||
import math
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
# DEFINIZIONE VERSIONE (Modifica qui per i rilasci futuri)
|
||||
VERSIONE = "1.1 - TEST"
|
||||
# 2. DEFINIZIONE VERSIONE (Apparirà in rosso sul sito)
|
||||
VERSIONE = "Rev.1.1"
|
||||
|
||||
def calcola(d):
|
||||
try:
|
||||
@@ -49,7 +56,7 @@ def calcola(d):
|
||||
def index():
|
||||
res = None
|
||||
if request.method == 'POST': res = calcola(request.form)
|
||||
# Passiamo la variabile 'rev' al template HTML
|
||||
# Passiamo la revisione al template HTML
|
||||
return render_template('index.html', res=res, form=request.form, rev=VERSIONE)
|
||||
|
||||
@app.route('/download', methods=['POST'])
|
||||
@@ -90,4 +97,5 @@ Generato da Software Cemento {VERSIONE}
|
||||
return Response(report, mimetype="text/plain", headers={"Content-disposition":"attachment;filename=Report_Dettagliato.txt"})
|
||||
|
||||
if __name__ == '__main__':
|
||||
# Avvio del server sulla porta 5000
|
||||
app.run(host='0.0.0.0', port=5000)
|
||||
Reference in New Issue
Block a user