From: Magnus Hagander Date: Mon, 22 Jun 2009 20:08:27 +0000 (+0200) Subject: Some python code-style changes X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=405f2656aa3953e2a1464f90897ff9115d875f1b;p=hamn.git Some python code-style changes --- diff --git a/generator.py b/generator.py index 9dad3ca..5ef1d38 100755 --- a/generator.py +++ b/generator.py @@ -85,8 +85,7 @@ INNER JOIN planet.posts ON planet.feeds.id=planet.posts.feed WHERE age(dat) < '1 month' AND team IS NULL AND approved AND NOT hidden GROUP BY name,blogurl,feedurl ORDER BY 4 DESC,1 LIMIT 20 """) - for feed in c.fetchall(): - self.topposters.append(PlanetFeed(feed)) + self.topposters = [PlanetFeed(feed) for feed in c.fetchall()] if len(self.topposters) < 2: self.topposters = [] c.execute(""" @@ -105,8 +104,7 @@ ON q_feeds.team=q_teams.team ORDER BY teamcount DESC, teamname, feedcount DESC, feedname; """) - for feed in c.fetchall(): - self.topteams.append(PlanetFeed(feed)) + self.topteams = [PlanetFeed(feed) for feed in c.fetchall()] if len(self.topteams) < 2: self.topteams = [] c.execute("""