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