diff options
author | martin.von.loewis <devnull@localhost> | 2009-10-23 19:05:50 +0000 |
---|---|---|
committer | martin.von.loewis <devnull@localhost> | 2009-10-23 19:05:50 +0000 |
commit | 05eefd35b7c4a96f424345ff1f6da494d2224ce2 (patch) | |
tree | 9d84f260f14c89d50fce8b3976187d5655dd4b2c /rpc.py | |
parent | 93bfb26ad444e4425b9480633519ce82794a2599 (diff) | |
download | decorator-05eefd35b7c4a96f424345ff1f6da494d2224ce2.tar.gz |
Update ratings RPC to new data structures.
Diffstat (limited to 'rpc.py')
-rw-r--r-- | rpc.py | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -94,10 +94,13 @@ def post_cheesecake_for_release(store, name, version, score_data, password): store.commit() def ratings(store, name, version, since): - result = store.all_ratings(name, version, since) - return [(row['name'], row['version'], - row['user_name'] if row['message'] else '', - int(time.mktime(row['date'].timetuple())), - row['rating'], - row['message'] if row['message'] else '') - for row in result] + ratings, comments = store.all_ratings(name, version, since) + for i, r in enumerate(ratings): + r = list(r) + r[3] = int(time.mktime(r[3].timetuple())) + ratings[i] = tuple(r) + for i, c in enumerate(comments): + c = list(c) + c[5] = int(time.mktime(c[5].timetuple())) + comments[i] = c + return ratings, comments |