def gameInfo(self, id): game = MyGame.get(id) t = Template(open(os.path.join(gametime.TMPL_DIR, "gameInfo.tmpl")).read()) t.game = game for provider in GAME_PROVIDERS.values(): t.__dict__[provider.site_id] = provider.get_one(game.get_provider_id(provider)) return munge(t)
def updateInfo(self, id, site_id, info_id=None, redirect=True): if site_id in GAME_PROVIDERS: provider = GAME_PROVIDERS[site_id] game = MyGame.get(id) if game: if not info_id: info_id = provider.get_match(game.title, game.system) if info_id: info = provider.get_info(game.id, info_id) if info: pprint(vars(info)) print "" provider.insert_or_update_in_db(info) game.set_provider_id(provider, info_id) game.update_info(provider, info) if redirect: raise cherrypy.HTTPRedirect("/#Game_{0}".format(id))
def updateGame(self, id, redirect=True): game = MyGame.get(id) for provider in GAME_PROVIDERS.values(): self.updateInfo(id, provider.site_id, game.get_provider_id(provider), False) if redirect: raise cherrypy.HTTPRedirect("/#Game_{0}".format(id))