moved core functions in tasks.py to class Tasker

Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
Arthur Lu 2020-06-10 18:19:58 +00:00
parent 236c28c3be
commit 8a212a21df

View File

@ -6,6 +6,8 @@ __author__ = (
"Arthur Lu <learthurgo@gmail.com>", "Arthur Lu <learthurgo@gmail.com>",
) )
class Tasker():
match_ = False match_ = False
metric_ = False metric_ = False
pit_ = False pit_ = False
@ -16,17 +18,8 @@ pit_enable = True
config = {} config = {}
def init(): def __init__():
global match_
global metric_
global pit_
global match_enable
global metric_enable
global pit_enable
global config
config = su.load_config("config.json") config = su.load_config("config.json")
def match(): def match():
@ -105,6 +98,24 @@ def stop_metric():
def stop_pit(): def stop_pit():
pit_enable = False pit_enable = False
def get_match():
return match_
def get_metric():
return metric_
def get_pit():
return pit_
def get_match_enable():
return match_enable
def get_metric_enable():
return metric_enable
def get_pit_enable():
return pit_enable
""" """
def main(): def main():