def get(self): user=self.request.get("name") p = tron_db.Program.all().filter("name",user).get() if not p: self.response.out.write( sorry_404("botcode for " + user) ) return self.response.out.write( header("SourceCode for '" + user + "'") ) self.response.out.write( "<br><p>" ) self.response.out.write( "<pre>" ) self.response.out.write( p.text ) self.response.out.write( "</pre>" ) self.response.out.write( "<br>" ) self.response.out.write( footer() )
def get(self): user=self.request.get("name") if not user: self.response.out.write( sorry_404("user " + user) ) return r = tron_db.Program.all().filter("name",user).get() self.response.out.write( header("Profile for '" + user + "'") ) self.response.out.write( "<table>" ) self.response.out.write( tron_db.Program_head ) self.response.out.write( r.html() ) self.response.out.write( "</table></div>" ) self.response.out.write( "<br>" ) query = tron_db.GameInfo.all().filter("players in", [user]) offs = get_offset(self.request) game_table( self.response, query.order('-date').fetch(TABSIZE,offs) ) self.response.out.write( table_pager( "/games/",query.count()) + "<p>" ) self.response.out.write( footer() )
def get(self): key = self.request.get("key") try: w = self.request.get("w") h = self.request.get("h") except: pass if not w : w=400 if not h : h=400 game = tron_db.GameInfo.get_by_id(int(key)) if not game: self.response.out.write( sorry_404( "game " + key ) ) return s = header() map = tron_db.Map.get_by_key_name(game.mapname) s += drawReplay(key,game.players,game.history,game.errors,game.rank,game.mapname,map.text,game.turn,w,h) s += footer() self.response.out.write( s )