Reformat code with pre-commit

This commit is contained in:
2022-07-21 13:39:41 +01:00
parent 0777a55264
commit ff1ee63900
60 changed files with 547 additions and 278 deletions

View File

@@ -1,6 +1,7 @@
import main
from twisted.internet.task import LoopingCall
def event(name, eventType):
if not "local" in main.counters.keys():
main.counters["local"] = {}
@@ -18,6 +19,7 @@ def event(name, eventType):
main.counters["global"][eventType] += 1
main.runningSample += 1
def getEvents(name=None):
if name == None:
if "global" in main.counters.keys():
@@ -30,10 +32,12 @@ def getEvents(name=None):
else:
return None
def takeSample():
main.lastMinuteSample = main.runningSample
main.runningSample = 0
def setupCounterLoop():
lc = LoopingCall(takeSample)
lc.start(60)