def on_request(): is_html = response.content_type == "text/html" if is_html and check_for_banana() and random.random() < 0.04: request.environ["usable_error_content"] = Downtime().render() abort(503) scoreboard = scores.get_game_status() c.js_preload.set("#game_status", scoreboard) c.visible_effects = {} c.state_changes = { "status": scoreboard, "inventory": collections.defaultdict(list), "effects": collections.defaultdict(lambda: collections.defaultdict(list)), "myeffects": collections.defaultdict(list), } check_for_drops() if c.user_is_loggedin: find_effects([c.user._fullname]) c.js_preload.set("#myeffects", effects.get_my_effects(c.user)) c.js_preload.set("#inventory", inventory.get_inventory(c.user))
def on_request(): is_html = response.content_type == 'text/html' if is_html and check_for_banana() and random.random() < 0.04: request.environ["usable_error_content"] = Downtime().render() abort(503) scoreboard = scores.get_game_status() c.js_preload.set("#game_status", scoreboard) c.visible_effects = {} c.state_changes = { "status": scoreboard, "inventory": collections.defaultdict(list), "effects": collections.defaultdict(lambda: collections.defaultdict(list)), "myeffects": collections.defaultdict(list), } check_for_drops() if c.user_is_loggedin: find_effects([c.user._fullname]) c.js_preload.set("#myeffects", effects.get_my_effects(c.user)) c.js_preload.set("#inventory", inventory.get_inventory(c.user))
def __init__(self, listing): self.listing = listing self.scores = scores.get_game_status() Templated.__init__(self)