Exemplo n.º 1
0
Arquivo: cli.py Projeto: Teifion/Rob3
def output_all(options, nightly=False):
	start_time = time.time()
	
	print(database.shell_text("''Running tests''"))
	tests(options)
	
	print(database.shell_text("''Running checks''"))
	check_all(options)
	
	print(database.shell_text("''Building world''"))
	the_world = spy_world.Spy_world(database.get_cursor())
	
	cli_f.output_ti(options, the_world)
	cli_f.output_to(options, the_world)
	cli_f.output_stats(options, the_world)
	cli_f.output_map(options, the_world)
	cli_f.output_wh(options, the_world)
	cli_f.output_oh(options, the_world)
	cli_f.output_spyrep(options, the_world)
	cli_f.output_tmap(options, the_world)
	cli_f.output_json(options)
	
	print(database.shell_text("''Completed in %s seconds (delay of %s)''" % (int(time.time() - start_time), options.delay)))
Exemplo n.º 2
0
Arquivo: cli.py Projeto: Teifion/Rob3
def test_all(options):
	options.all = True
	
	tests(options)
	
	options.verbose = True
	
	the_world = spy_world.Spy_world(database.get_cursor())
	cli_f.output_ti(options, the_world, skip_upload=True)
	cli_f.output_to(options, the_world, skip_upload=True)
	cli_f.output_stats(options, the_world, skip_upload=True)
	cli_f.output_map(options, the_world, skip_upload=True)
	cli_f.output_wh(options, the_world, skip_upload=True)
	cli_f.output_oh(options, the_world, skip_upload=True)
	cli_f.output_spyrep(options, the_world, skip_upload=True)
	cli_f.output_tmap(options, the_world, skip_upload=True)
	cli_f.output_json(options, skip_upload=True)
	
	funcs = (
		the_world.relations,
		the_world.border_history,
		# the_world.prep_for_orders(self):,
		# the_world.prep_for_to(self):,
		# the_world.prep_for_stats(self):,
		# the_world.prep_for_oh(self):,
		# the_world.prep_for_ti(self):,
		# the_world.prep_for_start(self):,
		# the_world.building_requirements(self):,
		# the_world._lookup(self, name, lower=False, force_requery=False):,
		the_world.artefacts_lookup,
		the_world.armies_lookup,
		the_world.buildings_lookup,
		the_world.cities_lookup,
		the_world.campaigns_lookup,
		the_world.deities_lookup,
		the_world.equipment_lookup,
		the_world.evolutions_lookup,
		the_world.operatives_lookup,
		the_world.powers_lookup,
		the_world.spells_lookup,
		the_world.techs_lookup,
		the_world.teams_lookup,
		the_world.squads_lookup,
		the_world.units_lookup,
		the_world.wonders_lookup,
		# the_world._build_lookup_from_team(self, name, force_requery=False):,
		# the_world._lookup_all_from_team(self, name, force_requery=False):,
		# the_world._lookup_from_team(self, name, team_id, force_requery=False):,
		# the_world.armies_lookup_from_team(self, team_id, force_requery=False):,
		# the_world.units_lookup_from_team(self, team_id, force_requery=False):,
		# the_world._dict(self, name, force_requery=False):,
		the_world.armies,
		the_world.artefacts,
		the_world.buildings,
		the_world.cities,
		the_world.campaigns,
		the_world.deities,
		the_world.equipment,
		the_world.evolutions,
		the_world.kills,
		the_world.servants,
		the_world.operatives,
		the_world.powers,
		the_world.players,
		the_world.spells,
		the_world.techs,
		the_world.squads,
		the_world.teams,
		the_world.units,
		# the_world.json_ti(self, team, turn, force_requery=False),
		the_world.wonders,
		# the_world._build_from_team(self, name, force_requery=False):,
		# the_world._all_from_team(self, name, force_requery=False):,
		# the_world._from_team(self, name, team_id, force_requery=False):,
		# the_world.armies_from_team(self, team_id, force_requery=False):,
		# the_world.cities_from_team(self, team_id, force_requery=False):,
		# the_world.kills_from_turn(self, team_id, force_requery=False):,
		# the_world.kills_from_camp(self, team_id, force_requery=False):,
		# the_world.players_from_team(self, team_id, force_requery=False):,
		# the_world.operatives_from_team(self, team_id, force_requery=False):,
		# the_world.squads_from_team(self, team_id, force_requery=False):,
		# the_world.units_from_team(self, team_id, force_requery=False):,
		# the_world.squads_lookup_from_army(self, army_id, force_requery=False):,
		the_world.cities_with_wonders,
		the_world.cities_with_artefacts,
		the_world.active_teams,
		the_world.live_cities,
		# the_world.live_cities_from_team(self, team_id, force_requery=False):,,
		
		# armies_by_base(self, base, force_requery=False)
		# armies_in_area(self, area, radius=10, force_requery=False)
		# operatives_in_area(self, area, radius=10, force_requery=False)
		# operatives_in_city(self, city_id, force_requery=False)
		# cities_in_area(self, area, radius=10, force_requery=False)
		# race_difference(self, race_1, race_2)
	)
	
	for f in cli_f.progressbar(funcs, "Testing world: ", 60, True):
		f()
Exemplo n.º 3
0
Arquivo: cli.py Projeto: Teifion/Rob3
	elif options.mode.lower() == "fix":				sync(options, fix=True)
	elif options.mode.lower() == "continents":		continents(options)
	elif options.mode.lower() == "convert":			db_convert(options)
	elif options.mode.lower() == "check":			check(options)
	elif options.mode.lower() == "checkall":		check_all(options)
	
	elif options.mode.lower() == "report":			reports(options)
	elif options.mode.lower() == "reports":			reports(options)
	elif options.mode.lower() == "int_topics":		int_topics(options)
	elif options.mode.lower() == "result_topics":	result_topics(options)
	elif options.mode.lower() == "new_cities":		new_cities(options)
	elif options.mode.lower() == "profile":			profile(options)
	
	elif options.mode.lower() == "spyrep":			cli_f.output_spyrep(options)
	elif options.mode.lower() == "stats":			cli_f.output_stats(options)
	elif options.mode.lower() == "map":				cli_f.output_map(options)
	elif options.mode.lower() == "tmap":			cli_f.output_tmap(options)
	elif options.mode.lower() == "ti":				cli_f.output_ti(options)
	elif options.mode.lower() == "oh":				cli_f.output_oh(options)
	elif options.mode.lower() == "wh":				cli_f.output_wh(options)
	elif options.mode.lower() == "to":				cli_f.output_to(options)
	elif options.mode.lower() == "json":			cli_f.output_json(options)
	elif options.mode.lower() == "all":				output_all(options)
	elif options.mode.lower() == "nightly":			output_all(options, nightly=True)
	
	elif options.mode.lower() == "testall":			test_all(options)
	
	elif options.mode.lower() == "backup":			backup(options)
	
	elif options.mode.lower() == "requests":		requests(options)
	elif options.mode.lower() == "fr":				find_requests(options)