def update(lifespan): world = "82" # download the data files, if needed, and populate the tribe try: tw.download_data_files(lifespan, world) except tw.WorldError, we: sys.exit(we)
def run(lifespan): while True: # get the world number and tribe tag #os.system(["clear", "cls"][os.name == "nt"]) print "\nWelcome to Tribe Intel!\n" world = raw_input("World: ").strip(string.whitespace) tribe_tag = raw_input("Tribe tag: ").strip(string.whitespace) if not world or not tribe_tag: raw_input("Please enter both a world and tribe tag. Press enter to try again.\n") continue # download the data files, if needed, and populate the tribe try: tw.download_data_files(lifespan, world) except tw.WorldError, we: sys.exit(we) tribe = tw.populate_tribe(tribe_tag, world) process_tribe(tribe)