Merge lp:~gary-lasker/software-center/metadata-fixes into lp:software-center

Proposed by Michael Vogt
Status: Merged
Merged at revision: 1154
Proposed branch: lp:~gary-lasker/software-center/metadata-fixes
Merge into: lp:software-center
Diff against target: 235 lines (+55/-32) (has conflicts)
9 files modified
apt-xapian-index-plugin/software-center.py (+3/-0)
debian/changelog (+23/-0)
softwarecenter/db/application.py (+5/-1)
softwarecenter/db/database.py (+4/-4)
softwarecenter/db/update.py (+2/-16)
softwarecenter/distro/Ubuntu.py (+4/-3)
softwarecenter/view/appdetailsview_gtk.py (+2/-0)
softwarecenter/view/appview.py (+8/-8)
test/test_database.py (+4/-0)
Text conflict in debian/changelog
To merge this branch: bzr merge lp:~gary-lasker/software-center/metadata-fixes
Reviewer Review Type Date Requested Status
Michael Vogt Approve
Review via email: mp+35064@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

This
             index_name(document, name, self.indexer)
+ document.add_value(XAPIAN_VALUE_APPNAME, name)

should not be needed, index_name() is doing this already.

Revision history for this message
Michael Vogt (mvo) wrote :

I removed that single line and now it appears to be fine

review: Approve
Revision history for this message
Michael Vogt (mvo) wrote :

