Merge lp:~gary-lasker/software-center/license-fix-lp864706 into lp:software-center

Proposed by Gary Lasker
Status: Merged
Merged at revision: 2486
Proposed branch: lp:~gary-lasker/software-center/license-fix-lp864706
Merge into: lp:software-center
Diff against target: 110 lines (+26/-5)
5 files modified
debian/changelog (+7/-1)
softwarecenter/db/application.py (+5/-1)
softwarecenter/db/update.py (+7/-2)
softwarecenter/distro/Ubuntu.py (+6/-1)
softwarecenter/enums.py (+1/-0)
To merge this branch: bzr merge lp:~gary-lasker/software-center/license-fix-lp864706
Reviewer Review Type Date Requested Status
Michael Vogt Pending
Review via email: mp+78186@code.launchpad.net

Description of the change

The license type for commercial apps is now provided for Software Center after a recent update to the software-center-agent. Note that this new value is currently available only via the staging server, but is expected to be deployed to the production server soon (before Oneiric final).

This branch takes this license type information and displays it in the corresponding field in the app details view for commercial apps.

If no license type is provided by the server for a commercial app, then the license text now defaults to "Unknown". Previously, the default was "Proprietary", a value that is not always appropriate as detailed in the linked bug.

NOTE: This branch displays the raw license type text as received from the server. If these values are not always appropriate for display in the raw form, I'll need to tweak this further to display specific preset strings based on the value received from the server.

Thanks!

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2011-10-04 13:31:02 +0000
3+++ debian/changelog 2011-10-05 01:40:29 +0000
4@@ -19,6 +19,12 @@
5 * debian/control:
6 - add dependency on python-gobject-cairo to prevent crash
7 at startup (LP: #829067)
8+ * softwarecenter/db/application.py,
9+ softwarecenter/db/update.py,
10+ softwarecenter/distro/Ubuntu.py,
11+ softwarecenter/enums.py:
12+ - display the correct license type for commercial apps as
13+ specified via the software-center-agent (LP: #864706)
14
15 [ Matthew McGowan ]
16 * lp:~mmcg069/software-center/bug855666:
17@@ -27,7 +33,7 @@
18 - fix crash when data can not be parsed from the remote reviews server
19 LP: #858639
20
21- -- Gary Lasker <gary.lasker@canonical.com> Tue, 04 Oct 2011 01:10:09 -0400
22+ -- Gary Lasker <gary.lasker@canonical.com> Tue, 04 Oct 2011 21:03:47 -0400
23
24 software-center (5.0) oneiric; urgency=low
25
26
27=== modified file 'softwarecenter/db/application.py'
28--- softwarecenter/db/application.py 2011-09-29 02:25:29 +0000
29+++ softwarecenter/db/application.py 2011-10-05 01:40:29 +0000
30@@ -336,7 +336,11 @@
31
32 @property
33 def license(self):
34- return self._distro.get_license_text(self.component)
35+ xapian_license = self._doc.get_value(XapianValues.LICENSE)
36+ if xapian_license:
37+ return xapian_license
38+ else:
39+ return self._distro.get_license_text(self.component)
40
41 @property
42 def maintenance_status(self):
43
44=== modified file 'softwarecenter/db/update.py'
45--- softwarecenter/db/update.py 2011-09-23 11:48:29 +0000
46+++ softwarecenter/db/update.py 2011-10-05 01:40:29 +0000
47@@ -141,6 +141,7 @@
48 'Channel' : 'channel',
49 'Deb-Line' : 'deb_line',
50 'Signing-Key-Id' : 'signing_key_id',
51+ 'License' : 'license',
52 'Purchased-Date' : 'purchase_date',
53 'License-Key' : 'license_key',
54 'License-Key-Path' : 'license_key_path',
55@@ -148,7 +149,7 @@
56 'Icon' : 'icon',
57 'Screenshot-Url' : 'screenshot_url',
58 'Thumbnail-Url' : 'thumbnail_url',
59- 'Icon-Url' : 'icon_url',
60+ 'Icon-Url' : 'icon_url',
61 }
62
63 # map from requested key to a static data element
64@@ -644,10 +645,14 @@
65 archive_channel = parser.get_desktop("X-AppInstall-Channel")
66 doc.add_term("AH"+archive_channel)
67 doc.add_value(XapianValues.ARCHIVE_CHANNEL, archive_channel)
68- # singing key (third party)
69+ # signing key (third party)
70 if parser.has_option_desktop("X-AppInstall-Signing-Key-Id"):
71 keyid = parser.get_desktop("X-AppInstall-Signing-Key-Id")
72 doc.add_value(XapianValues.ARCHIVE_SIGNING_KEY_ID, keyid)
73+ # license (third party)
74+ if parser.has_option_desktop("X-AppInstall-License"):
75+ license = parser.get_desktop("X-AppInstall-License")
76+ doc.add_value(XapianValues.LICENSE, license)
77 # purchased date
78 if parser.has_option_desktop("X-AppInstall-Purchased-Date"):
79 date = parser.get_desktop("X-AppInstall-Purchased-Date")
80
81=== modified file 'softwarecenter/distro/Ubuntu.py'
82--- softwarecenter/distro/Ubuntu.py 2011-09-29 14:06:47 +0000
83+++ softwarecenter/distro/Ubuntu.py 2011-10-05 01:40:29 +0000
84@@ -100,8 +100,13 @@
85 def get_license_text(self, component):
86 if component in ("main", "universe", "independent"):
87 return _("Open source")
88- elif component in ("restricted", "commercial"):
89+ elif component == "restricted":
90 return _("Proprietary")
91+ else:
92+ # commercial apps provide license info via the software-center-agent,
93+ # but if a given commercial app does not provide this for some reason,
94+ # default to a license type of "Unknown"
95+ return _("Unknown")
96
97 def is_supported(self, cache, doc, pkgname):
98 # the doc does not by definition contain correct data regarding the
99
100=== modified file 'softwarecenter/enums.py'
101--- softwarecenter/enums.py 2011-09-20 15:27:19 +0000
102+++ softwarecenter/enums.py 2011-10-05 01:40:29 +0000
103@@ -123,6 +123,7 @@
104 CATEGORIES = 191
105 LICENSE_KEY = 192
106 LICENSE_KEY_PATH = 193 # no longer used
107+ LICENSE = 194
108
109 # fake channels
110 PURCHASED_NEEDS_REINSTALL_MAGIC_CHANNEL_NAME = "for-pay-needs-reinstall"

Subscribers

People subscribed via source and target branches