about page now extends base (so has navbar -oops), and DEV finds last file change time

This commit is contained in:
2022-12-31 15:54:25 +11:00
parent b952fe82f6
commit 7d7f76ba33
2 changed files with 12 additions and 27 deletions

10
main.py
View File

@@ -6,6 +6,8 @@ from flask_marshmallow import Marshmallow
from flask_bootstrap import Bootstrap
from wtforms import SubmitField, StringField, HiddenField, SelectField, IntegerField, TextAreaField, validators
from flask_wtf import FlaskForm
import glob
from datetime import datetime
import os
import re
import socket
@@ -158,9 +160,15 @@ def about():
else:
o['str']=o['str']+l
except FileNotFoundError:
most_recent=0
for file in glob.glob("./*"):
timestamp = os.path.getctime(file)
if timestamp < most_recent:
continue
most_recent = timestamp
o={}
o['date']="No known date"
o['str']='No commits to display (if this is DEV then last build is now)'
o['str']=f'No commits to display (if this is DEV then last change was {datetime.fromtimestamp(most_recent).replace(microsecond=0)})'
# add last commit (or fake commit if no file)
commits.append(o)