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:
@@ -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}
|
Reference in New Issue
Block a user