solo-auswertung/src/solo_turnier/batch.py

34 lines
1.1 KiB
Python
Raw Normal View History

2022-11-10 21:40:12 +00:00
import solo_turnier
import logging
import os
import pprint
import tabulate
2022-11-10 21:40:12 +00:00
class BatchWorker:
def __init__(
self,
config: solo_turnier.cli.Cli
):
self.l = logging.getLogger('solo_turnier.batch')
self.config = config
def run(self):
self.l.debug(self.config.__dict__)
locator = solo_turnier.html_locator.HtmlLocator()
2022-11-27 08:10:17 +00:00
self.l.info('Checking for feasible preview HTML export files in "%s"', self.config.importHtmlPath())
htmlCandidatesPreview = locator.findPreviewRoundCandidates(self.config.importHtmlPath())
self.l.debug('Found HTML file candidates for preview rounds: %s', htmlCandidatesPreview)
htmlResultFiles = locator.findCandidates(self.config.importHtmlPath())
self.l.debug('Using HTML result files for result extraction: %s', htmlResultFiles)
2022-12-03 20:46:19 +00:00
worker = solo_turnier.worker.Worker()
importedData = worker.collectAllData(htmlCandidatesPreview, htmlResultFiles)
2023-09-13 14:07:55 +00:00
combinedData = worker.combineData(importedData)
consoleOutputtter = solo_turnier.output.ConsoleOutputter()
consoleOutputtter.output(combinedData)