Merge lp:~gary-lasker/software-center/metadata-fixes into lp:software-center
- metadata-fixes
- Merge into trunk
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Vogt | Approve | ||
Review via email: mp+35064@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote : | # |
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
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 | 91 | name = ver.record[CUSTOM_KEY_APPNAME] | 91 | name = ver.record[CUSTOM_KEY_APPNAME] |
6 | 92 | self.indexer.set_document(document) | 92 | self.indexer.set_document(document) |
7 | 93 | index_name(document, name, self.indexer) | 93 | index_name(document, name, self.indexer) |
8 | 94 | document.add_value(XAPIAN_VALUE_APPNAME, name) | ||
9 | 94 | # we pretend to be an application | 95 | # we pretend to be an application |
10 | 95 | document.add_term("AT"+"application") | 96 | document.add_term("AT"+"application") |
11 | 97 | # and we inject a custom component value to indicate "independent" | ||
12 | 98 | document.add_value(XAPIAN_VALUE_ARCHIVE_SECTION, "independent") | ||
13 | 96 | if CUSTOM_KEY_ICON in ver.record: | 99 | if CUSTOM_KEY_ICON in ver.record: |
14 | 97 | icon = ver.record[CUSTOM_KEY_ICON] | 100 | icon = ver.record[CUSTOM_KEY_ICON] |
15 | 98 | document.add_value(XAPIAN_VALUE_ICON, icon) | 101 | document.add_value(XAPIAN_VALUE_ICON, icon) |
16 | 99 | 102 | ||
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 | 1 | <<<<<<< TREE | ||
22 | 1 | software-center (2.1.17.3) UNRELEASED; urgency=low | 2 | software-center (2.1.17.3) UNRELEASED; urgency=low |
23 | 2 | 3 | ||
24 | 3 | [ Michael Vogt ] | 4 | [ Michael Vogt ] |
25 | @@ -16,6 +17,28 @@ | |||
26 | 16 | 17 | ||
27 | 17 | -- Michael Vogt <michael.vogt@ubuntu.com> Thu, 09 Sep 2010 19:15:18 +0200 | 18 | -- Michael Vogt <michael.vogt@ubuntu.com> Thu, 09 Sep 2010 19:15:18 +0200 |
28 | 18 | 19 | ||
29 | 20 | ======= | ||
30 | 21 | software-center (2.1.17.3) UNRELEASED; urgency=low | ||
31 | 22 | |||
32 | 23 | * apt-xapian-index-plugin/softwarecenter.py, | ||
33 | 24 | softwarecenter/db/application.py, | ||
34 | 25 | softwarecenter/db/database.py, | ||
35 | 26 | softwarecenter/db/update.py, | ||
36 | 27 | softwarecenter/distro/Ubuntu.py, | ||
37 | 28 | softwarecenter/view/appdetailsview_gtk.py, | ||
38 | 29 | test/test_database.py: | ||
39 | 30 | - improved support for the display of metadata in the | ||
40 | 31 | details view for new-apps and apps for purchase | ||
41 | 32 | (LP: #625254) | ||
42 | 33 | - fix incorrect display of the app name and summary | ||
43 | 34 | text for new-apps in the details view (LP: #634678) | ||
44 | 35 | - add tests for get_appname, get_pkgname | ||
45 | 36 | * softwarecenter/view/appview.py: | ||
46 | 37 | - fix up downloadable icon handling | ||
47 | 38 | |||
48 | 39 | -- Gary Lasker <gary.lasker@canonical.com> Fri, 10 Sep 2010 00:57:36 -0400 | ||
49 | 40 | |||
50 | 41 | >>>>>>> MERGE-SOURCE | ||
51 | 19 | software-center (2.1.17.2) maverick; urgency=low | 42 | software-center (2.1.17.2) maverick; urgency=low |
52 | 20 | 43 | ||
53 | 21 | * softwarecenter/backend/aptd.py: | 44 | * softwarecenter/backend/aptd.py: |
54 | 22 | 45 | ||
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 | 464 | source_to_enable = None | 464 | source_to_enable = None |
60 | 465 | if self.channelname and self._unavailable_channel(): | 465 | if self.channelname and self._unavailable_channel(): |
61 | 466 | source_to_enable = self.channelname | 466 | source_to_enable = self.channelname |
63 | 467 | elif self.component: | 467 | elif (self.component and |
64 | 468 | self.component not in ("independent", "commercial")): | ||
65 | 468 | source_to_enable = self.component | 469 | source_to_enable = self.component |
66 | 469 | if source_to_enable: | 470 | if source_to_enable: |
67 | 470 | sources = source_to_enable.split('&') | 471 | sources = source_to_enable.split('&') |
68 | @@ -534,6 +535,7 @@ | |||
69 | 534 | details = [] | 535 | details = [] |
70 | 535 | details.append("* AppDetails") | 536 | details.append("* AppDetails") |
71 | 536 | details.append(" name: %s" % self.name) | 537 | details.append(" name: %s" % self.name) |
72 | 538 | details.append(" display_name: %s" % self.display_name) | ||
73 | 537 | details.append(" pkg: %s" % self.pkg) | 539 | details.append(" pkg: %s" % self.pkg) |
74 | 538 | details.append(" pkgname: %s" % self.pkgname) | 540 | details.append(" pkgname: %s" % self.pkgname) |
75 | 539 | details.append(" architecture: %s" % self.architecture) | 541 | details.append(" architecture: %s" % self.architecture) |
76 | @@ -543,6 +545,7 @@ | |||
77 | 543 | details.append(" component: %s" % self.component) | 545 | details.append(" component: %s" % self.component) |
78 | 544 | details.append(" desktop_file: %s" % self.desktop_file) | 546 | details.append(" desktop_file: %s" % self.desktop_file) |
79 | 545 | details.append(" description: %s" % self.description) | 547 | details.append(" description: %s" % self.description) |
80 | 548 | details.append(" error: %s" % self.error) | ||
81 | 546 | details.append(" icon: %s" % self.icon) | 549 | details.append(" icon: %s" % self.icon) |
82 | 547 | details.append(" icon_file_name: %s" % self.icon_file_name) | 550 | details.append(" icon_file_name: %s" % self.icon_file_name) |
83 | 548 | details.append(" icon_needs_download: %s" % self.icon_needs_download) | 551 | details.append(" icon_needs_download: %s" % self.icon_needs_download) |
84 | @@ -555,6 +558,7 @@ | |||
85 | 555 | details.append(" price: %s" % self.price) | 558 | details.append(" price: %s" % self.price) |
86 | 556 | details.append(" screenshot: %s" % self.screenshot) | 559 | details.append(" screenshot: %s" % self.screenshot) |
87 | 557 | details.append(" summary: %s" % self.summary) | 560 | details.append(" summary: %s" % self.summary) |
88 | 561 | details.append(" display_summary: %s" % self.display_summary) | ||
89 | 558 | details.append(" thumbnail: %s" % self.thumbnail) | 562 | details.append(" thumbnail: %s" % self.thumbnail) |
90 | 559 | details.append(" version: %s" % self.version) | 563 | details.append(" version: %s" % self.version) |
91 | 560 | details.append(" website: %s" % self.website) | 564 | details.append(" website: %s" % self.website) |
92 | 561 | 565 | ||
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 | 230 | 230 | ||
98 | 231 | def get_appname(self, doc): | 231 | def get_appname(self, doc): |
99 | 232 | """ Return a appname from a xapian document """ | 232 | """ Return a appname from a xapian document """ |
101 | 233 | pkgname = doc.get_value(XAPIAN_VALUE_PKGNAME) | 233 | appname = doc.get_value(XAPIAN_VALUE_APPNAME) |
102 | 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 |
103 | 235 | # and that has no appname | 235 | # and that has no appname |
107 | 236 | if not pkgname: | 236 | if not appname: |
108 | 237 | return None | 237 | appname = doc.get_data() |
109 | 238 | return doc.get_data() | 238 | return appname |
110 | 239 | 239 | ||
111 | 240 | def get_iconname(self, doc): | 240 | def get_iconname(self, doc): |
112 | 241 | """ Return the iconname from the xapian document """ | 241 | """ Return the iconname from the xapian document """ |
113 | 242 | 242 | ||
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 | 276 | index_app_info_from_parser(parser, db, cache) | 276 | index_app_info_from_parser(parser, db, cache) |
119 | 277 | return True | 277 | return True |
120 | 278 | 278 | ||
121 | 279 | def update_from_apt_cache_for_whats_new_repo(db, cache): | ||
122 | 280 | |||
123 | 281 | SPECIAL_ORIGINS_THAT_ARE_CONSIDERED_APPS = ( | ||
124 | 282 | "Application Review Board PPA", | ||
125 | 283 | ) | ||
126 | 284 | |||
127 | 285 | for pkg in cache: | ||
128 | 286 | if not pkg.candidate: | ||
129 | 287 | continue | ||
130 | 288 | for origin in pkg.candidate.origins: | ||
131 | 289 | # FIXME: make this configuration | ||
132 | 290 | if (origin.label in SPECIAL_ORIGINS_THAT_ARE_CONSIDERED_APPS and | ||
133 | 291 | origin.trusted): | ||
134 | 292 | parser = AptCachePkgParser(pkg) | ||
135 | 293 | index_app_info_from_parser(parser, db, cache) | ||
136 | 294 | |||
137 | 295 | def update_from_var_lib_apt_lists(db, cache, listsdir=None): | 279 | def update_from_var_lib_apt_lists(db, cache, listsdir=None): |
138 | 296 | """ index the files in /var/lib/apt/lists/*AppInfo """ | 280 | """ index the files in /var/lib/apt/lists/*AppInfo """ |
139 | 297 | if not listsdir: | 281 | if not listsdir: |
140 | @@ -478,6 +462,8 @@ | |||
141 | 478 | if parser.has_option_desktop("X-AppInstall-Price"): | 462 | if parser.has_option_desktop("X-AppInstall-Price"): |
142 | 479 | price = parser.get_desktop("X-AppInstall-Price") | 463 | price = parser.get_desktop("X-AppInstall-Price") |
143 | 480 | doc.add_value(XAPIAN_VALUE_PRICE, price) | 464 | doc.add_value(XAPIAN_VALUE_PRICE, price) |
144 | 465 | # since this is a commercial app, indicate it in the component value | ||
145 | 466 | doc.add_value(XAPIAN_VALUE_ARCHIVE_SECTION, "commercial") | ||
146 | 481 | # icon | 467 | # icon |
147 | 482 | if parser.has_option_desktop("Icon"): | 468 | if parser.has_option_desktop("Icon"): |
148 | 483 | icon = parser.get_desktop("Icon") | 469 | icon = parser.get_desktop("Icon") |
149 | 484 | 470 | ||
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 | 87 | return self.codename | 87 | return self.codename |
155 | 88 | 88 | ||
156 | 89 | def get_license_text(self, component): | 89 | def get_license_text(self, component): |
158 | 90 | if component in ("main", "universe"): | 90 | if component in ("main", "universe", "independent"): |
159 | 91 | return _("Open source") | 91 | return _("Open source") |
161 | 92 | elif component == "restricted": | 92 | elif component in ("restricted", "commercial"): |
162 | 93 | return _("Proprietary") | 93 | return _("Proprietary") |
163 | 94 | 94 | ||
164 | 95 | def is_supported(self, cache, doc, pkgname): | 95 | def is_supported(self, cache, doc, pkgname): |
165 | @@ -184,7 +184,8 @@ | |||
166 | 184 | 184 | ||
167 | 185 | # if we couldn't determine a support date, use a generic maintenance | 185 | # if we couldn't determine a support date, use a generic maintenance |
168 | 186 | # string without the date | 186 | # string without the date |
170 | 187 | if channelname or component == "partner": | 187 | if (channelname or |
171 | 188 | component in ("partner", "independent", "commercial")): | ||
172 | 188 | return _("Canonical does not provide updates for %s. " | 189 | return _("Canonical does not provide updates for %s. " |
173 | 189 | "Some updates may be provided by the third party " | 190 | "Some updates may be provided by the third party " |
174 | 190 | "vendor.") % appname | 191 | "vendor.") % appname |
175 | 191 | 192 | ||
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 | 1360 | version = '%s (%s)' % (app_details.version, app_details.pkgname) | 1360 | version = '%s (%s)' % (app_details.version, app_details.pkgname) |
181 | 1361 | else: | 1361 | else: |
182 | 1362 | version = _("Unknown") | 1362 | version = _("Unknown") |
183 | 1363 | # if the version is unknown, just hide the field | ||
184 | 1364 | self.version_info.hide() | ||
185 | 1363 | if app_details.license: | 1365 | if app_details.license: |
186 | 1364 | license = app_details.license | 1366 | license = app_details.license |
187 | 1365 | else: | 1367 | else: |
188 | 1366 | 1368 | ||
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 | 564 | # machine, this is a significant burden because get_value | 564 | # machine, this is a significant burden because get_value |
194 | 565 | # is called *a lot*. caching is the only option | 565 | # is called *a lot*. caching is the only option |
195 | 566 | 566 | ||
199 | 567 | # check if this is a downloadable icon | 567 | # look for the icon on the iconpath |
200 | 568 | if not self.db.get_icon_needs_download(doc): | 568 | if self.icons.has_icon(icon_name): |
198 | 569 | # load the icon from the theme | ||
201 | 570 | icon = self.icons.load_icon(icon_name, self.icon_size, 0) | 569 | icon = self.icons.load_icon(icon_name, self.icon_size, 0) |
205 | 571 | self.icon_cache[icon_name] = icon | 570 | if icon: |
206 | 572 | return icon | 571 | self.icon_cache[icon_name] = icon |
207 | 573 | else: | 572 | return icon |
208 | 573 | elif self.db.get_icon_needs_download(doc): | ||
209 | 574 | self._download_icon_and_show_when_ready(self.cache, | 574 | self._download_icon_and_show_when_ready(self.cache, |
210 | 575 | app.pkgname, | 575 | app.pkgname, |
211 | 576 | icon_file_name) | 576 | icon_file_name) |
213 | 577 | return self._appicon_missing_icon | 577 | # display the missing icon while the real one downloads |
214 | 578 | self.icon_cache[icon_name] = self._appicon_missing_icon | ||
215 | 578 | except glib.GError, e: | 579 | except glib.GError, e: |
216 | 579 | self._logger.debug("get_icon returned '%s'" % e) | 580 | self._logger.debug("get_icon returned '%s'" % e) |
217 | 580 | self.icon_cache[icon_name] = self._appicon_missing_icon | ||
218 | 581 | return self._appicon_missing_icon | 581 | return self._appicon_missing_icon |
219 | 582 | elif column == self.COL_INSTALLED: | 582 | elif column == self.COL_INSTALLED: |
220 | 583 | pkgname = app.pkgname | 583 | pkgname = app.pkgname |
221 | 584 | 584 | ||
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 | 133 | if doc.get_data() == "Ubuntu Software Center Test": | 133 | if doc.get_data() == "Ubuntu Software Center Test": |
227 | 134 | appdetails = AppDetails(db, doc=doc) | 134 | appdetails = AppDetails(db, doc=doc) |
228 | 135 | break | 135 | break |
229 | 136 | # test get_appname and get_pkgname | ||
230 | 137 | self.assertEqual(db.get_appname(doc), "Ubuntu Software Center Test") | ||
231 | 138 | self.assertEqual(db.get_pkgname(doc), "software-center") | ||
232 | 139 | # test appdetails | ||
233 | 136 | self.assertEqual(appdetails.name, "Ubuntu Software Center Test") | 140 | self.assertEqual(appdetails.name, "Ubuntu Software Center Test") |
234 | 137 | self.assertEqual(appdetails.pkgname, "software-center") | 141 | self.assertEqual(appdetails.pkgname, "software-center") |
235 | 138 | # FIXME: add a dekstop file with a real channel to test | 142 | # FIXME: add a dekstop file with a real channel to test |
This
index_ name(document, name, self.indexer) add_value( XAPIAN_ VALUE_APPNAME, name)
+ document.
should not be needed, index_name() is doing this already.