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.
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.

Michael Vogt (mvo) wrote :

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

review: Approve
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
1=== modified file 'apt-xapian-index-plugin/software-center.py'
2--- apt-xapian-index-plugin/software-center.py 2010-08-05 14:44:36 +0000
3+++ apt-xapian-index-plugin/software-center.py 2010-09-10 09:06:51 +0000
4@@ -91,8 +91,11 @@
5 name = ver.record[CUSTOM_KEY_APPNAME]
6 self.indexer.set_document(document)
7 index_name(document, name, self.indexer)
8+ document.add_value(XAPIAN_VALUE_APPNAME, name)
9 # we pretend to be an application
10 document.add_term("AT"+"application")
11+ # and we inject a custom component value to indicate "independent"
12+ document.add_value(XAPIAN_VALUE_ARCHIVE_SECTION, "independent")
13 if CUSTOM_KEY_ICON in ver.record:
14 icon = ver.record[CUSTOM_KEY_ICON]
15 document.add_value(XAPIAN_VALUE_ICON, icon)
16
17=== modified file 'debian/changelog'
18--- debian/changelog 2010-09-10 08:47:35 +0000
19+++ debian/changelog 2010-09-10 09:06:51 +0000
20@@ -1,3 +1,4 @@
21+<<<<<<< TREE
22 software-center (2.1.17.3) UNRELEASED; urgency=low
23
24 [ Michael Vogt ]
25@@ -16,6 +17,28 @@
26
27 -- Michael Vogt <michael.vogt@ubuntu.com> Thu, 09 Sep 2010 19:15:18 +0200
28
29+=======
30+software-center (2.1.17.3) UNRELEASED; urgency=low
31+
32+ * apt-xapian-index-plugin/softwarecenter.py,
33+ softwarecenter/db/application.py,
34+ softwarecenter/db/database.py,
35+ softwarecenter/db/update.py,
36+ softwarecenter/distro/Ubuntu.py,
37+ softwarecenter/view/appdetailsview_gtk.py,
38+ test/test_database.py:
39+ - improved support for the display of metadata in the
40+ details view for new-apps and apps for purchase
41+ (LP: #625254)
42+ - fix incorrect display of the app name and summary
43+ text for new-apps in the details view (LP: #634678)
44+ - add tests for get_appname, get_pkgname
45+ * softwarecenter/view/appview.py:
46+ - fix up downloadable icon handling
47+
48+ -- Gary Lasker <gary.lasker@canonical.com> Fri, 10 Sep 2010 00:57:36 -0400
49+
50+>>>>>>> MERGE-SOURCE
51 software-center (2.1.17.2) maverick; urgency=low
52
53 * softwarecenter/backend/aptd.py:
54
55=== modified file 'softwarecenter/db/application.py'
56--- softwarecenter/db/application.py 2010-09-09 15:02:04 +0000
57+++ softwarecenter/db/application.py 2010-09-10 09:06:51 +0000
58@@ -464,7 +464,8 @@
59 source_to_enable = None
60 if self.channelname and self._unavailable_channel():
61 source_to_enable = self.channelname
62- elif self.component:
63+ elif (self.component and
64+ self.component not in ("independent", "commercial")):
65 source_to_enable = self.component
66 if source_to_enable:
67 sources = source_to_enable.split('&')
68@@ -534,6 +535,7 @@
69 details = []
70 details.append("* AppDetails")
71 details.append(" name: %s" % self.name)
72+ details.append(" display_name: %s" % self.display_name)
73 details.append(" pkg: %s" % self.pkg)
74 details.append(" pkgname: %s" % self.pkgname)
75 details.append(" architecture: %s" % self.architecture)
76@@ -543,6 +545,7 @@
77 details.append(" component: %s" % self.component)
78 details.append(" desktop_file: %s" % self.desktop_file)
79 details.append(" description: %s" % self.description)
80+ details.append(" error: %s" % self.error)
81 details.append(" icon: %s" % self.icon)
82 details.append(" icon_file_name: %s" % self.icon_file_name)
83 details.append(" icon_needs_download: %s" % self.icon_needs_download)
84@@ -555,6 +558,7 @@
85 details.append(" price: %s" % self.price)
86 details.append(" screenshot: %s" % self.screenshot)
87 details.append(" summary: %s" % self.summary)
88+ details.append(" display_summary: %s" % self.display_summary)
89 details.append(" thumbnail: %s" % self.thumbnail)
90 details.append(" version: %s" % self.version)
91 details.append(" website: %s" % self.website)
92
93=== modified file 'softwarecenter/db/database.py'
94--- softwarecenter/db/database.py 2010-09-10 08:52:17 +0000
95+++ softwarecenter/db/database.py 2010-09-10 09:06:51 +0000
96@@ -230,12 +230,12 @@
97
98 def get_appname(self, doc):
99 """ Return a appname from a xapian document """
100- pkgname = doc.get_value(XAPIAN_VALUE_PKGNAME)
101+ appname = doc.get_value(XAPIAN_VALUE_APPNAME)
102 # if there is no value it means we use the apt-xapian-index
103 # and that has no appname
104- if not pkgname:
105- return None
106- return doc.get_data()
107+ if not appname:
108+ appname = doc.get_data()
109+ return appname
110
111 def get_iconname(self, doc):
112 """ Return the iconname from the xapian document """
113
114=== modified file 'softwarecenter/db/update.py'
115--- softwarecenter/db/update.py 2010-08-31 18:48:17 +0000
116+++ softwarecenter/db/update.py 2010-09-10 09:06:51 +0000
117@@ -276,22 +276,6 @@
118 index_app_info_from_parser(parser, db, cache)
119 return True
120
121-def update_from_apt_cache_for_whats_new_repo(db, cache):
122-
123- SPECIAL_ORIGINS_THAT_ARE_CONSIDERED_APPS = (
124- "Application Review Board PPA",
125- )
126-
127- for pkg in cache:
128- if not pkg.candidate:
129- continue
130- for origin in pkg.candidate.origins:
131- # FIXME: make this configuration
132- if (origin.label in SPECIAL_ORIGINS_THAT_ARE_CONSIDERED_APPS and
133- origin.trusted):
134- parser = AptCachePkgParser(pkg)
135- index_app_info_from_parser(parser, db, cache)
136-
137 def update_from_var_lib_apt_lists(db, cache, listsdir=None):
138 """ index the files in /var/lib/apt/lists/*AppInfo """
139 if not listsdir:
140@@ -478,6 +462,8 @@
141 if parser.has_option_desktop("X-AppInstall-Price"):
142 price = parser.get_desktop("X-AppInstall-Price")
143 doc.add_value(XAPIAN_VALUE_PRICE, price)
144+ # since this is a commercial app, indicate it in the component value
145+ doc.add_value(XAPIAN_VALUE_ARCHIVE_SECTION, "commercial")
146 # icon
147 if parser.has_option_desktop("Icon"):
148 icon = parser.get_desktop("Icon")
149
150=== modified file 'softwarecenter/distro/Ubuntu.py'
151--- softwarecenter/distro/Ubuntu.py 2010-09-08 16:41:23 +0000
152+++ softwarecenter/distro/Ubuntu.py 2010-09-10 09:06:51 +0000
153@@ -87,9 +87,9 @@
154 return self.codename
155
156 def get_license_text(self, component):
157- if component in ("main", "universe"):
158+ if component in ("main", "universe", "independent"):
159 return _("Open source")
160- elif component == "restricted":
161+ elif component in ("restricted", "commercial"):
162 return _("Proprietary")
163
164 def is_supported(self, cache, doc, pkgname):
165@@ -184,7 +184,8 @@
166
167 # if we couldn't determine a support date, use a generic maintenance
168 # string without the date
169- if channelname or component == "partner":
170+ if (channelname or
171+ component in ("partner", "independent", "commercial")):
172 return _("Canonical does not provide updates for %s. "
173 "Some updates may be provided by the third party "
174 "vendor.") % appname
175
176=== modified file 'softwarecenter/view/appdetailsview_gtk.py'
177--- softwarecenter/view/appdetailsview_gtk.py 2010-09-09 14:13:40 +0000
178+++ softwarecenter/view/appdetailsview_gtk.py 2010-09-10 09:06:51 +0000
179@@ -1360,6 +1360,8 @@
180 version = '%s (%s)' % (app_details.version, app_details.pkgname)
181 else:
182 version = _("Unknown")
183+ # if the version is unknown, just hide the field
184+ self.version_info.hide()
185 if app_details.license:
186 license = app_details.license
187 else:
188
189=== modified file 'softwarecenter/view/appview.py'
190--- softwarecenter/view/appview.py 2010-09-10 07:47:03 +0000
191+++ softwarecenter/view/appview.py 2010-09-10 09:06:51 +0000
192@@ -564,20 +564,20 @@
193 # machine, this is a significant burden because get_value
194 # is called *a lot*. caching is the only option
195
196- # check if this is a downloadable icon
197- if not self.db.get_icon_needs_download(doc):
198- # load the icon from the theme
199+ # look for the icon on the iconpath
200+ if self.icons.has_icon(icon_name):
201 icon = self.icons.load_icon(icon_name, self.icon_size, 0)
202- self.icon_cache[icon_name] = icon
203- return icon
204- else:
205+ if icon:
206+ self.icon_cache[icon_name] = icon
207+ return icon
208+ elif self.db.get_icon_needs_download(doc):
209 self._download_icon_and_show_when_ready(self.cache,
210 app.pkgname,
211 icon_file_name)
212- return self._appicon_missing_icon
213+ # display the missing icon while the real one downloads
214+ self.icon_cache[icon_name] = self._appicon_missing_icon
215 except glib.GError, e:
216 self._logger.debug("get_icon returned '%s'" % e)
217- self.icon_cache[icon_name] = self._appicon_missing_icon
218 return self._appicon_missing_icon
219 elif column == self.COL_INSTALLED:
220 pkgname = app.pkgname
221
222=== modified file 'test/test_database.py'
223--- test/test_database.py 2010-09-10 07:17:42 +0000
224+++ test/test_database.py 2010-09-10 09:06:51 +0000
225@@ -133,6 +133,10 @@
226 if doc.get_data() == "Ubuntu Software Center Test":
227 appdetails = AppDetails(db, doc=doc)
228 break
229+ # test get_appname and get_pkgname
230+ self.assertEqual(db.get_appname(doc), "Ubuntu Software Center Test")
231+ self.assertEqual(db.get_pkgname(doc), "software-center")
232+ # test appdetails
233 self.assertEqual(appdetails.name, "Ubuntu Software Center Test")
234 self.assertEqual(appdetails.pkgname, "software-center")
235 # FIXME: add a dekstop file with a real channel to test

Subscribers

People subscribed via source and target branches