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

Proposed by Tony Vec
Status: Rejected
Rejected by: Matt Fischer
Proposed branch: lp:~tvec623/ubuntu-desktop-accomplishments/20120827-sudoku-accomplishment
Merge into: lp:ubuntu-desktop-accomplishments
Diff against target: 309 lines (+244/-0)
12 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)
accomplishments/ubuntu-desktop/en/multimedia/importshotwell.accomplishment (+18/-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)
scripts/ubuntu-desktop/multimedia/importshotwell.py (+35/-0)
To merge this branch: bzr merge lp:~tvec623/ubuntu-desktop-accomplishments/20120827-sudoku-accomplishment
Reviewer Review Type Date Requested Status
Rafał Cieślak Needs Fixing
Review via email: mp+121459@code.launchpad.net

Description of the change

Added 4 accomplishments: Accomplishment checks if user has completed the four levels in Sudoku.

To post a comment you must log in.
Revision history for this message
Rafał Cieślak (rafalcieslak256) wrote :

Cool accomplishments! We were definitely lacking these ones. Great thanks for your work on them.

There are two small things that will need fixing before I merge this branch:

* Somehow the importshotwell accomplishment is included in this branch too. I guess that's accidental, as you have proposed a separate branch with them.
* The category your Sudoku accomplishments use is "Gaming". That's correct, but it would be cool if we grouped them to a sub-category withing gaming, named "Sudoku". To do this, you need to set their category to "Gaming:Sudoku".

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

Tony,

Any updates?

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

