Merge lp:~tvec623/ubuntu-desktop-accomplishments/20120903-sudoku-accomplishment into lp:ubuntu-desktop-accomplishments

Proposed by Tony Vec
Status: Rejected
Rejected by: Matt Fischer
Proposed branch: lp:~tvec623/ubuntu-desktop-accomplishments/20120903-sudoku-accomplishment
Merge into: lp:ubuntu-desktop-accomplishments
Diff against target: 246 lines (+191/-0)
10 files modified
CATEGORIES (+1/-0)
Changelog (+1/-0)
accomplishments/ubuntu-desktop/en/gaming/sudoku_easy.accomplishment (+13/-0)
accomplishments/ubuntu-desktop/en/gaming/sudoku_hard.accomplishment (+13/-0)
accomplishments/ubuntu-desktop/en/gaming/sudoku_medium.accomplishment (+13/-0)
accomplishments/ubuntu-desktop/en/gaming/sudoku_very_hard.accomplishment (+13/-0)
scripts/ubuntu-desktop/gaming/sudoku_easy.py (+34/-0)
scripts/ubuntu-desktop/gaming/sudoku_hard.py (+34/-0)
scripts/ubuntu-desktop/gaming/sudoku_medium.py (+34/-0)
scripts/ubuntu-desktop/gaming/sudoku_very_hard.py (+35/-0)
To merge this branch: bzr merge lp:~tvec623/ubuntu-desktop-accomplishments/20120903-sudoku-accomplishment
Reviewer Review Type Date Requested Status
Rafał Cieślak Needs Fixing
Matt Fischer Needs Fixing
Review via email: mp+122606@code.launchpad.net

Description of the change

Added: 4 accomplishments: Accomplishment checks if user has completed the four levels in Sudoku.
Fixed: removed Shotwell Accomplishment and improved categories by switching to "Gaming:Sudoku"

To post a comment you must log in.
Revision history for this message
Matt Fischer (mfisch) wrote :

Sorry for the delay. I don't see any shotwell changes here, did you miss them?

review: Needs Fixing
Revision history for this message
Rafał Cieślak (rafalcieslak256) wrote :

Matt, there are no changes needed for the Shotwell accomplishment, Tony meant he fixed the fact that it was needlessly added in his previous MP.
I have reviewed these accomplishments and they seem very fine. The scripts are all correct, and metadata is fine.

One last thing that needs fixing is the category. Currently it's "Gaming:Sudoku", but other accomplishments use "Games:...", and therefore, to maintain consistency, sudoku accomplishments should use "Games:Sudoku".

Thanks for this work, Tony. A future tip: when you need to fix something in a MP, do not create a new branch and a separate MP, please commit changes to the same branch you have used for last MP and push changes there, they will be appended to the very same pending MP. This way we are less likely to miss your changes.

review: Needs Fixing
Revision history for this message
Matt Fischer (mfisch) wrote :

Tony,

