feat: Logo-Update bei Installation hinzugefügt; Versionsnummer auf 1.0.64 erhöht
This commit is contained in:
8
app.py
8
app.py
@@ -2033,6 +2033,9 @@ def r_update_install():
|
||||
# Syntax-Check bevor wir irgendetwas überschreiben
|
||||
compile(new_code, 'app.py', 'exec')
|
||||
|
||||
logo_req = _urlreq.urlopen(f'{RAW_BASE}/PiCopy_Logo.png', timeout=30)
|
||||
logo_data = logo_req.read()
|
||||
|
||||
tmp = Path('/opt/picopy/app.py.tmp')
|
||||
tmp.write_text(new_code, encoding='utf-8')
|
||||
with open(tmp, 'rb') as fh:
|
||||
@@ -2043,6 +2046,11 @@ def r_update_install():
|
||||
with open(vtmp, 'rb') as fh:
|
||||
os.fsync(fh.fileno())
|
||||
os.replace(str(vtmp), '/opt/picopy/version.txt')
|
||||
ltmp = Path('/opt/picopy/PiCopy_Logo.png.tmp')
|
||||
ltmp.write_bytes(logo_data)
|
||||
with open(ltmp, 'rb') as fh:
|
||||
os.fsync(fh.fileno())
|
||||
os.replace(str(ltmp), '/opt/picopy/PiCopy_Logo.png')
|
||||
log.info('Update installiert - starte Dienst neu...')
|
||||
|
||||
# Systemd startet den Dienst automatisch neu
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.0.63
|
||||
1.0.64
|
||||
Reference in New Issue
Block a user