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
=== modified file 'debian/changelog'
--- debian/changelog 2011-10-04 13:31:02 +0000
+++ debian/changelog 2011-10-05 01:40:29 +0000
@@ -19,6 +19,12 @@
19 * debian/control:19 * debian/control:
20 - add dependency on python-gobject-cairo to prevent crash20 - add dependency on python-gobject-cairo to prevent crash
21 at startup (LP: #829067) 21 at startup (LP: #829067)
22 * softwarecenter/db/application.py,
23 softwarecenter/db/update.py,
24 softwarecenter/distro/Ubuntu.py,
25 softwarecenter/enums.py:
26 - display the correct license type for commercial apps as
27 specified via the software-center-agent (LP: #864706)
2228
23 [ Matthew McGowan ]29 [ Matthew McGowan ]
24 * lp:~mmcg069/software-center/bug855666:30 * lp:~mmcg069/software-center/bug855666:
@@ -27,7 +33,7 @@
27 - fix crash when data can not be parsed from the remote reviews server33 - fix crash when data can not be parsed from the remote reviews server
28 LP: #85863934 LP: #858639
2935
30 -- Gary Lasker <gary.lasker@canonical.com> Tue, 04 Oct 2011 01:10:09 -040036 -- Gary Lasker <gary.lasker@canonical.com> Tue, 04 Oct 2011 21:03:47 -0400
3137
32software-center (5.0) oneiric; urgency=low38software-center (5.0) oneiric; urgency=low
3339
3440
=== modified file 'softwarecenter/db/application.py'
--- softwarecenter/db/application.py 2011-09-29 02:25:29 +0000
+++ softwarecenter/db/application.py 2011-10-05 01:40:29 +0000
@@ -336,7 +336,11 @@
336336
337 @property337 @property
338 def license(self):338 def license(self):
339 return self._distro.get_license_text(self.component)339 xapian_license = self._doc.get_value(XapianValues.LICENSE)
340 if xapian_license:
341 return xapian_license
342 else:
343 return self._distro.get_license_text(self.component)
340344
341 @property345 @property
342 def maintenance_status(self):346 def maintenance_status(self):
343347
=== modified file 'softwarecenter/db/update.py'
--- softwarecenter/db/update.py 2011-09-23 11:48:29 +0000
+++ softwarecenter/db/update.py 2011-10-05 01:40:29 +0000
@@ -141,6 +141,7 @@
141 'Channel' : 'channel',141 'Channel' : 'channel',
142 'Deb-Line' : 'deb_line',142 'Deb-Line' : 'deb_line',
143 'Signing-Key-Id' : 'signing_key_id',143 'Signing-Key-Id' : 'signing_key_id',
144 'License' : 'license',
144 'Purchased-Date' : 'purchase_date',145 'Purchased-Date' : 'purchase_date',
145 'License-Key' : 'license_key',146 'License-Key' : 'license_key',
146 'License-Key-Path' : 'license_key_path',147 'License-Key-Path' : 'license_key_path',
@@ -148,7 +149,7 @@
148 'Icon' : 'icon',149 'Icon' : 'icon',
149 'Screenshot-Url' : 'screenshot_url',150 'Screenshot-Url' : 'screenshot_url',
150 'Thumbnail-Url' : 'thumbnail_url',151 'Thumbnail-Url' : 'thumbnail_url',
151 'Icon-Url' : 'icon_url',152 'Icon-Url' : 'icon_url',
152 }153 }
153154
154 # map from requested key to a static data element155 # map from requested key to a static data element
@@ -644,10 +645,14 @@
644 archive_channel = parser.get_desktop("X-AppInstall-Channel")645 archive_channel = parser.get_desktop("X-AppInstall-Channel")
645 doc.add_term("AH"+archive_channel)646 doc.add_term("AH"+archive_channel)
646 doc.add_value(XapianValues.ARCHIVE_CHANNEL, archive_channel)647 doc.add_value(XapianValues.ARCHIVE_CHANNEL, archive_channel)
647 # singing key (third party)648 # signing key (third party)
648 if parser.has_option_desktop("X-AppInstall-Signing-Key-Id"):649 if parser.has_option_desktop("X-AppInstall-Signing-Key-Id"):
649 keyid = parser.get_desktop("X-AppInstall-Signing-Key-Id")650 keyid = parser.get_desktop("X-AppInstall-Signing-Key-Id")
650 doc.add_value(XapianValues.ARCHIVE_SIGNING_KEY_ID, keyid)651 doc.add_value(XapianValues.ARCHIVE_SIGNING_KEY_ID, keyid)
652 # license (third party)
653 if parser.has_option_desktop("X-AppInstall-License"):
654 license = parser.get_desktop("X-AppInstall-License")
655 doc.add_value(XapianValues.LICENSE, license)
651 # purchased date656 # purchased date
652 if parser.has_option_desktop("X-AppInstall-Purchased-Date"):657 if parser.has_option_desktop("X-AppInstall-Purchased-Date"):
653 date = parser.get_desktop("X-AppInstall-Purchased-Date")658 date = parser.get_desktop("X-AppInstall-Purchased-Date")
654659
=== modified file 'softwarecenter/distro/Ubuntu.py'
--- softwarecenter/distro/Ubuntu.py 2011-09-29 14:06:47 +0000
+++ softwarecenter/distro/Ubuntu.py 2011-10-05 01:40:29 +0000
@@ -100,8 +100,13 @@
100 def get_license_text(self, component):100 def get_license_text(self, component):
101 if component in ("main", "universe", "independent"):101 if component in ("main", "universe", "independent"):
102 return _("Open source")102 return _("Open source")
103 elif component in ("restricted", "commercial"):103 elif component == "restricted":
104 return _("Proprietary")104 return _("Proprietary")
105 else:
106 # commercial apps provide license info via the software-center-agent,
107 # but if a given commercial app does not provide this for some reason,
108 # default to a license type of "Unknown"
109 return _("Unknown")
105110
106 def is_supported(self, cache, doc, pkgname):111 def is_supported(self, cache, doc, pkgname):
107 # the doc does not by definition contain correct data regarding the112 # the doc does not by definition contain correct data regarding the
108113
=== modified file 'softwarecenter/enums.py'
--- softwarecenter/enums.py 2011-09-20 15:27:19 +0000
+++ softwarecenter/enums.py 2011-10-05 01:40:29 +0000
@@ -123,6 +123,7 @@
123 CATEGORIES = 191123 CATEGORIES = 191
124 LICENSE_KEY = 192124 LICENSE_KEY = 192
125 LICENSE_KEY_PATH = 193 # no longer used125 LICENSE_KEY_PATH = 193 # no longer used
126 LICENSE = 194
126127
127# fake channels128# fake channels
128PURCHASED_NEEDS_REINSTALL_MAGIC_CHANNEL_NAME = "for-pay-needs-reinstall"129PURCHASED_NEEDS_REINSTALL_MAGIC_CHANNEL_NAME = "for-pay-needs-reinstall"

Subscribers

People subscribed via source and target branches