Merge lp:~cheers/cheers/getawardedtrophies-gettrophybyapp-gettrophybyset into lp:cheers

Status: Merged
Merged at revision: 20
Proposed branch: lp:~cheers/cheers/getawardedtrophies-gettrophybyapp-gettrophybyset
Merge into: lp:cheers
Diff against target: 62 lines (+9/-5)
3 files modified
cheers/datastore.py (+0/-1)
cheers/logic.py (+6/-3)
cheers/server.py (+3/-1)
To merge this branch: bzr merge lp:~cheers/cheers/getawardedtrophies-gettrophybyapp-gettrophybyset
Reviewer Review Type Date Requested Status
Seif Lotfy code implementation Approve
Stuart Langridge Pending
Review via email: mp+40817@code.launchpad.net

Commit message

Implemented

* GetAwardedTrophies
* GetTrophiesByApp
* GetTrophiesBySet

Description of the change

Implemented

* GetAwardedTrophies
* GetTrophiesByApp
* GetTrophiesBySet

To post a comment you must log in.
Revision history for this message
Seif Lotfy (seif) wrote :

looks good to me. missing the DB part but all in all very good

review: Approve (code implementation)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cheers/datastore.py'
2--- cheers/datastore.py 2010-11-06 19:29:15 +0000
3+++ cheers/datastore.py 2010-11-14 21:36:26 +0000
4@@ -113,4 +113,3 @@
5 if trophy.has_key("trophyset") and trophy["trophyset"] == setname:
6 yield trophy
7
8-dcs = DesktopCouchStore()
9
10=== modified file 'cheers/logic.py'
11--- cheers/logic.py 2010-11-07 14:48:06 +0000
12+++ cheers/logic.py 2010-11-14 21:36:26 +0000
13@@ -122,7 +122,8 @@
14
15 def get_awarded_trophies(self):
16 """ Fetch all the trophies which have been awarded """
17- pass
18+ trophy_list = self.__store.get_awarded_trophies()
19+ return [datamodel.TrophyDBus(trophy) for trophy in trophy_list]
20
21 def get_sets(self, ids):
22 """ Get all the trophy sets in cheers """
23@@ -142,9 +143,11 @@
24
25 def get_trophies_by_app(self, appname):
26 """ Get all the trophies associated with a particular application """
27- pass
28+ trophy_list = self.__store.get_trophies_by_app(appname)
29+ return [datamodel.TrophyDBus(trophy) for trophy in trophy_list]
30
31 def get_trophies_by_set(self, setname):
32 """ Get all the trophies associated with a parciular trophy set """
33- pass
34+ trophy_list = self.__store.get_trophies_by_set(setname)
35+ return [datamodel.TrophyDBus(trophy) for trophy in trophy_list]
36
37
38=== modified file 'cheers/server.py'
39--- cheers/server.py 2010-11-07 14:48:06 +0000
40+++ cheers/server.py 2010-11-14 21:36:26 +0000
41@@ -66,7 +66,7 @@
42
43 return self.logic.get_sets(setid_list)
44
45- @dbus.service.method(config.CHEERS_BUS_NAME)
46+ @dbus.service.method(config.CHEERS_BUS_NAME, out_signature='a(saasaasssssb)')
47 def GetAwardedTrophies(self):
48 """ Get the list of all the awarded trophies in cheers """
49
50@@ -96,11 +96,13 @@
51
52 res = self.logic.unaward_trophy(id)
53
54+ @dbus.service.method(config.CHEERS_BUS_NAME, out_signature='a(saasaasssssb)')
55 def GetTrophiesByApp(self, appname):
56 """ Get all the trophies registered for a specific application """
57
58 return self.logic.get_trophies_by_app(appname)
59
60+ @dbus.service.method(config.CHEERS_BUS_NAME, out_signature='a(saasaasssssb)')
61 def GetTrophyBySet(self, setname):
62 """ Get all the trophies registsred for a specific set """
63

Subscribers

People subscribed via source and target branches

to all changes: