Merge lp:~zilvador/ubuntu-desktop-accomplishments/sudoku-shotwell into lp:ubuntu-desktop-accomplishments

Proposed by Daniel Ejsing-Duun
Status: Merged
Merged at revision: 86
Proposed branch: lp:~zilvador/ubuntu-desktop-accomplishments/sudoku-shotwell
Merge into: lp:ubuntu-desktop-accomplishments
Diff against target: 294 lines (+225/-1)
12 files modified
Changelog (+8/-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 (+16/-0)
accomplishments/ubuntu-desktop/en/multimedia/musicinrhythmbox.accomplishment (+1/-1)
scripts/ubuntu-desktop/gaming/sudoku_easy.py (+26/-0)
scripts/ubuntu-desktop/gaming/sudoku_hard.py (+32/-0)
scripts/ubuntu-desktop/gaming/sudoku_medium.py (+32/-0)
scripts/ubuntu-desktop/gaming/sudoku_very_hard.py (+23/-0)
scripts/ubuntu-desktop/multimedia/importshotwell.py (+35/-0)
To merge this branch: bzr merge lp:~zilvador/ubuntu-desktop-accomplishments/sudoku-shotwell
Reviewer Review Type Date Requested Status
Matt Fischer Approve
Review via email: mp+140773@code.launchpad.net

Description of the change

A continuation of Tony Vec's work on the Sudoku accomplishment and the Shotwell accomplishment. Testing, code clean-up and a few corrections made to both scripts.

To post a comment you must log in.
63. By Daniel Ejsing-Duun

Merge with Shotwell Accomplishment

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

Please edit ChangeLog and add your name and Tony's name following the format in the file please.

review: Needs Fixing
64. By Daniel Ejsing-Duun

Updated Changelog

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

I tested shotwell and rookie sudoku, works great. +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Changelog'
--- Changelog 2012-12-07 18:05:53 +0000
+++ Changelog 2012-12-20 20:25:24 +0000
@@ -31,4 +31,12 @@
31 [Howard Chan]31 [Howard Chan]
32 * Changed accomplishment authors to avoid duplicates (LP: #1080346)32 * Changed accomplishment authors to avoid duplicates (LP: #1080346)
3333
34 [Tony Vec]
35 [Daniel Ejsing-Duun]
36 * Added a new accomplishment: Import To Shotwell
37 * Added a new accomplishment: Rookie Sudoku Player
38 * Added a new accomplishment: Pro Sudoku Player
39 * Added a new accomplishment: All Star Sudoku Player
40 * Added a new accomplishment: Sudoku Master
41
34-------------------------------------------------------------------------42-------------------------------------------------------------------------
3543
=== 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-12-20 20:25:24 +0000
@@ -0,0 +1,13 @@
1[accomplishment]
2title = Rookie Sudoku Player
3description = Win an easy game of Sudoku
4collection = ubuntu-desktop
5category = Games:Sudoku
6icon = default.png
7summary = You can achieve this accomplishment by completing a game of Sudoku on the <b>easy</b> difficulty.
8steps = Start Sudoku.
9 Select an easy game.
10 Fill out 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-12-20 20:25:24 +0000
@@ -0,0 +1,13 @@
1[accomplishment]
2title = All Star Sudoku Player
3description = Win a hard game of Sudoku
4collection = ubuntu-desktop
5category = Games:Sudoku
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 a hard game.
10 Fill out 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-12-20 20:25:24 +0000
@@ -0,0 +1,13 @@
1[accomplishment]
2title = Pro Sudoku Player
3description = Win a medium game of Sudoku
4collection = ubuntu-desktop
5category = Games:Sudoku
6icon = default.png
7summary = You can achieve this accomplishment by completing a game of Sudoku on the <b>medium</b> difficulty.
8steps = Start Sudoku.
9 Select medium game.
10 Fill out 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-12-20 20:25:24 +0000
@@ -0,0 +1,13 @@
1[accomplishment]
2title = Sudoku Master
3description = Win very hard a game of Sudoku
4collection = ubuntu-desktop
5category = Games:Sudoku
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 a very hard game.
10 Fill out 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-12-20 20:25:24 +0000
@@ -0,0 +1,16 @@
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> into 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 icon. Click on it.
13 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 to import and press <b>OK</b></li></ul>
14tips = Shotwell supports JPEG, PNG, TIFF, BMP, and RAW photo files. It even supports video files!
15pitfalls = Shotwell does not support GIF images.
16links = http://yorba.org/shotwell/help/
017
=== modified file 'accomplishments/ubuntu-desktop/en/multimedia/musicinrhythmbox.accomplishment'
--- accomplishments/ubuntu-desktop/en/multimedia/musicinrhythmbox.accomplishment 2012-06-10 11:46:06 +0000
+++ accomplishments/ubuntu-desktop/en/multimedia/musicinrhythmbox.accomplishment 2012-12-20 20:25:24 +0000
@@ -14,6 +14,6 @@
14 Right click the 'music' entry under library and choose 'import file...' for a single song or 'import folder...' for a folder of music14 Right click the 'music' entry under library and choose 'import file...' for a single song or 'import folder...' for a folder of music
15 Navigate to the folder or song desired15 Navigate to the folder or song desired
16tips = You can even buy music through Rhythmbox16tips = You can even buy music through Rhythmbox
17pitfalls = Using a network share could resultin Rhythmbox reporting that you have missing files if you have not mounted the share prior to launching Rhythmbox.17pitfalls = Using a network share could result in Rhythmbox reporting that you have missing files if you have not mounted the share prior to launching Rhythmbox.
18help = Click the <i>Help</i> menu.18help = Click the <i>Help</i> menu.
1919
2020
=== 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-12-20 20:25:24 +0000
@@ -0,0 +1,26 @@
1#!/usr/bin/python
2import sys, os
3
4homeDir = os.getenv('HOME')
5sudoku_path = os.path.join(homeDir,'.config/gnome-sudoku/puzzles/')
6
7try:
8 #Load all finished games
9 with open(sudoku_path+'finished', 'r') as finished:
10 finished_games = list(finished)
11 #Load all easy games
12 with open(sudoku_path+'easy', 'r') as f:
13 easy = f.read()
14 for game in finished_games:
15 #Lines in the files have a '/n' at the end.
16 #Truncate before matching the finished list
17 #with the list of easy games
18 if game[:-1] in easy:
19 #Easy game has been completed
20 sys.exit(0)
21 #No completed games found in easy
22 sys.exit(1)
23except IOError as e:
24 #File does not exist or
25 #List of game difficulty does not exist
26 sys.exit(1)
027
=== 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-12-20 20:25:24 +0000
@@ -0,0 +1,32 @@
1#!/usr/bin/python
2import sys, os
3
4homeDir = os.getenv('HOME')
5sudoku_path = os.path.join(homeDir,'.config/gnome-sudoku/puzzles/')
6
7
8def get_finished_levels():
9
10 try:
11 with open(sudoku_path+'finished', 'r') as finished:
12 return (list(finished))
13 except IOError as e:
14 #file does not exist
15 sys.exit(1)
16
17finished_games = get_finished_levels()
18
19try:
20 with open(sudoku_path+'hard', 'r') as f:
21 hard = f.read()
22 for game in finished_games:
23 #lines in the files have a '/n' at the end.
24 #Truncate before checking
25 if game[:-1] in hard:
26 #easy game has been completed
27 sys.exit(0)
28 #No completed games found in easy
29 sys.exit(1)
30except IOError as e:
31 #list of game difficulty does not exist
32 sys.exit(1)
033
=== 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-12-20 20:25:24 +0000
@@ -0,0 +1,32 @@
1#!/usr/bin/python
2import sys, os
3
4homeDir = os.getenv('HOME')
5sudoku_path = os.path.join(homeDir,'.config/gnome-sudoku/puzzles/')
6
7
8def get_finished_levels():
9
10 try:
11 with open(sudoku_path+'finished', 'r') as finished:
12 return (list(finished))
13 except IOError as e:
14 #file does not exist
15 sys.exit(1)
16
17finished_games = get_finished_levels()
18
19try:
20 with open(sudoku_path+'medium', 'r') as f:
21 medium = f.read()
22 for game in finished_games:
23 #lines in the files have a '/n' at the end.
24 #Truncate before checking
25 if game[:-1] in medium:
26 #easy game has been completed
27 sys.exit(0)
28 #No completed games found in easy
29 sys.exit(1)
30except IOError as e:
31 #list of game difficulty does not exist
32 sys.exit(1)
033
=== 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-12-20 20:25:24 +0000
@@ -0,0 +1,23 @@
1#!/usr/bin/python
2import sys, os
3
4homeDir = os.getenv('HOME')
5sudoku_path = os.path.join(homeDir,'.config/gnome-sudoku/puzzles/')
6
7try:
8 with open(sudoku_path+'finished', 'r') as finished:
9 finished_games = list(finished)
10 with open(sudoku_path+'very_hard', 'r') as f:
11 very_hard = f.read()
12 for game in finished_games:
13 #lines in the files have a '/n' at the end.
14 #Truncate before checking
15 if game[:-1] in very_hard:
16 #easy game has been completed
17 sys.exit(0)
18 #No completed games found in easy
19 sys.exit(1)
20except IOError as e:
21 #file does not exist or
22 #list of game difficulty does not exist
23 sys.exit(1)
024
=== 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-12-20 20:25:24 +0000
@@ -0,0 +1,35 @@
1#!/usr/bin/python
2import os, sqlite3, sys
3
4homeDir = os.getenv('HOME')
5path = os.path.join(homeDir,'.local/share/shotwell/data/photo.db')
6
7if os.path.exists(path):
8 #Connect to Shotwell library db
9 try:
10 db = sqlite3.connect(path)
11 except sqlite3.DatabaseError, e:
12 #Corrupted database file
13 print "It seems that the Shotwell database has been corrupted."
14 sys.exit(1)
15
16 cursor = db.cursor()
17
18 cursor.execute('SELECT count(id) FROM PhotoTable')
19 image_count = cursor.fetchone()
20
21 cursor.execute('SELECT count(id) FROM VideoTable')
22 video_count = cursor.fetchone()
23
24 #Close the cursor and database
25 cursor.close()
26 db.close()
27
28 if image_count[0] > 0 or video_count[0] > 0:
29 #The user has images or videos in Shotwell
30 sys.exit(0)
31 else:
32 #The user does not have images or videos in Shotwell
33 sys.exit(1)
34else:
35 sys.exit(1)

Subscribers

People subscribed via source and target branches