print("Adding {parent} to {tier}'s bans".format(parent=parent,tier=tier))
            p = tiers.find(".//tier[@name='{parent}']".format(parent=parent))
            bans |= deserialize_bans(p.attrib["pokemons"])

        ban_subset = new_bans - bans
        if ban_subset:
            print("Add bans for {pokemon} in {tier}.".format(pokemon=ban_subset, tier=tier))
            ans = input("Proceed with changes? [Y/n] ")
            if ans == "" or ans.upper().startswith("Y"):
                current_bans |= ban_subset
                element.attrib["pokemons"] = serialize_bans(bans)
                print("Tier {tier} updated!".format(tier=tier))
            else:
                print("Tier {tier} not updated.".format(tier=tier))
        else:
            print("Tier {tier} has bans already.".format(tier=tier))

    return tiers

if __name__ == "__main__":
    print("Reading PO tiers")
    po_tiers = get_po_tiers()
    if "--kyurem-check" in sys.argv:
        po_tiers = ban_kyurem(po_tiers)
    else:
        print("Updating PO tiers...")
        po_tiers = update_tiers(po_tiers)
    print("Writing PO tiers")
    write_po_tiers(po_tiers)
    print("Done")
                        format(smogon_tier, banlistname))
                for key in [
                        "pokemons", "restrictedPokemons", "items", "moves"
                ]:
                    smogon_element.attrib[key] = merge_bans(
                        smogon_element.attrib[key], banlist.attrib[key])

        po_element = po_tiers.find(".//tier[@name='{0}']".format(po_tier))

        for key in [
                "pokemons", "restrictedPokemons", "banMode", "maxLevel",
                "mode", "gen", "moves", "items", "numberOfPokemons", "clauses"
        ]:
            po_element.attrib[key] = smogon_element.attrib[key]

    print("")
    return po_tiers


if __name__ == "__main__":
    print("Downloading Smogon tiers")
    smogon_tiers = download_smogon_tiers(download=True)
    print("Reading PO tiers")
    po_tiers = get_po_tiers()
    print("Merging Smogon tiers to PO tiers...", end=" ")
    po_tiers = update_tiers(smogon_tiers, po_tiers)
    print("Writing PO tiers")
    write_po_tiers(po_tiers)
    print("Done")
    print("You can now remove the temporary directory 'smogon' if you want.")