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
=== modified file 'cheers/datastore.py'
--- cheers/datastore.py 2010-11-06 19:29:15 +0000
+++ cheers/datastore.py 2010-11-14 21:36:26 +0000
@@ -113,4 +113,3 @@
113 if trophy.has_key("trophyset") and trophy["trophyset"] == setname:113 if trophy.has_key("trophyset") and trophy["trophyset"] == setname:
114 yield trophy114 yield trophy
115115
116dcs = DesktopCouchStore()
117116
=== modified file 'cheers/logic.py'
--- cheers/logic.py 2010-11-07 14:48:06 +0000
+++ cheers/logic.py 2010-11-14 21:36:26 +0000
@@ -122,7 +122,8 @@
122122
123 def get_awarded_trophies(self):123 def get_awarded_trophies(self):
124 """ Fetch all the trophies which have been awarded """124 """ Fetch all the trophies which have been awarded """
125 pass125 trophy_list = self.__store.get_awarded_trophies()
126 return [datamodel.TrophyDBus(trophy) for trophy in trophy_list]
126127
127 def get_sets(self, ids):128 def get_sets(self, ids):
128 """ Get all the trophy sets in cheers """129 """ Get all the trophy sets in cheers """
@@ -142,9 +143,11 @@
142143
143 def get_trophies_by_app(self, appname):144 def get_trophies_by_app(self, appname):
144 """ Get all the trophies associated with a particular application """145 """ Get all the trophies associated with a particular application """
145 pass146 trophy_list = self.__store.get_trophies_by_app(appname)
147 return [datamodel.TrophyDBus(trophy) for trophy in trophy_list]
146148
147 def get_trophies_by_set(self, setname):149 def get_trophies_by_set(self, setname):
148 """ Get all the trophies associated with a parciular trophy set """150 """ Get all the trophies associated with a parciular trophy set """
149 pass151 trophy_list = self.__store.get_trophies_by_set(setname)
152 return [datamodel.TrophyDBus(trophy) for trophy in trophy_list]
150153
151154
=== modified file 'cheers/server.py'
--- cheers/server.py 2010-11-07 14:48:06 +0000
+++ cheers/server.py 2010-11-14 21:36:26 +0000
@@ -66,7 +66,7 @@
6666
67 return self.logic.get_sets(setid_list)67 return self.logic.get_sets(setid_list)
68 68
69 @dbus.service.method(config.CHEERS_BUS_NAME)69 @dbus.service.method(config.CHEERS_BUS_NAME, out_signature='a(saasaasssssb)')
70 def GetAwardedTrophies(self):70 def GetAwardedTrophies(self):
71 """ Get the list of all the awarded trophies in cheers """71 """ Get the list of all the awarded trophies in cheers """
7272
@@ -96,11 +96,13 @@
9696
97 res = self.logic.unaward_trophy(id)97 res = self.logic.unaward_trophy(id)
9898
99 @dbus.service.method(config.CHEERS_BUS_NAME, out_signature='a(saasaasssssb)')
99 def GetTrophiesByApp(self, appname):100 def GetTrophiesByApp(self, appname):
100 """ Get all the trophies registered for a specific application """101 """ Get all the trophies registered for a specific application """
101102
102 return self.logic.get_trophies_by_app(appname)103 return self.logic.get_trophies_by_app(appname)
103104
105 @dbus.service.method(config.CHEERS_BUS_NAME, out_signature='a(saasaasssssb)')
104 def GetTrophyBySet(self, setname):106 def GetTrophyBySet(self, setname):
105 """ Get all the trophies registsred for a specific set """107 """ Get all the trophies registsred for a specific set """
106108

Subscribers

People subscribed via source and target branches

to all changes: