2022-11-10 21:40:12 +00:00
|
|
|
|
|
|
|
import solo_turnier
|
|
|
|
import logging
|
|
|
|
import os
|
2022-11-11 18:28:52 +00:00
|
|
|
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):
|
2022-11-16 09:22:45 +00:00
|
|
|
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)
|
|
|
|
|
2023-09-13 13:23:04 +00:00
|
|
|
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()
|
2023-09-25 12:59:16 +00:00
|
|
|
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)
|