1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-15 06:53:07 +01:00

recreate files if extra script changes

This commit is contained in:
wellenvogel
2021-11-21 22:08:02 +01:00
parent 2b91ce71bb
commit 03740a9034

View File

@@ -7,6 +7,8 @@ import inspect
import json
from datetime import datetime
Import("env")
#print(env.Dump())
OWN_FILE="extra_script.py"
GEN_DIR='generated'
CFG_FILE='web/config.json'
XDR_FILE='web/xdrconfig.json'
@@ -43,6 +45,11 @@ def isCurrent(infile,outfile):
otime=os.path.getmtime(outfile)
itime=os.path.getmtime(infile)
if (otime >= itime):
own=os.path.join(basePath(),OWN_FILE)
if os.path.exists(own):
owntime=os.path.getmtime(own)
if owntime > otime:
return False
print("%s is newer then %s, no need to recreate"%(outfile,infile))
return True
return False