Eh, sorry. I mean "Now its fine and merged"

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'apt-xapian-index-plugin/software-center.py'
--- apt-xapian-index-plugin/software-center.py 2010-08-05 14:44:36 +0000
+++ apt-xapian-index-plugin/software-center.py 2010-09-10 09:06:51 +0000
@@ -91,8 +91,11 @@
91 name = ver.record[CUSTOM_KEY_APPNAME]91 name = ver.record[CUSTOM_KEY_APPNAME]
92 self.indexer.set_document(document)92 self.indexer.set_document(document)
93 index_name(document, name, self.indexer)93 index_name(document, name, self.indexer)
94 document.add_value(XAPIAN_VALUE_APPNAME, name)
94 # we pretend to be an application95 # we pretend to be an application
95 document.add_term("AT"+"application")96 document.add_term("AT"+"application")
97 # and we inject a custom component value to indicate "independent"
98 document.add_value(XAPIAN_VALUE_ARCHIVE_SECTION, "independent")
96 if CUSTOM_KEY_ICON in ver.record:99 if CUSTOM_KEY_ICON in ver.record:
97 icon = ver.record[CUSTOM_KEY_ICON]100 icon = ver.record[CUSTOM_KEY_ICON]
98 document.add_value(XAPIAN_VALUE_ICON, icon)101 document.add_value(XAPIAN_VALUE_ICON, icon)
99102
=== modified file 'debian/changelog'
--- debian/changelog 2010-09-10 08:47:35 +0000
+++ debian/changelog 2010-09-10 09:06:51 +0000
@@ -1,3 +1,4 @@
1<<<<<<< TREE
1software-center (2.1.17.3) UNRELEASED; urgency=low2software-center (2.1.17.3) UNRELEASED; urgency=low
23
3 [ Michael Vogt ]4 [ Michael Vogt ]
@@ -16,6 +17,28 @@
1617
17 -- Michael Vogt <michael.vogt@ubuntu.com> Thu, 09 Sep 2010 19:15:18 +020018 -- Michael Vogt <michael.vogt@ubuntu.com> Thu, 09 Sep 2010 19:15:18 +0200
1819
20=======
21software-center (2.1.17.3) UNRELEASED; urgency=low
22
23 * apt-xapian-index-plugin/softwarecenter.py,
24 softwarecenter/db/application.py,
25 softwarecenter/db/database.py,
26 softwarecenter/db/update.py,
27 softwarecenter/distro/Ubuntu.py,
28 softwarecenter/view/appdetailsview_gtk.py,
29 test/test_database.py:
30 - improved support for the display of metadata in the
31 details view for new-apps and apps for purchase
32 (LP: #625254)
33 - fix incorrect display of the app name and summary
34 text for new-apps in the details view (LP: #634678)
35 - add tests for get_appname, get_pkgname
36 * softwarecenter/view/appview.py:
37 - fix up downloadable icon handling
38
39 -- Gary Lasker <gary.lasker@canonical.com> Fri, 10 Sep 2010 00:57:36 -0400
40
41>>>>>>> MERGE-SOURCE
19software-center (2.1.17.2) maverick; urgency=low42software-center (2.1.17.2) maverick; urgency=low
2043
21 * softwarecenter/backend/aptd.py:44 * softwarecenter/backend/aptd.py:
2245
=== modified file 'softwarecenter/db/application.py'
--- softwarecenter/db/application.py 2010-09-09 15:02:04 +0000
+++ softwarecenter/db/application.py 2010-09-10 09:06:51 +0000
@@ -464,7 +464,8 @@
464 source_to_enable = None464 source_to_enable = None
465 if self.channelname and self._unavailable_channel():465 if self.channelname and self._unavailable_channel():
466 source_to_enable = self.channelname466 source_to_enable = self.channelname
467 elif self.component:467 elif (self.component and
468 self.component not in ("independent", "commercial")):
468 source_to_enable = self.component469 source_to_enable = self.component
469 if source_to_enable:470 if source_to_enable:
470 sources = source_to_enable.split('&')471 sources = source_to_enable.split('&')
@@ -534,6 +535,7 @@
534 details = []535 details = []
535 details.append("* AppDetails")536 details.append("* AppDetails")
536 details.append(" name: %s" % self.name)537 details.append(" name: %s" % self.name)
538 details.append(" display_name: %s" % self.display_name)
537 details.append(" pkg: %s" % self.pkg)539 details.append(" pkg: %s" % self.pkg)
538 details.append(" pkgname: %s" % self.pkgname)540 details.append(" pkgname: %s" % self.pkgname)
539 details.append(" architecture: %s" % self.architecture)541 details.append(" architecture: %s" % self.architecture)
@@ -543,6 +545,7 @@
543 details.append(" component: %s" % self.component)545 details.append(" component: %s" % self.component)
544 details.append(" desktop_file: %s" % self.desktop_file)546 details.append(" desktop_file: %s" % self.desktop_file)
545 details.append(" description: %s" % self.description)547 details.append(" description: %s" % self.description)
548 details.append(" error: %s" % self.error)
546 details.append(" icon: %s" % self.icon)549 details.append(" icon: %s" % self.icon)
547 details.append(" icon_file_name: %s" % self.icon_file_name)550 details.append(" icon_file_name: %s" % self.icon_file_name)
548 details.append(" icon_needs_download: %s" % self.icon_needs_download)551 details.append(" icon_needs_download: %s" % self.icon_needs_download)
@@ -555,6 +558,7 @@
555 details.append(" price: %s" % self.price)558 details.append(" price: %s" % self.price)
556 details.append(" screenshot: %s" % self.screenshot)559 details.append(" screenshot: %s" % self.screenshot)
557 details.append(" summary: %s" % self.summary)560 details.append(" summary: %s" % self.summary)
561 details.append(" display_summary: %s" % self.display_summary)
558 details.append(" thumbnail: %s" % self.thumbnail)562 details.append(" thumbnail: %s" % self.thumbnail)
559 details.append(" version: %s" % self.version)563 details.append(" version: %s" % self.version)
560 details.append(" website: %s" % self.website)564 details.append(" website: %s" % self.website)
561565
=== modified file 'softwarecenter/db/database.py'
--- softwarecenter/db/database.py 2010-09-10 08:52:17 +0000
+++ softwarecenter/db/database.py 2010-09-10 09:06:51 +0000
@@ -230,12 +230,12 @@
230230
231 def get_appname(self, doc):231 def get_appname(self, doc):
232 """ Return a appname from a xapian document """232 """ Return a appname from a xapian document """
233 pkgname = doc.get_value(XAPIAN_VALUE_PKGNAME)233 appname = doc.get_value(XAPIAN_VALUE_APPNAME)
234 # if there is no value it means we use the apt-xapian-index 234 # if there is no value it means we use the apt-xapian-index
235 # and that has no appname235 # and that has no appname
236 if not pkgname:236 if not appname:
237 return None237 appname = doc.get_data()
238 return doc.get_data()238 return appname
239239
240 def get_iconname(self, doc):240 def get_iconname(self, doc):
241 """ Return the iconname from the xapian document """241 """ Return the iconname from the xapian document """
242242
=== modified file 'softwarecenter/db/update.py'
--- softwarecenter/db/update.py 2010-08-31 18:48:17 +0000
+++ softwarecenter/db/update.py 2010-09-10 09:06:51 +0000
@@ -276,22 +276,6 @@
276 index_app_info_from_parser(parser, db, cache)276 index_app_info_from_parser(parser, db, cache)
277 return True277 return True
278278
279def update_from_apt_cache_for_whats_new_repo(db, cache):
280
281 SPECIAL_ORIGINS_THAT_ARE_CONSIDERED_APPS = (
282 "Application Review Board PPA",
283 )
284
285 for pkg in cache:
286 if not pkg.candidate:
287 continue
288 for origin in pkg.candidate.origins:
289 # FIXME: make this configuration
290 if (origin.label in SPECIAL_ORIGINS_THAT_ARE_CONSIDERED_APPS and
291 origin.trusted):
292 parser = AptCachePkgParser(pkg)
293 index_app_info_from_parser(parser, db, cache)
294
295def update_from_var_lib_apt_lists(db, cache, listsdir=None):279def update_from_var_lib_apt_lists(db, cache, listsdir=None):
296 """ index the files in /var/lib/apt/lists/*AppInfo """280 """ index the files in /var/lib/apt/lists/*AppInfo """
297 if not listsdir:281 if not listsdir:
@@ -478,6 +462,8 @@
478 if parser.has_option_desktop("X-AppInstall-Price"):462 if parser.has_option_desktop("X-AppInstall-Price"):
479 price = parser.get_desktop("X-AppInstall-Price")463 price = parser.get_desktop("X-AppInstall-Price")
480 doc.add_value(XAPIAN_VALUE_PRICE, price)464 doc.add_value(XAPIAN_VALUE_PRICE, price)
465 # since this is a commercial app, indicate it in the component value
466 doc.add_value(XAPIAN_VALUE_ARCHIVE_SECTION, "commercial")
481 # icon467 # icon
482 if parser.has_option_desktop("Icon"):468 if parser.has_option_desktop("Icon"):
483 icon = parser.get_desktop("Icon")469 icon = parser.get_desktop("Icon")
484470
=== modified file 'softwarecenter/distro/Ubuntu.py'
--- softwarecenter/distro/Ubuntu.py 2010-09-08 16:41:23 +0000
+++ softwarecenter/distro/Ubuntu.py 2010-09-10 09:06:51 +0000
@@ -87,9 +87,9 @@
87 return self.codename87 return self.codename
8888
89 def get_license_text(self, component):89 def get_license_text(self, component):
90 if component in ("main", "universe"):90 if component in ("main", "universe", "independent"):
91 return _("Open source")91 return _("Open source")
92 elif component == "restricted":92 elif component in ("restricted", "commercial"):
93 return _("Proprietary")93 return _("Proprietary")
9494
95 def is_supported(self, cache, doc, pkgname):95 def is_supported(self, cache, doc, pkgname):
@@ -184,7 +184,8 @@
184 184
185 # if we couldn't determine a support date, use a generic maintenance185 # if we couldn't determine a support date, use a generic maintenance
186 # string without the date186 # string without the date
187 if channelname or component == "partner":187 if (channelname or
188 component in ("partner", "independent", "commercial")):
188 return _("Canonical does not provide updates for %s. "189 return _("Canonical does not provide updates for %s. "
189 "Some updates may be provided by the third party "190 "Some updates may be provided by the third party "
190 "vendor.") % appname191 "vendor.") % appname
191192
=== modified file 'softwarecenter/view/appdetailsview_gtk.py'
--- softwarecenter/view/appdetailsview_gtk.py 2010-09-09 14:13:40 +0000
+++ softwarecenter/view/appdetailsview_gtk.py 2010-09-10 09:06:51 +0000
@@ -1360,6 +1360,8 @@
1360 version = '%s (%s)' % (app_details.version, app_details.pkgname)1360 version = '%s (%s)' % (app_details.version, app_details.pkgname)
1361 else:1361 else:
1362 version = _("Unknown")1362 version = _("Unknown")
1363 # if the version is unknown, just hide the field
1364 self.version_info.hide()
1363 if app_details.license:1365 if app_details.license:
1364 license = app_details.license1366 license = app_details.license
1365 else:1367 else:
13661368
=== modified file 'softwarecenter/view/appview.py'
--- softwarecenter/view/appview.py 2010-09-10 07:47:03 +0000
+++ softwarecenter/view/appview.py 2010-09-10 09:06:51 +0000
@@ -564,20 +564,20 @@
564 # machine, this is a significant burden because get_value564 # machine, this is a significant burden because get_value
565 # is called *a lot*. caching is the only option565 # is called *a lot*. caching is the only option
566 566
567 # check if this is a downloadable icon567 # look for the icon on the iconpath
568 if not self.db.get_icon_needs_download(doc):568 if self.icons.has_icon(icon_name):
569 # load the icon from the theme
570 icon = self.icons.load_icon(icon_name, self.icon_size, 0)569 icon = self.icons.load_icon(icon_name, self.icon_size, 0)
571 self.icon_cache[icon_name] = icon570 if icon:
572 return icon571 self.icon_cache[icon_name] = icon
573 else:572 return icon
573 elif self.db.get_icon_needs_download(doc):
574 self._download_icon_and_show_when_ready(self.cache, 574 self._download_icon_and_show_when_ready(self.cache,
575 app.pkgname,575 app.pkgname,
576 icon_file_name)576 icon_file_name)
577 return self._appicon_missing_icon577 # display the missing icon while the real one downloads
578 self.icon_cache[icon_name] = self._appicon_missing_icon
578 except glib.GError, e:579 except glib.GError, e:
579 self._logger.debug("get_icon returned '%s'" % e)580 self._logger.debug("get_icon returned '%s'" % e)
580 self.icon_cache[icon_name] = self._appicon_missing_icon
581 return self._appicon_missing_icon581 return self._appicon_missing_icon
582 elif column == self.COL_INSTALLED:582 elif column == self.COL_INSTALLED:
583 pkgname = app.pkgname583 pkgname = app.pkgname
584584
=== modified file 'test/test_database.py'
--- test/test_database.py 2010-09-10 07:17:42 +0000
+++ test/test_database.py 2010-09-10 09:06:51 +0000
@@ -133,6 +133,10 @@
133 if doc.get_data() == "Ubuntu Software Center Test":133 if doc.get_data() == "Ubuntu Software Center Test":
134 appdetails = AppDetails(db, doc=doc)134 appdetails = AppDetails(db, doc=doc)
135 break135 break
136 # test get_appname and get_pkgname
137 self.assertEqual(db.get_appname(doc), "Ubuntu Software Center Test")
138 self.assertEqual(db.get_pkgname(doc), "software-center")
139 # test appdetails
136 self.assertEqual(appdetails.name, "Ubuntu Software Center Test")140 self.assertEqual(appdetails.name, "Ubuntu Software Center Test")
137 self.assertEqual(appdetails.pkgname, "software-center")141 self.assertEqual(appdetails.pkgname, "software-center")
138 # FIXME: add a dekstop file with a real channel to test142 # FIXME: add a dekstop file with a real channel to test

Subscribers

People subscribed via source and target branches