refactoring

This commit is contained in:
frankknoll
2023-05-31 19:36:57 +02:00
parent 360d8094ad
commit dbf17fefab

View File

@@ -1,6 +1,7 @@
from CountriesMerger import CountriesMerger
from CountriesByBatchcodeProvider import getCountriesByBatchcodeBeforeDeletion, getCountriesByClickedBatchcode
from BatchCodeTableFactory import BatchCodeTableFactory
from src.CountriesColumnMerger import CountriesColumnMerger
class BatchCodeTableHavingGuessedCountriesFactory:
@@ -20,13 +21,7 @@ class BatchCodeTableHavingGuessedCountriesFactory:
return batchCodeTable
def _guessCountries(self, batchCodeTable, countriesAsList):
self._mergeCountriesOfSrcIntoDst(
CountriesColumnMerger.mergeCountriesColumnOfSrcsIntoCountriesColumnOfDst(
dst = batchCodeTable,
src = self.countriesByBatchcodeBeforeDeletion)
self._mergeCountriesOfSrcIntoDst(
dst = batchCodeTable,
src = self.countriesByClickedBatchcode)
srcs = [self.countriesByBatchcodeBeforeDeletion, self.countriesByClickedBatchcode])
BatchCodeTableFactory._convertCountries(batchCodeTable, countriesAsList)
def _mergeCountriesOfSrcIntoDst(self, dst, src):
dst['Countries'] = CountriesMerger.mergeSrcIntoDst(dst = dst['Countries'], src = src['Countries'])