Gentoo Archives: gentoo-commits

From: Vikraman Choudhury <vikraman.choudhury@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gentoostats:master commit in: server/
Date: Mon, 01 Aug 2011 23:04:10
Message-Id: 11e802b2f8d6cf1e6a8f460113c6a729a306d90a.vikraman@gentoo
1 commit: 11e802b2f8d6cf1e6a8f460113c6a729a306d90a
2 Author: Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
3 AuthorDate: Mon Aug 1 23:03:25 2011 +0000
4 Commit: Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
5 CommitDate: Mon Aug 1 23:03:25 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoostats.git;a=commit;h=11e802b2
7
8 allow exporting to json from search in server
9
10 ---
11 server/search.py | 11 ++++++++++-
12 1 files changed, 10 insertions(+), 1 deletions(-)
13
14 diff --git a/server/search.py b/server/search.py
15 index 7ddcded..d3d35d5 100644
16 --- a/server/search.py
17 +++ b/server/search.py
18 @@ -35,7 +35,16 @@ class Search(object):
19 'min_hosts':self.min_hosts,
20 'max_hosts':self.max_hosts})
21 if helpers.is_json_request():
22 - return helpers.serialize(search_tuples)
23 + search_list = list()
24 + for tuple in search_tuples:
25 + search_list.append({
26 + 'CAT': tuple['CAT'],
27 + 'PKG': tuple['PKG'],
28 + 'VER': tuple['VER'],
29 + 'REPO': tuple['REPO'],
30 + 'HOSTS': tuple['HOSTS']
31 + })
32 + return helpers.serialize(search_list)
33 else:
34 return render.search(search_tuples)