Thanks for your work on this. Daniel picked up the code and is merging it in a new MP now and you will still get credit.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CATEGORIES'
2--- CATEGORIES 2012-05-19 18:08:54 +0000
3+++ CATEGORIES 2012-09-04 01:44:18 +0000
4@@ -4,3 +4,4 @@
5
6 Audio and Video
7 Games
8+Multimedia
9
10=== modified file 'Changelog'
11--- Changelog 2012-08-16 00:40:29 +0000
12+++ Changelog 2012-09-04 01:44:18 +0000
13@@ -13,3 +13,4 @@
14
15 * Bug #1036960: Wrong Information in "Shared With Accomplishment Service" Accomplishment (BenHagan)
16 * Bug #1013161: "Shared With Accomplishments Service" accomplishment is not fully defined (BenHagan )
17+ * New feature: Sudoku Accomplishments added (Tony Vec)
18
19=== added file 'accomplishments/ubuntu-desktop/en/gaming/sudoku_easy.accomplishment'
20--- accomplishments/ubuntu-desktop/en/gaming/sudoku_easy.accomplishment 1970-01-01 00:00:00 +0000
21+++ accomplishments/ubuntu-desktop/en/gaming/sudoku_easy.accomplishment 2012-09-04 01:44:18 +0000
22@@ -0,0 +1,13 @@
23+[accomplishment]
24+title=Rookie Sudoku Player
25+description=Win a Easy game of Sudoku
26+collection=ubuntu-desktop
27+category=Gaming:Sudoku
28+icon=default.png
29+summary = You can achieve this accomplishment by completing a game of Sudoku in the <b>Easy</b> difficulty .
30+steps: Start Sudoku.
31+ Select Easy game.
32+ Fill out all the squares until the whole board is completed
33+tips = There's no time limit, so no need to rush.
34+ You can get extra help from sudoku's help menu (F1).
35+author = Tony Vec <tvec623@gmail.com>
36
37=== added file 'accomplishments/ubuntu-desktop/en/gaming/sudoku_hard.accomplishment'
38--- accomplishments/ubuntu-desktop/en/gaming/sudoku_hard.accomplishment 1970-01-01 00:00:00 +0000
39+++ accomplishments/ubuntu-desktop/en/gaming/sudoku_hard.accomplishment 2012-09-04 01:44:18 +0000
40@@ -0,0 +1,13 @@
41+[accomplishment]
42+title=All Star Sudoku Player
43+description=Win a game of Sudoku in Hard
44+collection=ubuntu-desktop
45+category=Gaming:Sudoku
46+icon=default.png
47+summary = You can achieve this accomplishment by completing a game of Sudoku in the <b>Hard</b> difficulty .
48+steps: Start Sudoku.
49+ Select Hard game.
50+ Fill out all the squares until the whole board is completed
51+tips = There's no time limit, so no need to rush.
52+ You can get extra help from sudoku's help menu (F1).
53+author = Tony Vec <tvec623@gmail.com>
54
55=== added file 'accomplishments/ubuntu-desktop/en/gaming/sudoku_medium.accomplishment'
56--- accomplishments/ubuntu-desktop/en/gaming/sudoku_medium.accomplishment 1970-01-01 00:00:00 +0000
57+++ accomplishments/ubuntu-desktop/en/gaming/sudoku_medium.accomplishment 2012-09-04 01:44:18 +0000
58@@ -0,0 +1,13 @@
59+[accomplishment]
60+title=Pro Sudoku Player
61+description=Win a medium game of Sudoku
62+collection=ubuntu-desktop
63+category=Gaming:Sudoku
64+icon=default.png
65+summary = You can achieve this accomplishment by completing a game of Sudoku in the <b>Medium</b> difficulty .
66+steps: Start Sudoku.
67+ Select Medium game.
68+ Fill out all the squares until the whole board is completed
69+tips = There's no time limit, so no need to rush.
70+ You can get extra help from sudoku's help menu (F1).
71+author = Tony Vec <tvec623@gmail.com>
72
73=== added file 'accomplishments/ubuntu-desktop/en/gaming/sudoku_very_hard.accomplishment'
74--- accomplishments/ubuntu-desktop/en/gaming/sudoku_very_hard.accomplishment 1970-01-01 00:00:00 +0000
75+++ accomplishments/ubuntu-desktop/en/gaming/sudoku_very_hard.accomplishment 2012-09-04 01:44:18 +0000
76@@ -0,0 +1,13 @@
77+[accomplishment]
78+title=Sudoku Master
79+description=Win a game of Sudoku wtih the Very Hard difficulty
80+collection=ubuntu-desktop
81+category=Gaming:Sudoku
82+icon=default.png
83+summary = You can achieve this accomplishment by completing a game of Sudoku in the <b>Very Hard</b> difficulty .
84+steps: Start Sudoku.
85+ Select Very Hard game.
86+ Fill out all the squares until the whole board is completed
87+tips = There's no time limit, so no need to rush.
88+ You can get extra help from sudoku's help menu (F1).
89+author = Tony Vec <tvec623@gmail.com>
90
91=== added file 'scripts/ubuntu-desktop/gaming/sudoku_easy.py'
92--- scripts/ubuntu-desktop/gaming/sudoku_easy.py 1970-01-01 00:00:00 +0000
93+++ scripts/ubuntu-desktop/gaming/sudoku_easy.py 2012-09-04 01:44:18 +0000
94@@ -0,0 +1,34 @@
95+#!/usr/bin/python
96+import sys
97+import os
98+
99+homeDir = os.getenv('HOME')
100+sudoku_path = os.path.join(homeDir,'.config/gnome-sudoku/puzzles/')
101+
102+
103+def get_finished_levels():
104+ #Should save last finished results if already checked
105+ #for now, just start with 0
106+ last_checked = 0
107+ try:
108+ with open(sudoku_path+'finished') as finished:
109+ return (list(finished)[last_checked:])
110+ except IOError as e:
111+ #file does not exist
112+ sys.exit(1)
113+
114+#games have a '/n' for next games. Truncate before checking
115+finished_games = get_finished_levels()
116+
117+try:
118+ with open(sudoku_path+'easy') as f:
119+ easy = f.read()
120+ for game in finished_games:
121+ if game[:-2] in easy:
122+ #easy game has been completed
123+ sys.exit(0)
124+ #No completed games found in easy
125+ sys.exit(1)
126+except IOError as e:
127+ #list of game difficulty does not exist
128+ sys.exit(1)
129
130=== added file 'scripts/ubuntu-desktop/gaming/sudoku_hard.py'
131--- scripts/ubuntu-desktop/gaming/sudoku_hard.py 1970-01-01 00:00:00 +0000
132+++ scripts/ubuntu-desktop/gaming/sudoku_hard.py 2012-09-04 01:44:18 +0000
133@@ -0,0 +1,34 @@
134+#!/usr/bin/python
135+import sys
136+import os
137+
138+homeDir = os.getenv('HOME')
139+sudoku_path = os.path.join(homeDir,'.config/gnome-sudoku/puzzles/')
140+
141+
142+def get_finished_levels():
143+ #Should save last finished results if already checked
144+ #for now, just start with 0
145+ last_checked = 0
146+ try:
147+ with open(sudoku_path+'finished') as finished:
148+ return (list(finished)[last_checked:])
149+ except IOError as e:
150+ #file does not exist
151+ sys.exit(1)
152+
153+#games have a '/n' for next games. Truncate before checking
154+finished_games = get_finished_levels()
155+
156+try:
157+ with open(sudoku_path+'hard') as f:
158+ hard = f.read()
159+ for game in finished_games:
160+ if game[:-2] in hard:
161+ #hard game has been completed
162+ sys.exit(0)
163+ #No completed games found in hard
164+ sys.exit(1)
165+except IOError as e:
166+ #list of game difficulty does not exist
167+ sys.exit(1)
168
169=== added file 'scripts/ubuntu-desktop/gaming/sudoku_medium.py'
170--- scripts/ubuntu-desktop/gaming/sudoku_medium.py 1970-01-01 00:00:00 +0000
171+++ scripts/ubuntu-desktop/gaming/sudoku_medium.py 2012-09-04 01:44:18 +0000
172@@ -0,0 +1,34 @@
173+#!/usr/bin/python
174+import sys
175+import os
176+
177+homeDir = os.getenv('HOME')
178+sudoku_path = os.path.join(homeDir,'.config/gnome-sudoku/puzzles/')
179+
180+
181+def get_finished_levels():
182+ #Should save last finished results if already checked
183+ #for now, just start with 0
184+ last_checked = 0
185+ try:
186+ with open(sudoku_path+'finished') as finished:
187+ return (list(finished)[last_checked:])
188+ except IOError as e:
189+ #file does not exist
190+ sys.exit(1)
191+
192+#games have a '/n' for next games. Truncate before checking
193+finished_games = get_finished_levels()
194+
195+try:
196+ with open(sudoku_path+'medium') as f:
197+ medium = f.read()
198+ for game in finished_games:
199+ if game[:-2] in medium:
200+ #medium game has been completed
201+ sys.exit(0)
202+ #No completed games found in medium
203+ sys.exit(1)
204+except IOError as e:
205+ #list of game difficulty does not exist
206+ sys.exit(1)
207
208=== added file 'scripts/ubuntu-desktop/gaming/sudoku_very_hard.py'
209--- scripts/ubuntu-desktop/gaming/sudoku_very_hard.py 1970-01-01 00:00:00 +0000
210+++ scripts/ubuntu-desktop/gaming/sudoku_very_hard.py 2012-09-04 01:44:18 +0000
211@@ -0,0 +1,35 @@
212+#!/usr/bin/python
213+import sys
214+import os
215+
216+homeDir = os.getenv('HOME')
217+sudoku_path = os.path.join(homeDir,'.config/gnome-sudoku/puzzles/')
218+
219+
220+def get_finished_levels():
221+ #Should save last finished results if already checked
222+ #for now, just start with 0
223+ last_checked = 0
224+ try:
225+ with open(sudoku_path+'finished') as finished:
226+ return (list(finished)[last_checked:])
227+ except IOError as e:
228+ #file does not exist
229+ sys.exit(1)
230+
231+
232+#games have a '/n' for next games. Truncate before checking
233+finished_games = get_finished_levels()
234+
235+try:
236+ with open(sudoku_path+'very_hard', 'r') as f:
237+ very_hard = f.read()
238+ for game in finished_games:
239+ if game[:-2] in very_hard:
240+ #vestructure pry hard game has been completed
241+ sys.exit(0)
242+ #No completed games found in very hard
243+ sys.exit(1)
244+except IOError as e:
245+ #list of game difficulty does not exist
246+ sys.exit(1)

Subscribers

People subscribed via source and target branches