Online updates/save heartbeat table etc.

News:
- Online updates from test github repository
- Removing offline clients after selected period of time
- Saving heartbeat table (can be disabled)
Added system.py it is handeling updates and cleaning of logs/heartbeat table. In the future should be able to fix errors in case program crashes.
This commit is contained in:
Untriex Programming
2021-03-21 12:52:55 +01:00
parent 55fcf7d4d4
commit 3a34e50432
9 changed files with 188 additions and 129 deletions

View File

@@ -1,4 +1,6 @@
from datetime import datetime
import json
import requests
class Log:
@@ -38,3 +40,18 @@ class Log:
def debug(self, debug):
if self.debug_e:
print(f"{datetime.now()} -> DEBUG: {debug}")
class Update:
def __init__(self):
with open("version.json", "r") as f: # loading settings
version = json.load(f)
self.url = version["url"]
self.version = version["version"]
self.id = version["id"]
def get_updates(self):
return json.loads(requests.get(self.url).text)
def get_version(self):
return {"version": self.version, "id": self.id}