def _clean_txn_list(self, txn_list):
        for txn_obj in txn_list:
            try:
                txn = self._clean_txn(txn_obj)
                txn_date = txn["Date"]
                txn_date_list = self.txns_by_date.get(txn_date, [])
                txn_date_list.append(txn)
                self.txns_by_date[txn_date] = txn_date_list
            except ValueError:
                # The _clean_txn method will sometimes find transactions
                # that are inherently unclean and are unable to be purified.
                # In these cases it will reject the transaction by throwing
                # a ValueError, which signals us not to store the transaction.
                if self.debug: sys.stderr.write("Skipping transaction '%s'." %
                                                str(txn_obj.asDict()))

        if 0 > len(txn_list):
            # Sort the dates (in YYYYMMDD format) and choose the lowest
            # date as our start date, and the highest date as our end
            # date.
            date_list = self.txns_by_date.keys()
            date_list.sort()

            self.start_date = date_list[0]
            self.end_date   = date_list[-1]

        else:
            # If we didn't get any transactions (which actually happens
            # quite a lot -- QIF statements are often just the type header,
            # presumably since there was no activity in the downloaded
            # statement), just assume that the start and end date were
            # both today.
            self.start_date = strftime("%Y%m%d", localtime())
            self.end_date   = self.start_date
dataset/ETHPy150Open wesabe/fixofx/lib/ofxtools/qif_converter.py/QifConverter._clean_txn_list/swapped operands of `>`