added test.py to .gitignore

prepared tra.py for threading implement

Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
Arthur Lu 2020-05-23 19:43:59 -05:00
parent 4f439d6094
commit ba06b9293e
2 changed files with 48 additions and 42 deletions

1
.gitignore vendored
View File

@ -31,3 +31,4 @@ data-analysis/__pycache__/
analysis-master/__pycache__/
analysis-master/.pytest_cache/
data-analysis/.pytest_cache/
data-analysis/test.py

View File

@ -27,65 +27,70 @@ def main():
global pit_enable
global config
config = su.load_config("config.json")
global config = su.load_config("config.json")
while(True):
task = threading.Thread(name = "match", target = match)
task.start()
task = threading.Thread(name = "match", target = metric)
task.start()
task = threading.Thread(name = "pit", target = pit)
task.start()
if match_enable == True and match == False:
def match():
def target():
match = True
apikey = config["key"]["database"]
competition = config["competition"]
tests = config["statistics"]["match"]
apikey = config["key"]["database"]
competition = config["competition"]
tests = config["statistics"]["match"]
data = su.load_match(apikey, competition)
su.matchloop(apikey, competition, data, tests)
data = su.load_match(apikey, competition)
su.matchloop(apikey, competition, data, tests)
match = False
return
match = False
match = True
task = threading.Thread(name = "match", target=target)
task.start()
if match_enable == True and match == False:
if metric_enable == True and metric == False:
task = threading.Thread(name = "match", target = match)
task.start()
def target():
def metric():
apikey = config["key"]["database"]
tbakey = config["key"]["tba"]
competition = config["competition"]
metric = config["statistics"]["metric"]
metric = True
timestamp = su.get_previous_time(apikey)
apikey = config["key"]["database"]
tbakey = config["key"]["tba"]
competition = config["competition"]
metric = config["statistics"]["metric"]
su.metricloop(tbakey, apikey, competition, timestamp, metric)
timestamp = su.get_previous_time(apikey)
metric = False
return
su.metricloop(tbakey, apikey, competition, timestamp, metric)
match = True
task = threading.Thread(name = "metric", target=target)
task.start()
metric = False
if pit_enable == True and pit == False:
if metric_enable == True and metric == False:
def target():
task = threading.Thread(name = "match", target = metric)
task.start()
apikey = config["key"]["database"]
competition = config["competition"]
tests = config["statistics"]["pit"]
def pit():
data = su.load_pit(apikey, competition)
su.pitloop(apikey, competition, data, tests)
pit = True
pit = False
return
apikey = config["key"]["database"]
competition = config["competition"]
tests = config["statistics"]["pit"]
pit = True
task = threading.Thread(name = "pit", target=target)
task.start()
data = su.load_pit(apikey, competition)
su.pitloop(apikey, competition, data, tests)
pit = False
if pit_enable == True and pit == False:
task = threading.Thread(name = "pit", target = pit)
task.start()
task = threading.Thread(name = "main", target=main)
task.start()