This was superseded by a later MP.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CATEGORIES'
--- CATEGORIES 2012-05-19 18:08:54 +0000
+++ CATEGORIES 2012-08-27 16:12:31 +0000
@@ -4,3 +4,4 @@
44
5Audio and Video5Audio and Video
6Games6Games
7Multimedia
78
=== modified file 'Changelog'
--- Changelog 2012-08-16 00:40:29 +0000
+++ Changelog 2012-08-27 16:12:31 +0000
@@ -13,3 +13,4 @@
1313
14 * Bug #1036960: Wrong Information in "Shared With Accomplishment Service" Accomplishment (BenHagan)14 * Bug #1036960: Wrong Information in "Shared With Accomplishment Service" Accomplishment (BenHagan)
15 * Bug #1013161: "Shared With Accomplishments Service" accomplishment is not fully defined (BenHagan )15 * Bug #1013161: "Shared With Accomplishments Service" accomplishment is not fully defined (BenHagan )
16 * New feature: Sudoku Accomplishments added (Tony Vec)
1617
=== added file 'accomplishments/ubuntu-desktop/en/gaming/sudoku_easy.accomplishment'
--- accomplishments/ubuntu-desktop/en/gaming/sudoku_easy.accomplishment 1970-01-01 00:00:00 +0000
+++ accomplishments/ubuntu-desktop/en/gaming/sudoku_easy.accomplishment 2012-08-27 16:12:31 +0000
@@ -0,0 +1,13 @@
1[accomplishment]
2title=Rookie Sudoku Player
3description=Win a Easy game of Sudoku
4collection=ubuntu-desktop
5category=Games
6icon=default.png
7summary = You can achieve this accomplishment by completing a game of Sudoku in the <b>Easy</b> difficulty .
8steps: Start Sudoku.
9 Select Easy game.
10 Fill out all the squares until the whole board is completed
11tips = There's no time limit, so no need to rush.
12 You can get extra help from sudoku's help menu (F1).
13author = Tony Vec <tvec623@gmail.com>
014
=== added file 'accomplishments/ubuntu-desktop/en/gaming/sudoku_hard.accomplishment'
--- accomplishments/ubuntu-desktop/en/gaming/sudoku_hard.accomplishment 1970-01-01 00:00:00 +0000
+++ accomplishments/ubuntu-desktop/en/gaming/sudoku_hard.accomplishment 2012-08-27 16:12:31 +0000
@@ -0,0 +1,13 @@
1[accomplishment]
2title=All Star Sudoku Player
3description=Win a game of Sudoku in Hard
4collection=ubuntu-desktop
5category=Games
6icon=default.png
7summary = You can achieve this accomplishment by completing a game of Sudoku in the <b>Hard</b> difficulty .
8steps: Start Sudoku.
9 Select Hard game.
10 Fill out all the squares until the whole board is completed
11tips = There's no time limit, so no need to rush.
12 You can get extra help from sudoku's help menu (F1).
13author = Tony Vec <tvec623@gmail.com>
014
=== added file 'accomplishments/ubuntu-desktop/en/gaming/sudoku_medium.accomplishment'
--- accomplishments/ubuntu-desktop/en/gaming/sudoku_medium.accomplishment 1970-01-01 00:00:00 +0000
+++ accomplishments/ubuntu-desktop/en/gaming/sudoku_medium.accomplishment 2012-08-27 16:12:31 +0000
@@ -0,0 +1,13 @@
1[accomplishment]
2title=Pro Sudoku Player
3description=Win a medium game of Sudoku
4collection=ubuntu-desktop
5category=Games
6icon=default.png
7summary = You can achieve this accomplishment by completing a game of Sudoku in the <b>Medium</b> difficulty .
8steps: Start Sudoku.
9 Select Medium game.
10 Fill out all the squares until the whole board is completed
11tips = There's no time limit, so no need to rush.
12 You can get extra help from sudoku's help menu (F1).
13author = Tony Vec <tvec623@gmail.com>
014
=== added file 'accomplishments/ubuntu-desktop/en/gaming/sudoku_very_hard.accomplishment'
--- accomplishments/ubuntu-desktop/en/gaming/sudoku_very_hard.accomplishment 1970-01-01 00:00:00 +0000
+++ accomplishments/ubuntu-desktop/en/gaming/sudoku_very_hard.accomplishment 2012-08-27 16:12:31 +0000
@@ -0,0 +1,13 @@
1[accomplishment]
2title=Sudoku Master
3description=Win a game of Sudoku wtih the Very Hard difficulty
4collection=ubuntu-desktop
5category=Games
6icon=default.png
7summary = You can achieve this accomplishment by completing a game of Sudoku in the <b>Very Hard</b> difficulty .
8steps: Start Sudoku.
9 Select Very Hard game.
10 Fill out all the squares until the whole board is completed
11tips = There's no time limit, so no need to rush.
12 You can get extra help from sudoku's help menu (F1).
13author = Tony Vec <tvec623@gmail.com>
014
=== added file 'accomplishments/ubuntu-desktop/en/multimedia/importshotwell.accomplishment'
--- accomplishments/ubuntu-desktop/en/multimedia/importshotwell.accomplishment 1970-01-01 00:00:00 +0000
+++ accomplishments/ubuntu-desktop/en/multimedia/importshotwell.accomplishment 2012-08-27 16:12:31 +0000
@@ -0,0 +1,18 @@
1[accomplishment]
2title = Import To Shotwell
3description = Import photos/videos into Shotwell Photo Manager
4category = Multimedia
5icon = default.png
6author = Tony Vec <tvec623@gmail.com>
7collection = ubuntu-desktop
8summary = Shotwell Photo Manager allows you to import, organize, view, and edit images
9 This accomplishment is awarded when you <b>import photos or videos</b> to your Shotwell library
10steps = Click the <i>Dash Home</i>
11 Enter <i>Shotwell Photo Manager</i>
12 You will be presented with the Shotwell application
13 Click the the icon
14 To import, you can: <ul><li>Drag and drop a folder/file onto the application; or</li><li> Go to <b>File</b> and choose <b>Import from folder...</b>; Select the folder you want imported and press <b>OK</b></li></ul>
15tips = Shotwell supports JPEG, PNG, TIFF, BMP, and RAW photo files. It even supports video files!
16pitfalls = Shotwell does not support GIF images.
17links = http://yorba.org/shotwell/help/
18
019
=== added file 'scripts/ubuntu-desktop/gaming/sudoku_easy.py'
--- scripts/ubuntu-desktop/gaming/sudoku_easy.py 1970-01-01 00:00:00 +0000
+++ scripts/ubuntu-desktop/gaming/sudoku_easy.py 2012-08-27 16:12:31 +0000
@@ -0,0 +1,34 @@
1#!/usr/bin/python
2import sys
3import os
4
5homeDir = os.getenv('HOME')
6sudoku_path = os.path.join(homeDir,'.config/gnome-sudoku/puzzles/')
7
8
9def get_finished_levels():
10 #Should save last finished results if already checked
11 #for now, just start with 0
12 last_checked = 0
13 try:
14 with open(sudoku_path+'finished') as finished:
15 return (list(finished)[last_checked:])
16 except IOError as e:
17 #file does not exist
18 sys.exit(1)
19
20#games have a '/n' for next games. Truncate before checking
21finished_games = get_finished_levels()
22
23try:
24 with open(sudoku_path+'easy') as f:
25 easy = f.read()
26 for game in finished_games:
27 if game[:-2] in easy:
28 #easy game has been completed
29 sys.exit(0)
30 #No completed games found in easy
31 sys.exit(1)
32except IOError as e:
33 #list of game difficulty does not exist
34 sys.exit(1)
035
=== added file 'scripts/ubuntu-desktop/gaming/sudoku_hard.py'
--- scripts/ubuntu-desktop/gaming/sudoku_hard.py 1970-01-01 00:00:00 +0000
+++ scripts/ubuntu-desktop/gaming/sudoku_hard.py 2012-08-27 16:12:31 +0000
@@ -0,0 +1,34 @@
1#!/usr/bin/python
2import sys
3import os
4
5homeDir = os.getenv('HOME')
6sudoku_path = os.path.join(homeDir,'.config/gnome-sudoku/puzzles/')
7
8
9def get_finished_levels():
10 #Should save last finished results if already checked
11 #for now, just start with 0
12 last_checked = 0
13 try:
14 with open(sudoku_path+'finished') as finished:
15 return (list(finished)[last_checked:])
16 except IOError as e:
17 #file does not exist
18 sys.exit(1)
19
20#games have a '/n' for next games. Truncate before checking
21finished_games = get_finished_levels()
22
23try:
24 with open(sudoku_path+'hard') as f:
25 hard = f.read()
26 for game in finished_games:
27 if game[:-2] in hard:
28 #hard game has been completed
29 sys.exit(0)
30 #No completed games found in hard
31 sys.exit(1)
32except IOError as e:
33 #list of game difficulty does not exist
34 sys.exit(1)
035
=== added file 'scripts/ubuntu-desktop/gaming/sudoku_medium.py'
--- scripts/ubuntu-desktop/gaming/sudoku_medium.py 1970-01-01 00:00:00 +0000
+++ scripts/ubuntu-desktop/gaming/sudoku_medium.py 2012-08-27 16:12:31 +0000
@@ -0,0 +1,34 @@
1#!/usr/bin/python
2import sys
3import os
4
5homeDir = os.getenv('HOME')
6sudoku_path = os.path.join(homeDir,'.config/gnome-sudoku/puzzles/')
7
8
9def get_finished_levels():
10 #Should save last finished results if already checked
11 #for now, just start with 0
12 last_checked = 0
13 try:
14 with open(sudoku_path+'finished') as finished:
15 return (list(finished)[last_checked:])
16 except IOError as e:
17 #file does not exist
18 sys.exit(1)
19
20#games have a '/n' for next games. Truncate before checking
21finished_games = get_finished_levels()
22
23try:
24 with open(sudoku_path+'medium') as f:
25 medium = f.read()
26 for game in finished_games:
27 if game[:-2] in medium:
28 #medium game has been completed
29 sys.exit(0)
30 #No completed games found in medium
31 sys.exit(1)
32except IOError as e:
33 #list of game difficulty does not exist
34 sys.exit(1)
035
=== added file 'scripts/ubuntu-desktop/gaming/sudoku_very_hard.py'
--- scripts/ubuntu-desktop/gaming/sudoku_very_hard.py 1970-01-01 00:00:00 +0000
+++ scripts/ubuntu-desktop/gaming/sudoku_very_hard.py 2012-08-27 16:12:31 +0000
@@ -0,0 +1,35 @@
1#!/usr/bin/python
2import sys
3import os
4
5homeDir = os.getenv('HOME')
6sudoku_path = os.path.join(homeDir,'.config/gnome-sudoku/puzzles/')
7
8
9def get_finished_levels():
10 #Should save last finished results if already checked
11 #for now, just start with 0
12 last_checked = 0
13 try:
14 with open(sudoku_path+'finished') as finished:
15 return (list(finished)[last_checked:])
16 except IOError as e:
17 #file does not exist
18 sys.exit(1)
19
20
21#games have a '/n' for next games. Truncate before checking
22finished_games = get_finished_levels()
23
24try:
25 with open(sudoku_path+'very_hard', 'r') as f:
26 very_hard = f.read()
27 for game in finished_games:
28 if game[:-2] in very_hard:
29 #vestructure pry hard game has been completed
30 sys.exit(0)
31 #No completed games found in very hard
32 sys.exit(1)
33except IOError as e:
34 #list of game difficulty does not exist
35 sys.exit(1)
036
=== added file 'scripts/ubuntu-desktop/multimedia/importshotwell.py'
--- scripts/ubuntu-desktop/multimedia/importshotwell.py 1970-01-01 00:00:00 +0000
+++ scripts/ubuntu-desktop/multimedia/importshotwell.py 2012-08-27 16:12:31 +0000
@@ -0,0 +1,35 @@
1#!/usr/bin/python
2import os
3import sqlite3
4import sys
5
6homeDir = os.getenv('HOME')
7path = os.path.join(homeDir,'.shotwell/data/photo.db')
8
9if os.path.exists(path):
10 #connect to Shotwell library db
11 db = sqlite3.connect(path)
12
13 photo_curs = db.cursor()
14 video_curs = db.cursor()
15
16 photo_curs.execute('SELECT count(id) FROM PhotoTable')
17 video_curs.execute('SELECT count(id) FROM VideoTable')
18
19 image_count = photo_curs.fetchone()
20 video_count = video_curs.fetchone()
21
22 #Close the cursor and Database
23 photo_curs.close()
24 video_curs.close()
25 db.close()
26
27 if image_count[0] > 0 or video_count[0] > 0:
28 #user has images in Shotwell
29 print image_count[0], video_count[0]
30 sys.exit(0)
31 else:
32 #user does not have images in Shotwell
33 sys.exit(1)
34else:
35 sys.exit(1)

Subscribers

People subscribed via source and target branches