Release v1.0
This commit is contained in:
14
cemento.py
14
cemento.py
@@ -1,11 +1,18 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- 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
|
from flask import Flask, render_template, request, Response
|
||||||
import math
|
import math
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
# DEFINIZIONE VERSIONE (Modifica qui per i rilasci futuri)
|
# 2. DEFINIZIONE VERSIONE (Apparirà in rosso sul sito)
|
||||||
VERSIONE = "1.1 - TEST"
|
VERSIONE = "Rev.1.1"
|
||||||
|
|
||||||
def calcola(d):
|
def calcola(d):
|
||||||
try:
|
try:
|
||||||
@@ -49,7 +56,7 @@ def calcola(d):
|
|||||||
def index():
|
def index():
|
||||||
res = None
|
res = None
|
||||||
if request.method == 'POST': res = calcola(request.form)
|
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)
|
return render_template('index.html', res=res, form=request.form, rev=VERSIONE)
|
||||||
|
|
||||||
@app.route('/download', methods=['POST'])
|
@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"})
|
return Response(report, mimetype="text/plain", headers={"Content-disposition":"attachment;filename=Report_Dettagliato.txt"})
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
# Avvio del server sulla porta 5000
|
||||||
app.run(host='0.0.0.0', port=5000)
|
app.run(host='0.0.0.0', port=5000)
|
||||||
Reference in New Issue
Block a user