Exemple #1
0
def main():
    keep_running = True
    while keep_running is True:
        print("\nPick an offer to ignore")
        offers = Serialization.load(Amex.Offer.FILE)
        ignored = Serialization.load(Amex.Offer.IGNOREDFILE)
        visible = [x for x in offers if x not in ignored]
        printlist = [repr(x) for x in visible]
        _, index = Serialization.pick_from_list(printlist, sort=True)
        item = visible[index]

        if query_yes_no("\nAdd to ignore list?"):
            ignored.append(item)
            Serialization.save(ignored, Amex.Offer.IGNOREDFILE)
        print("Added\n")
def store(offers, cards, lookup_table):
    offers = list(set(offers))
    Serialization.save(offers, Amex.Offer.FILE)
    Serialization.save(cards, Amex.Card.FILE)
    Serialization.save(lookup_table, Amex.CardOffer.FILE)