def addFile(self): fileName = self.getCsvFileName() if fileName: parser = CSVParser() newTransactionMap = parser.parseCsv(fileName) self.transactionMap = parser.addTransactionMap( self.transactionMap, newTransactionMap) allMonths = list(self.transactionMap.keys()) allMonths.sort() self.monthsList = allMonths self.loadMonth(self.currentMonth)
def loadNewFile(self): fileName = self.getCsvFileName() if fileName: parser = CSVParser() self.transactionMap = parser.parseCsv(fileName) allMonths = list(self.transactionMap.keys()) allMonths.sort() self.monthsList = allMonths self.loadMonth(allMonths[-1]) if len(allMonths) > 1: self.monthDecreaseButton.show() self.addMetricsButton()