Merge lp:~james-w/pkgme/add-path-to-desktop into lp:pkgme

Proposed by James Westby
Status: Merged
Approved by: Michael Vogt
Approved revision: 119
Merged at revision: 120
Proposed branch: lp:~james-w/pkgme/add-path-to-desktop
Merge into: lp:pkgme
Diff against target: 80 lines (+19/-1)
4 files modified
pkgme/info_elements.py (+7/-1)
pkgme/package_files.py (+2/-0)
pkgme/templates/desktop (+3/-0)
pkgme/tests/test_package_files.py (+7/-0)
To merge this branch: bzr merge lp:~james-w/pkgme/add-path-to-desktop
Reviewer Review Type Date Requested Status
Michael Vogt (community) Approve
Review via email: mp+115409@code.launchpad.net

Commit message

Add WorkingDirectory to use as Path in the .desktop file (for bug #1025174)

Description of the change

Hi,

In https://bugs.launchpad.net/pkgme-devportal/+bug/1025174 mvo says that we
should set Path in the .desktop file. This allows the backend to specify
a value if they want.

Thanks,

James

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks, this looks fine to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'pkgme/info_elements.py'
2--- pkgme/info_elements.py 2012-07-05 13:42:09 +0000
3+++ pkgme/info_elements.py 2012-07-17 18:34:49 +0000
4@@ -328,6 +328,12 @@
5 description = "A short line describing the application."
6
7
8+class WorkingDirectory(InfoElement):
9+
10+ name = 'working_directory'
11+ description = "The working directory that should be set in the desktop file."
12+
13+
14 class Icon(InfoElement):
15
16 name = 'icon'
17@@ -338,7 +344,7 @@
18
19 name = 'license'
20 default = 'unknown'
21- description = """The license of the files in the package.
22+ description = """The license of the files in the package.
23
24 Note that this will only apply for "simple" cases where there
25 is just a single license type. Otherwise it will just write
26
27=== modified file 'pkgme/package_files.py'
28--- pkgme/package_files.py 2012-07-16 17:50:39 +0000
29+++ pkgme/package_files.py 2012-07-17 18:34:49 +0000
30@@ -27,6 +27,7 @@
31 Section,
32 TagLine,
33 Version,
34+ WorkingDirectory,
35 )
36 from pkgme.project_info import DictInfo
37 from pkgme.template_file import TemplateFile
38@@ -263,6 +264,7 @@
39 Icon,
40 PackageName,
41 TagLine,
42+ WorkingDirectory,
43 ]
44
45 template = 'desktop'
46
47=== modified file 'pkgme/templates/desktop'
48--- pkgme/templates/desktop 2012-03-30 16:04:51 +0000
49+++ pkgme/templates/desktop 2012-07-17 18:34:49 +0000
50@@ -6,3 +6,6 @@
51 Categories=$categories
52 Name=$application_name
53 Comment=$tagline
54+#if $working_directory
55+Path=$working_directory
56+#end if
57
58=== modified file 'pkgme/tests/test_package_files.py'
59--- pkgme/tests/test_package_files.py 2012-07-16 17:50:39 +0000
60+++ pkgme/tests/test_package_files.py 2012-07-17 18:34:49 +0000
61@@ -27,6 +27,7 @@
62 Section,
63 TagLine,
64 Version,
65+ WorkingDirectory,
66 )
67 from pkgme.package_files import (
68 BasicFile,
69@@ -485,6 +486,12 @@
70 package_file = self.get_object({TagLine.name: tagline})
71 self.assertThat({'Comment': tagline}, AreDesktopValuesFor(package_file))
72
73+ def test_working_dir(self):
74+ # The WorkingDirectory is set as Path in the desktop file
75+ working_directory = self.getUniqueString()
76+ package_file = self.get_object({WorkingDirectory.name: working_directory})
77+ self.assertThat({'Path': working_directory}, AreDesktopValuesFor(package_file))
78+
79
80 class PackageFileGroupTests(TestCase):
81

Subscribers

People subscribed via source and target branches

to all changes: