Merge lp:~mvo/software-center/pep8-e125 into lp:software-center

Proposed by Michael Vogt
Status: Merged
Merged at revision: 3275
Proposed branch: lp:~mvo/software-center/pep8-e125
Merge into: lp:software-center
Diff against target: 1992 lines (+264/-263)
58 files modified
softwarecenter/backend/channel.py (+5/-5)
softwarecenter/backend/installbackend.py (+7/-7)
softwarecenter/backend/installbackend_impl/aptd.py (+15/-13)
softwarecenter/backend/installbackend_impl/packagekitd.py (+2/-2)
softwarecenter/backend/piston/rnrclient_fake.py (+3/-2)
softwarecenter/backend/piston/rnrclient_pristine.py (+3/-2)
softwarecenter/backend/reviews/__init__.py (+4/-4)
softwarecenter/backend/reviews/rnr.py (+1/-1)
softwarecenter/backend/scagent.py (+1/-1)
softwarecenter/db/appfilter.py (+2/-2)
softwarecenter/db/application.py (+11/-11)
softwarecenter/db/categories.py (+2/-2)
softwarecenter/db/database.py (+6/-5)
softwarecenter/db/debfile.py (+1/-1)
softwarecenter/db/enquire.py (+1/-1)
softwarecenter/db/history_impl/apthistory.py (+2/-2)
softwarecenter/db/pkginfo_impl/aptcache.py (+22/-22)
softwarecenter/db/pkginfo_impl/packagekit.py (+5/-4)
softwarecenter/db/update.py (+3/-2)
softwarecenter/db/utils.py (+1/-1)
softwarecenter/ui/gtk3/app.py (+32/-37)
softwarecenter/ui/gtk3/aptd_gtk3.py (+1/-1)
softwarecenter/ui/gtk3/dialogs/deauthorize_dialog.py (+2/-3)
softwarecenter/ui/gtk3/dialogs/dependency_dialogs.py (+2/-3)
softwarecenter/ui/gtk3/dialogs/dialog_tos.py (+1/-1)
softwarecenter/ui/gtk3/gmenusearch.py (+4/-4)
softwarecenter/ui/gtk3/models/appstore2.py (+2/-2)
softwarecenter/ui/gtk3/models/pendingstore.py (+1/-1)
softwarecenter/ui/gtk3/panes/availablepane.py (+8/-8)
softwarecenter/ui/gtk3/panes/installedpane.py (+2/-2)
softwarecenter/ui/gtk3/panes/softwarepane.py (+4/-4)
softwarecenter/ui/gtk3/panes/viewswitcher.py (+1/-1)
softwarecenter/ui/gtk3/review_gui_helper.py (+18/-17)
softwarecenter/ui/gtk3/session/appmanager.py (+1/-1)
softwarecenter/ui/gtk3/session/navhistory.py (+2/-2)
softwarecenter/ui/gtk3/session/viewmanager.py (+2/-3)
softwarecenter/ui/gtk3/views/appdetailsview.py (+24/-25)
softwarecenter/ui/gtk3/views/appview.py (+1/-1)
softwarecenter/ui/gtk3/views/catview.py (+3/-3)
softwarecenter/ui/gtk3/views/lobbyview.py (+1/-1)
softwarecenter/ui/gtk3/views/pkgnamesview.py (+1/-2)
softwarecenter/ui/gtk3/views/purchaseview.py (+6/-6)
softwarecenter/ui/gtk3/widgets/actionbar.py (+2/-2)
softwarecenter/ui/gtk3/widgets/apptreeview.py (+6/-6)
softwarecenter/ui/gtk3/widgets/buttons.py (+2/-2)
softwarecenter/ui/gtk3/widgets/cellrenderers.py (+3/-3)
softwarecenter/ui/gtk3/widgets/containers.py (+1/-1)
softwarecenter/ui/gtk3/widgets/description.py (+7/-6)
softwarecenter/ui/gtk3/widgets/exhibits.py (+6/-6)
softwarecenter/ui/gtk3/widgets/menubutton.py (+1/-1)
softwarecenter/ui/gtk3/widgets/oneconfviews.py (+1/-1)
softwarecenter/ui/gtk3/widgets/recommendations.py (+1/-1)
softwarecenter/ui/gtk3/widgets/reviews.py (+8/-8)
softwarecenter/ui/gtk3/widgets/thumbnail.py (+5/-3)
softwarecenter/ui/gtk3/widgets/webkit.py (+1/-1)
softwarecenter/ui/gtk3/widgets/weblivedialog.py (+2/-2)
softwarecenter/ui/qml/pkglist.py (+1/-1)
tests/test_pep8.py (+1/-1)
To merge this branch: bzr merge lp:~mvo/software-center/pep8-e125
Reviewer Review Type Date Requested Status
dobey Approve
software-store-developers Pending
Review via email: mp+139963@code.launchpad.net

Description of the change

This branch fixes the pep8 errors of type E125

To post a comment you must log in.
Revision history for this message
dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/backend/channel.py'
2--- softwarecenter/backend/channel.py 2012-11-28 17:36:38 +0000
3+++ softwarecenter/backend/channel.py 2012-12-14 17:01:33 +0000
4@@ -73,7 +73,7 @@
5 doc = self.db.xapiandb.get_document(m.get_docid())
6 for term_iter in doc.termlist():
7 if (term_iter.term.startswith("XOO") and
8- len(term_iter.term) > 3):
9+ len(term_iter.term) > 3):
10 channel_origin = term_iter.term[3:]
11 break
12 LOG.debug("channel_name: %s" % channel_name)
13@@ -229,7 +229,7 @@
14 # here as well
15
16 def _get_display_name_for_channel(self, channel_name, channel_origin,
17- channel_component):
18+ channel_component):
19 if channel_component == "partner":
20 channel_display_name = _("Canonical Partners")
21 elif not channel_origin:
22@@ -249,7 +249,7 @@
23 return channel_display_name
24
25 def _get_icon_for_channel(self, channel_name, channel_origin,
26- channel_component):
27+ channel_component):
28 if channel_component == "partner":
29 channel_icon = "partner"
30 elif not channel_name:
31@@ -271,7 +271,7 @@
32 return channel_icon
33
34 def _get_channel_query_for_channel(self, channel_name, channel_origin,
35- channel_component):
36+ channel_component):
37
38 if channel_component == "partner":
39 q1 = xapian.Query("XOCpartner")
40@@ -312,7 +312,7 @@
41
42 # overrides
43 def _get_display_name_for_channel(self, channel_name, channel_origin,
44- channel_component):
45+ channel_component):
46 return channel_name
47
48 def _get_channel_query_for_channel(self, *args):
49
50=== modified file 'softwarecenter/backend/installbackend.py'
51--- softwarecenter/backend/installbackend.py 2012-03-19 14:20:55 +0000
52+++ softwarecenter/backend/installbackend.py 2012-12-14 17:01:33 +0000
53@@ -25,27 +25,27 @@
54 self.pending_purchases = []
55
56 def upgrade(self, app, iconname, addons_install=[], addons_remove=[],
57- metadata=None):
58+ metadata=None):
59 pass
60
61 def remove(self, app, iconname, addons_install=[], addons_remove=[],
62- metadata=None):
63+ metadata=None):
64 pass
65
66 def remove_multiple(self, apps, iconnames, addons_install=[],
67- addons_remove=[], metadatas=None):
68+ addons_remove=[], metadatas=None):
69 pass
70
71 def install(self, app, iconname, filename=None, addons_install=[],
72- addons_remove=[], metadata=None):
73+ addons_remove=[], metadata=None):
74 pass
75
76 def install_multiple(self, apps, iconnames, addons_install=[],
77- addons_remove=[], metadatas=None):
78+ addons_remove=[], metadatas=None):
79 pass
80
81 def apply_changes(self, app, iconname, addons_install=[],
82- addons_remove=[], metadata=None):
83+ addons_remove=[], metadata=None):
84 pass
85
86 def reload(self, sources_list=None, metadata=None):
87@@ -69,7 +69,7 @@
88 raise UnimplementedError("need custom ask_medium_required method")
89
90 def error(self, parent, primary, secondary, details=None,
91- alternative_action=None):
92+ alternative_action=None):
93 """ show an error dialog """
94 raise UnimplementedError("need custom error method")
95
96
97=== modified file 'softwarecenter/backend/installbackend_impl/aptd.py'
98--- softwarecenter/backend/installbackend_impl/aptd.py 2012-12-14 08:38:18 +0000
99+++ softwarecenter/backend/installbackend_impl/aptd.py 2012-12-14 17:01:33 +0000
100@@ -285,7 +285,7 @@
101 # FIXME: upgrade add-ons here
102 @inline_callbacks
103 def upgrade(self, app, iconname, addons_install=[], addons_remove=[],
104- metadata=None):
105+ metadata=None):
106 """ upgrade a single package """
107 pkgname = app.pkgname
108 appname = app.appname
109@@ -328,7 +328,7 @@
110
111 @inline_callbacks
112 def remove(self, app, iconname, addons_install=[], addons_remove=[],
113- metadata=None):
114+ metadata=None):
115 """ remove a single package """
116 pkgname = app.pkgname
117 appname = app.appname
118@@ -345,7 +345,7 @@
119
120 @inline_callbacks
121 def remove_multiple(self, apps, iconnames, addons_install=[],
122- addons_remove=[], metadatas=None):
123+ addons_remove=[], metadatas=None):
124 """ queue a list of packages for removal """
125 if metadatas is None:
126 metadatas = []
127@@ -356,7 +356,7 @@
128
129 @inline_callbacks
130 def install(self, app, iconname, filename=None, addons_install=[],
131- addons_remove=[], metadata=None, force=False):
132+ addons_remove=[], metadata=None, force=False):
133 """Install a single package from the archive
134 If filename is given a local deb package is installed instead.
135 """
136@@ -390,7 +390,7 @@
137
138 @inline_callbacks
139 def install_multiple(self, apps, iconnames, addons_install=[],
140- addons_remove=[], metadatas=None):
141+ addons_remove=[], metadatas=None):
142 """ queue a list of packages for install """
143 if metadatas is None:
144 metadatas = []
145@@ -401,7 +401,7 @@
146
147 @inline_callbacks
148 def apply_changes(self, app, iconname, addons_install=[],
149- addons_remove=[], metadata=None):
150+ addons_remove=[], metadata=None):
151 """ install and remove add-ons """
152 pkgname = app.pkgname
153 appname = app.appname
154@@ -430,7 +430,7 @@
155 d = apt_pkg.config.find_dir("Dir::Etc::sourceparts")
156 trans = None
157 if (not sources_list or
158- not os.path.exists(os.path.join(d, sources_list))):
159+ not os.path.exists(os.path.join(d, sources_list))):
160 sources_list = ""
161 try:
162 trans = yield self.aptd_client.update_cache(
163@@ -480,7 +480,8 @@
164
165 @inline_callbacks
166 def add_vendor_key_from_keyserver(self, keyid,
167- keyserver="hkp://keyserver.ubuntu.com:80/", metadata=None):
168+ keyserver="hkp://keyserver.ubuntu.com:80/",
169+ metadata=None):
170 # strip the keysize
171 if "/" in keyid:
172 keyid = keyid.split("/")[1]
173@@ -530,7 +531,7 @@
174
175 @inline_callbacks
176 def add_license_key(self, license_key, license_key_path,
177- license_key_oauth, pkgname):
178+ license_key_oauth, pkgname):
179 """ add a license key for a purchase. """
180 self._logger.debug(
181 "adding license_key for pkg '%s' of len: %i" % (
182@@ -630,7 +631,7 @@
183
184 @inline_callbacks
185 def _reload_for_commercial_repo_defer(self, app, trans_metadata,
186- sources_list):
187+ sources_list):
188 """
189 helper that reloads and registers a callback for when the reload is
190 finished
191@@ -659,7 +660,8 @@
192
193 @inline_callbacks
194 def _on_reload_for_add_repo_and_install_app_finished(self, backend, trans,
195- result, metadata, app):
196+ result, metadata,
197+ app):
198 """
199 callback that is called once after reload was queued
200 and will trigger the install of the for-pay package itself
201@@ -673,7 +675,7 @@
202 # check if this is the transaction we waiting for
203 key = "sc_add_repo_and_install_pkgname"
204 if not (key in trans.meta_data and
205- trans.meta_data[key] == app.pkgname):
206+ trans.meta_data[key] == app.pkgname):
207 return_value(None)
208
209 # get the debline and check if we have a release.gpg file
210@@ -876,7 +878,7 @@
211 if enum == enums.EXIT_FAILED:
212 # Handle invalid packages separately
213 if (trans.error and
214- trans.error.code == enums.ERROR_INVALID_PACKAGE_FILE):
215+ trans.error.code == enums.ERROR_INVALID_PACKAGE_FILE):
216 action = _("_Ignore and install")
217 res = self._show_transaction_failed_dialog(
218 trans, enum, action)
219
220=== modified file 'softwarecenter/backend/installbackend_impl/packagekitd.py'
221--- softwarecenter/backend/installbackend_impl/packagekitd.py 2012-11-28 17:36:38 +0000
222+++ softwarecenter/backend/installbackend_impl/packagekitd.py 2012-12-14 17:01:33 +0000
223@@ -269,7 +269,7 @@
224 (app,), (iconname,), addons_install, addons_remove, metadata)
225
226 def install_multiple(self, apps, iconnames,
227- addons_install=[], addons_remove=[], metadatas=None):
228+ addons_install=[], addons_remove=[], metadatas=None):
229
230 pkgnames = [app.pkgname for app in apps]
231 appnames = [app.appname for app in apps]
232@@ -301,7 +301,7 @@
233 TransactionTypes.INSTALL)
234
235 def apply_changes(self, pkgname, appname, iconname,
236- addons_install=[], addons_remove=[], metadata=None):
237+ addons_install=[], addons_remove=[], metadata=None):
238 pass
239
240 def reload(self, sources_list=None, metadata=None):
241
242=== modified file 'softwarecenter/backend/piston/rnrclient_fake.py'
243--- softwarecenter/backend/piston/rnrclient_fake.py 2012-11-28 17:36:38 +0000
244+++ softwarecenter/backend/piston/rnrclient_fake.py 2012-12-14 17:01:33 +0000
245@@ -64,7 +64,7 @@
246 @returns_list_of(ReviewsStats)
247 @network_delay
248 def review_stats(self, origin='any', distroseries='any', days=None,
249- valid_days=(1, 3, 7)):
250+ valid_days=(1, 3, 7)):
251 if self._fake_settings.get_setting('review_stats_error'):
252 raise APIError(self._exception_msg)
253
254@@ -97,7 +97,8 @@
255 @returns_list_of(ReviewDetails)
256 @network_delay
257 def get_reviews(self, packagename, language='any', origin='any',
258- distroseries='any', version='any', appname='', page=1, sort='helpful'):
259+ distroseries='any', version='any', appname='',
260+ page=1, sort='helpful'):
261
262 # work out how many reviews to return for pagination
263 if page <= self._fake_settings.get_setting('review_pages'):
264
265=== modified file 'softwarecenter/backend/piston/rnrclient_pristine.py'
266--- softwarecenter/backend/piston/rnrclient_pristine.py 2012-11-28 17:36:38 +0000
267+++ softwarecenter/backend/piston/rnrclient_pristine.py 2012-12-14 17:01:33 +0000
268@@ -83,7 +83,7 @@
269 @validate('days', int, required=False)
270 @returns_list_of(ReviewsStats)
271 def review_stats(self, origin='any', distroseries='any', days=None,
272- valid_days=(1, 3, 7)):
273+ valid_days=(1, 3, 7)):
274 """Fetch ratings for a particular distroseries"""
275 url = 'review-stats/{0}/{1}/'.format(origin, distroseries)
276 if days is not None:
277@@ -106,7 +106,8 @@
278 @validate('sort', str, required=False)
279 @returns_list_of(ReviewDetails)
280 def get_reviews(self, packagename, language='any', origin='any',
281- distroseries='any', version='any', appname='', page=1, sort='helpful'):
282+ distroseries='any', version='any', appname='',
283+ page=1, sort='helpful'):
284 """Fetch ratings and reviews for a particular package name.
285
286 If any of the optional arguments are provided, fetch reviews for that
287
288=== modified file 'softwarecenter/backend/reviews/__init__.py'
289--- softwarecenter/backend/reviews/__init__.py 2012-11-28 15:43:49 +0000
290+++ softwarecenter/backend/reviews/__init__.py 2012-12-14 17:01:33 +0000
291@@ -466,7 +466,7 @@
292 pass
293
294 def spawn_submit_usefulness_ui(self, review_id, is_useful, parent_xid,
295- datadir, callback):
296+ datadir, callback):
297 """Spawn a helper to submit a usefulness vote."""
298 pass
299
300@@ -475,7 +475,7 @@
301 pass
302
303 def spawn_modify_review_ui(self, parent_xid, iconname, datadir, review_id,
304- callback):
305+ callback):
306 """Spawn a helper to modify a review."""
307 pass
308
309@@ -502,7 +502,7 @@
310 return random.choice(self.SUMMARIES)
311
312 def get_reviews(self, application, page=1, language=None,
313- sort=0, relaxed=False):
314+ sort=0, relaxed=False):
315 if not application in self._review_stats_cache:
316 self.get_review_stats(application)
317 stats = self._review_stats_cache[application]
318@@ -683,7 +683,7 @@
319 self._reviews_cache = {}
320
321 def get_reviews(self, application, page=1, language=None,
322- sort=0, relaxed=False):
323+ sort=0, relaxed=False):
324 self.emit("get-reviews-finished", application, [])
325
326 def get_review_stats(self, application):
327
328=== modified file 'softwarecenter/backend/reviews/rnr.py'
329--- softwarecenter/backend/reviews/rnr.py 2012-12-06 16:16:49 +0000
330+++ softwarecenter/backend/reviews/rnr.py 2012-12-14 17:01:33 +0000
331@@ -162,7 +162,7 @@
332 review_stats = self.REVIEW_STATS_CACHE
333
334 if self._cache_version_old and self._server_has_histogram(
335- piston_review_stats):
336+ piston_review_stats):
337 self.REVIEW_STATS_CACHE = {}
338 self.save_review_stats_cache_file()
339 self.refresh_review_stats()
340
341=== modified file 'softwarecenter/backend/scagent.py'
342--- softwarecenter/backend/scagent.py 2012-11-28 17:36:38 +0000
343+++ softwarecenter/backend/scagent.py 2012-12-14 17:01:33 +0000
344@@ -106,7 +106,7 @@
345 complete_only=True)
346
347 def _on_query_available_for_me_data(self, spawner,
348- piston_available_for_me):
349+ piston_available_for_me):
350 self.emit("available-for-me", piston_available_for_me)
351
352 def query_exhibits(self):
353
354=== modified file 'softwarecenter/db/appfilter.py'
355--- softwarecenter/db/appfilter.py 2012-08-07 13:15:08 +0000
356+++ softwarecenter/db/appfilter.py 2012-12-14 17:01:33 +0000
357@@ -92,11 +92,11 @@
358 return False
359 if self.installed_only:
360 if (not pkgname in self.cache or
361- not self.cache[pkgname].is_installed):
362+ not self.cache[pkgname].is_installed):
363 return False
364 if self.not_installed_only:
365 if (pkgname in self.cache and
366- self.cache[pkgname].is_installed):
367+ self.cache[pkgname].is_installed):
368 return False
369 if global_filter.supported_only:
370 if not self.distro.is_supported(self.cache, doc, pkgname):
371
372=== modified file 'softwarecenter/db/application.py'
373--- softwarecenter/db/application.py 2012-11-28 17:36:38 +0000
374+++ softwarecenter/db/application.py 2012-12-14 17:01:33 +0000
375@@ -209,7 +209,7 @@
376 # load pkg cache
377 self._pkg = None
378 if (self._app.pkgname in self._cache and
379- self._cache[self._app.pkgname].candidate):
380+ self._cache[self._app.pkgname].candidate):
381 self._pkg = self._cache[self._app.pkgname]
382
383 # load xapian document
384@@ -227,9 +227,9 @@
385 section_matches = re.findall(r'section=[a-z]*',
386 self._app.request)
387 if (not self._pkg and
388- not debfile_matches and
389- not channel_matches and
390- not section_matches):
391+ not debfile_matches and
392+ not channel_matches and
393+ not section_matches):
394 self._error = _("Not found")
395 self._error_not_found = utf8(
396 _(u"There isn\u2019t a "
397@@ -275,7 +275,7 @@
398 value = list(value)
399 # make sure that the type can be encoded
400 if not type(value) in [
401- list, dict, tuple, basestring, int, float, bool, None]:
402+ list, dict, tuple, basestring, int, float, bool, None]:
403 value = "%s" % value
404 # dbus does not like empty dicts/lists
405 if isinstance(value, dict) or isinstance(value, list):
406@@ -328,7 +328,7 @@
407 if self._pkg:
408 for origin in self._pkg.candidate.origins:
409 if (origin.origin == self._distro.get_distro_channel_name() and
410- origin.trusted and origin.component):
411+ origin.trusted and origin.component):
412 return origin.component
413 # then xapian
414 elif self._doc:
415@@ -342,8 +342,8 @@
416 valid_section_matches = []
417 for section_match in section_matches:
418 if (self._unavailable_component(
419- component_to_check=section_match) and
420- valid_section_matches.count(section_match) == 0):
421+ component_to_check=section_match) and
422+ valid_section_matches.count(section_match) == 0):
423 valid_section_matches.append(section_match)
424 if valid_section_matches:
425 return ('&').join(valid_section_matches)
426@@ -550,7 +550,7 @@
427 if self.raw_price:
428 return PkgStates.NEEDS_PURCHASE
429 if (self.purchase_date and
430- self._doc.get_value(XapianValues.ARCHIVE_DEB_LINE)):
431+ self._doc.get_value(XapianValues.ARCHIVE_DEB_LINE)):
432 supported_distros = self.supported_distros
433
434 # Until bug 917109 is fixed on the server we won't have
435@@ -563,7 +563,7 @@
436 current_arch = self._distro.get_architecture()
437 if current_distro in supported_distros and (
438 current_arch in supported_distros[current_distro] or
439- 'any' in supported_distros[current_distro]):
440+ 'any' in supported_distros[current_distro]):
441 return PkgStates.PURCHASED_BUT_REPO_MUST_BE_ENABLED
442 else:
443 return PkgStates.PURCHASED_BUT_NOT_AVAILABLE_FOR_SERIES
444@@ -572,7 +572,7 @@
445 components = self.component.split('&')
446 for component in components:
447 if component and self._unavailable_component(
448- component_to_check=component):
449+ component_to_check=component):
450 return PkgStates.NEEDS_SOURCE
451 self._error = _("Not found")
452 self._error_not_found = utf8(
453
454=== modified file 'softwarecenter/db/categories.py'
455--- softwarecenter/db/categories.py 2012-11-28 17:36:38 +0000
456+++ softwarecenter/db/categories.py 2012-12-14 17:01:33 +0000
457@@ -449,8 +449,8 @@
458 for element in item.getchildren():
459 # ignore inline translations, we use gettext for this
460 if (element.tag == "Name" and
461- '{http://www.w3.org/XML/1998/namespace}lang' in
462- element.attrib):
463+ '{http://www.w3.org/XML/1998/namespace}lang' in
464+ element.attrib):
465 continue
466 if element.tag == "Name":
467 untranslated_name = element.text
468
469=== modified file 'softwarecenter/db/database.py'
470--- softwarecenter/db/database.py 2012-12-06 16:16:49 +0000
471+++ softwarecenter/db/database.py 2012-12-14 17:01:33 +0000
472@@ -196,7 +196,7 @@
473 except:
474 LOG.exception("failed to add apt-xapian-index")
475 if (self._use_agent and
476- os.path.exists(XAPIAN_BASE_PATH_SOFTWARE_CENTER_AGENT)):
477+ os.path.exists(XAPIAN_BASE_PATH_SOFTWARE_CENTER_AGENT)):
478 try:
479 sca = xapian.Database(XAPIAN_BASE_PATH_SOFTWARE_CENTER_AGENT)
480 xapiandb.add_database(sca)
481@@ -324,7 +324,7 @@
482 return query
483
484 def get_query_list_from_search_entry(self, search_term,
485- category_query=None):
486+ category_query=None):
487 """ get xapian.Query from a search term string and a limit the
488 search to the given category
489 """
490@@ -417,7 +417,8 @@
491 return self.xapian_parser.get_corrected_query_string()
492
493 def get_most_popular_applications_for_mimetype(self, mimetype,
494- only_uninstalled=True, num=3):
495+ only_uninstalled=True,
496+ num=3):
497 """ return a list of the most popular applications for the given
498 mimetype
499 """
500@@ -452,7 +453,7 @@
501 if not summary and self._aptcache.ready:
502 pkgname = self.get_pkgname(doc)
503 if (pkgname in self._aptcache and
504- self._aptcache[pkgname].candidate):
505+ self._aptcache[pkgname].candidate):
506 return self._aptcache[pkgname].candidate.summary
507 elif channel:
508 # FIXME: print something if available for our arch
509@@ -595,7 +596,7 @@
510 for m in matches:
511 pkgname = self.get_pkgname(m.document)
512 if (pkgname in self._aptcache and
513- self._aptcache[pkgname].is_installed):
514+ self._aptcache[pkgname].is_installed):
515 installed_purchased_packages.add(pkgname)
516 return installed_purchased_packages
517
518
519=== modified file 'softwarecenter/db/debfile.py'
520--- softwarecenter/db/debfile.py 2012-10-17 07:16:02 +0000
521+++ softwarecenter/db/debfile.py 2012-12-14 17:01:33 +0000
522@@ -103,7 +103,7 @@
523 # load pkg cache
524 self._pkg = None
525 if (self._app.pkgname in self._cache and
526- self._cache[self._app.pkgname].candidate):
527+ self._cache[self._app.pkgname].candidate):
528 self._pkg = self._cache[self._app.pkgname]
529 # load xapian document
530 self._doc = None
531
532=== modified file 'softwarecenter/db/enquire.py'
533--- softwarecenter/db/enquire.py 2012-11-28 15:43:49 +0000
534+++ softwarecenter/db/enquire.py 2012-12-14 17:01:33 +0000
535@@ -193,7 +193,7 @@
536 if self.sortmode == SortMethods.BY_CATALOGED_TIME:
537 sorter = xapian.MultiValueKeyMaker()
538 if (self.db._axi_values and
539- "catalogedtime" in self.db._axi_values):
540+ "catalogedtime" in self.db._axi_values):
541 sorter.add_value(
542 self.db._axi_values["catalogedtime"])
543 sorter.add_value(XapianValues.DB_CATALOGED_TIME)
544
545=== modified file 'softwarecenter/db/history_impl/apthistory.py'
546--- softwarecenter/db/history_impl/apthistory.py 2012-11-28 16:08:02 +0000
547+++ softwarecenter/db/history_impl/apthistory.py 2012-12-14 17:01:33 +0000
548@@ -147,8 +147,8 @@
549 continue
550 # ignore the ones we have already
551 if (rescan and
552- len(self._transactions) > 0 and
553- trans.start_date <= self._transactions[0].start_date):
554+ len(self._transactions) > 0 and
555+ trans.start_date <= self._transactions[0].start_date):
556 continue
557 # add it
558 # FIXME: this is a list, so potentially slow, but its sorted
559
560=== modified file 'softwarecenter/db/pkginfo_impl/aptcache.py'
561--- softwarecenter/db/pkginfo_impl/aptcache.py 2012-11-28 15:54:20 +0000
562+++ softwarecenter/db/pkginfo_impl/aptcache.py 2012-12-14 17:01:33 +0000
563@@ -174,47 +174,47 @@
564
565 def is_available(self, pkgname):
566 return (pkgname in self._cache and
567- self._cache[pkgname].candidate)
568+ self._cache[pkgname].candidate)
569
570 def get_installed(self, pkgname):
571 if (pkgname not in self._cache or
572- not self._cache[pkgname].is_installed):
573+ not self._cache[pkgname].is_installed):
574 return None
575 return AptCacheVersion(self._cache[pkgname].installed)
576
577 def get_candidate(self, pkgname):
578 if (pkgname not in self._cache or
579- not self._cache[pkgname].candidate):
580+ not self._cache[pkgname].candidate):
581 return None
582 return AptCacheVersion(self._cache[pkgname].candidate)
583
584 def get_versions(self, pkgname):
585 if (pkgname not in self._cache or
586- not self._cache[pkgname].candidate):
587+ not self._cache[pkgname].candidate):
588 return []
589 return [AptCacheVersion(v) for v in self._cache[pkgname].versions]
590
591 def get_section(self, pkgname):
592 if (pkgname not in self._cache or
593- not self._cache[pkgname].candidate):
594+ not self._cache[pkgname].candidate):
595 return ''
596 return self._cache[pkgname].candidate.section
597
598 def get_summary(self, pkgname):
599 if (pkgname not in self._cache or
600- not self._cache[pkgname].candidate):
601+ not self._cache[pkgname].candidate):
602 return ''
603 return self._cache[pkgname].candidate.summary
604
605 def get_description(self, pkgname):
606 if (pkgname not in self._cache or
607- not self._cache[pkgname].candidate):
608+ not self._cache[pkgname].candidate):
609 return ''
610 return self._cache[pkgname].candidate.description
611
612 def get_website(self, pkgname):
613 if (pkgname not in self._cache or
614- not self._cache[pkgname].candidate):
615+ not self._cache[pkgname].candidate):
616 return ''
617 return self._cache[pkgname].candidate.homepage
618
619@@ -225,13 +225,13 @@
620
621 def get_size(self, pkgname):
622 if (pkgname not in self._cache or
623- not self._cache[pkgname].candidate):
624+ not self._cache[pkgname].candidate):
625 return 0
626 return self._cache[pkgname].candidate.size
627
628 def get_installed_size(self, pkgname):
629 if (pkgname not in self._cache or
630- not self._cache[pkgname].candidate):
631+ not self._cache[pkgname].candidate):
632 return 0
633 return self._cache[pkgname].candidate.installed_size
634
635@@ -277,7 +277,7 @@
636 return self._cache.__contains__(k)
637
638 def _on_apt_finished_stamp_changed(self, monitor, afile, other_file,
639- event):
640+ event):
641 if not event == Gio.FileMonitorEvent.CHANGES_DONE_HINT:
642 return
643 if self._timeout_id:
644@@ -297,8 +297,10 @@
645 dep_type = rdep.dep_type_untranslated
646 if dep_type in type:
647 rdep_name = rdep.parent_pkg.name
648- if rdep_name in self._cache and (not onlyInstalled or
649- (onlyInstalled and self._cache[rdep_name].is_installed)):
650+ if (rdep_name in self._cache and
651+ (not onlyInstalled or (
652+ onlyInstalled and
653+ self._cache[rdep_name].is_installed))):
654 rdeps.add(rdep.parent_pkg.name)
655 return rdeps
656
657@@ -341,7 +343,7 @@
658 continue
659 else:
660 if (pkg.is_installed and
661- pkg.is_auto_removable):
662+ pkg.is_auto_removable):
663 installed_auto_deps.add(dep_name)
664 return installed_auto_deps
665
666@@ -396,9 +398,9 @@
667 # FIXME: test for more properties here?
668 for it in self._cache._cache.file_list:
669 if (it.component != "" and
670- it.component == component and
671- it.archive != "" and
672- it.archive == distro_codename):
673+ it.component == component and
674+ it.archive != "" and
675+ it.archive == distro_codename):
676 return True
677 return False
678
679@@ -572,7 +574,7 @@
680 # Check if the package is provided in the release
681 for version in pkg.versions:
682 if [origin for origin in version.origins
683- if origin.archive == archive_suite]:
684+ if origin.archive == archive_suite]:
685 break
686 else:
687 return False
688@@ -669,8 +671,7 @@
689 addon_pkg = self._cache[addon]
690 # we don't care for essential or important (or references
691 # to our self)
692- if (addon_pkg.essential or
693- addon_pkg._pkg.important):
694+ if addon_pkg.essential or addon_pkg._pkg.important:
695 LOG.debug("essential or important %s" % addon)
696 return False
697 # we have it in our dependencies already
698@@ -700,8 +701,7 @@
699 return True
700 #----------------------------------------------------------------
701 # deb file, or pkg needing source, etc
702- if (not pkgname in self._cache or
703- not self._cache[pkgname].candidate):
704+ if not pkgname in self._cache or not self._cache[pkgname].candidate:
705 return ([], [])
706
707 # initial setup
708
709=== modified file 'softwarecenter/db/pkginfo_impl/packagekit.py'
710--- softwarecenter/db/pkginfo_impl/packagekit.py 2012-11-28 17:36:38 +0000
711+++ softwarecenter/db/pkginfo_impl/packagekit.py 2012-12-14 17:01:33 +0000
712@@ -267,8 +267,9 @@
713 and p.get_info() == packagekit.InfoEnum.INSTALLED]
714
715 def query_total_size_on_install(self, pkgname,
716- addons_install=None, addons_remove=None,
717- archive_suite=None):
718+ addons_install=None,
719+ addons_remove=None,
720+ archive_suite=None):
721 """ emit query-total-size-on-install-done signal
722 with disk size in KB calculated for pkgname installation
723 plus addons change.
724@@ -316,7 +317,7 @@
725 return pkgs[0]
726
727 def _get_one_package(self, pkgname, pfilter=packagekit.FilterEnum.NONE,
728- cache=USE_CACHE):
729+ cache=USE_CACHE):
730 LOG.debug("package_one %s", pkgname) # , self._cache.keys()
731 if (pkgname in self._cache.keys()) and cache:
732 return self._cache[pkgname]
733@@ -343,7 +344,7 @@
734 return pkgs
735
736 def _get_repolist(self, pfilter=packagekit.FilterEnum.NONE,
737- cache=USE_CACHE):
738+ cache=USE_CACHE):
739 """ obtain and cache a dictionary of repositories """
740 if self._repocache:
741 return self._repocache
742
743=== modified file 'softwarecenter/db/update.py'
744--- softwarecenter/db/update.py 2012-12-06 16:16:49 +0000
745+++ softwarecenter/db/update.py 2012-12-14 17:01:33 +0000
746@@ -417,8 +417,9 @@
747 return
748 # whitelist
749 for tag in tags:
750+ s = "%s%s" % (REGION_WHITELIST_TAG, countrycode)
751 if (tag.startswith(REGION_WHITELIST_TAG) and not
752- "%s%s" % (REGION_WHITELIST_TAG, countrycode) in tag):
753+ s in tag):
754 LOG.debug("%r.make_doc: skipping region restricted "
755 "app %r (region not whitelisted)",
756 self.__class__.__name__, name)
757@@ -562,7 +563,7 @@
758 # the thumbnail and scale it for display, this is done because
759 # we no longer keep thumbnail versions of screenshots on the server
760 if (hasattr(self.sca_application, "screenshot_url") and
761- not hasattr(self.sca_application, "thumbnail_url")):
762+ not hasattr(self.sca_application, "thumbnail_url")):
763 self.sca_application.thumbnail_url = \
764 self.sca_application.screenshot_url
765 if hasattr(self.sca_application, "description"):
766
767=== modified file 'softwarecenter/db/utils.py'
768--- softwarecenter/db/utils.py 2012-11-28 16:23:44 +0000
769+++ softwarecenter/db/utils.py 2012-12-14 17:01:33 +0000
770@@ -52,7 +52,7 @@
771 if db.get_appname(doc):
772 pkgname = db.get_pkgname(doc)
773 if (pkgname in db._aptcache and
774- db._aptcache[pkgname].is_installed):
775+ db._aptcache[pkgname].is_installed):
776 apps.add(db.get_application(doc))
777 return apps
778
779
780=== modified file 'softwarecenter/ui/gtk3/app.py'
781--- softwarecenter/ui/gtk3/app.py 2012-12-06 16:16:49 +0000
782+++ softwarecenter/ui/gtk3/app.py 2012-12-14 17:01:33 +0000
783@@ -646,55 +646,55 @@
784
785 # close
786 if ((event.keyval == Gdk.keyval_from_name("w") or
787- event.keyval == Gdk.keyval_from_name("q")) and
788- event.state == Gdk.ModifierType.CONTROL_MASK):
789+ event.keyval == Gdk.keyval_from_name("q")) and
790+ event.state == Gdk.ModifierType.CONTROL_MASK):
791 self.menuitem_close.activate()
792
793 # undo/redo
794 if (event.keyval == Gdk.keyval_from_name("z") and
795- event.state == Gdk.ModifierType.CONTROL_MASK):
796+ event.state == Gdk.ModifierType.CONTROL_MASK):
797 self.menuitem_edit.activate()
798 if self.menuitem_undo.get_sensitive():
799 self.menuitem_undo.activate()
800
801 if (event.keyval == Gdk.keyval_from_name("Z") and
802- event.state == (Gdk.ModifierType.SHIFT_MASK |
803- Gdk.ModifierType.CONTROL_MASK)):
804+ event.state == (Gdk.ModifierType.SHIFT_MASK |
805+ Gdk.ModifierType.CONTROL_MASK)):
806 self.menuitem_edit.activate()
807 if self.menuitem_redo.get_sensitive():
808 self.menuitem_redo.activate()
809
810 # cut/copy/paste
811 if (event.keyval == Gdk.keyval_from_name("x") and
812- event.state == Gdk.ModifierType.CONTROL_MASK):
813+ event.state == Gdk.ModifierType.CONTROL_MASK):
814 self.menuitem_edit.activate()
815 if self.menuitem_cut.get_sensitive():
816 self.menuitem_cut.activate()
817
818 if (event.keyval == Gdk.keyval_from_name("c") and
819- event.state == Gdk.ModifierType.CONTROL_MASK):
820+ event.state == Gdk.ModifierType.CONTROL_MASK):
821 self.menuitem_edit.activate()
822 if self.menuitem_copy.get_sensitive():
823 self.menuitem_copy.activate()
824
825 # copy web link
826 if (event.keyval == Gdk.keyval_from_name("C") and
827- event.state == (Gdk.ModifierType.SHIFT_MASK |
828- Gdk.ModifierType.CONTROL_MASK)):
829+ event.state == (Gdk.ModifierType.SHIFT_MASK |
830+ Gdk.ModifierType.CONTROL_MASK)):
831 self.menuitem_edit.activate()
832 if self.menuitem_copy_web_link.get_sensitive():
833 self.menuitem_copy_web_link.activate()
834
835 # select all
836 if (event.keyval == Gdk.keyval_from_name("a") and
837- event.state == Gdk.ModifierType.CONTROL_MASK):
838+ event.state == Gdk.ModifierType.CONTROL_MASK):
839 self.menuitem_edit.activate()
840 if self.menuitem_select_all.get_sensitive():
841 self.menuitem_select_all.activate()
842
843 # search
844 if (event.keyval == Gdk.keyval_from_name("f") and
845- event.state == Gdk.ModifierType.CONTROL_MASK):
846+ event.state == Gdk.ModifierType.CONTROL_MASK):
847 self.menuitem_edit.activate()
848 if self.menuitem_search.get_sensitive():
849 self.menuitem_search.activate()
850@@ -702,9 +702,9 @@
851 # back
852 if ((event.keyval == Gdk.keyval_from_name("bracketleft") and
853 event.state == Gdk.ModifierType.CONTROL_MASK) or
854- ((event.keyval == Gdk.keyval_from_name("Left") or
855- event.keyval == Gdk.keyval_from_name("KP_Left")) and
856- event.state == Gdk.ModifierType.MOD1_MASK)):
857+ ((event.keyval == Gdk.keyval_from_name("Left") or
858+ event.keyval == Gdk.keyval_from_name("KP_Left")) and
859+ event.state == Gdk.ModifierType.MOD1_MASK)):
860 # using the backspace key to navigate back has been disabled as it
861 # has started to show dodgy side effects which I can't figure how
862 # to deal with
863@@ -715,9 +715,9 @@
864 # forward
865 if ((event.keyval == Gdk.keyval_from_name("bracketright") and
866 event.state == Gdk.ModifierType.CONTROL_MASK) or
867- ((event.keyval == Gdk.keyval_from_name("Right") or
868- event.keyval == Gdk.keyval_from_name("KP_Right")) and
869- event.state == Gdk.ModifierType.MOD1_MASK)):
870+ ((event.keyval == Gdk.keyval_from_name("Right") or
871+ event.keyval == Gdk.keyval_from_name("KP_Right")) and
872+ event.state == Gdk.ModifierType.MOD1_MASK)):
873 self.menuitem_view.activate()
874 if self.menuitem_go_forward.get_sensitive():
875 self.menuitem_go_forward.activate()
876@@ -787,10 +787,10 @@
877 pkg_state = appdetails.pkg_state
878 error = appdetails.error
879 if (app.pkgname in
880- self.active_pane.app_view.tree_view._action_block_list):
881+ self.active_pane.app_view.tree_view._action_block_list):
882 return False
883 elif (pkg_state == PkgStates.UPGRADABLE or
884- pkg_state == PkgStates.REINSTALLABLE and not error):
885+ pkg_state == PkgStates.REINSTALLABLE and not error):
886 self.menuitem_install.set_sensitive(True)
887 self.menuitem_remove.set_sensitive(True)
888 elif pkg_state == PkgStates.INSTALLED:
889@@ -798,11 +798,11 @@
890 elif pkg_state == PkgStates.UNINSTALLED and not error:
891 self.menuitem_install.set_sensitive(True)
892 elif (not pkg_state and
893- not self.active_pane.is_category_view_showing() and
894- app.pkgname in self.cache and
895- not app.pkgname in
896- self.active_pane.app_view.tree_view._action_block_list and
897- not error):
898+ not self.active_pane.is_category_view_showing() and
899+ app.pkgname in self.cache and
900+ not app.pkgname in
901+ self.active_pane.app_view.tree_view._action_block_list and
902+ not error):
903 # when does this happen?
904 pkg = self.cache[app.pkgname]
905 installed = bool(pkg.installed)
906@@ -955,8 +955,8 @@
907 self.active_pane = vm.get_view_widget(vm.get_active_view())
908
909 if (self.active_pane and
910- self.active_pane.searchentry and
911- self.active_pane.searchentry.get_visible()):
912+ self.active_pane.searchentry and
913+ self.active_pane.searchentry.get_visible()):
914 # undo, redo, cut, copy, paste, delete, select_all sensitive
915 # if searchentry is focused (and other more specific conditions)
916 if self.active_pane.searchentry.is_focus():
917@@ -984,7 +984,7 @@
918
919 # details view
920 if (self.active_pane and
921- self.active_pane.is_app_details_view_showing()):
922+ self.active_pane.is_app_details_view_showing()):
923
924 self.menuitem_select_all.set_sensitive(True)
925 desc = self.active_pane.app_details_view.desc
926@@ -1003,10 +1003,8 @@
927
928 def on_menuitem_copy_activate(self, menuitem):
929 if (self.active_pane and
930- self.active_pane.is_app_details_view_showing()):
931-
932+ self.active_pane.is_app_details_view_showing()):
933 self.active_pane.app_details_view.desc.copy_clipboard()
934-
935 elif self.active_pane:
936 self.active_pane.searchentry.copy_clipboard()
937
938@@ -1018,11 +1016,9 @@
939
940 def on_menuitem_select_all_activate(self, menuitem):
941 if (self.active_pane and
942- self.active_pane.is_app_details_view_showing()):
943-
944+ self.active_pane.is_app_details_view_showing()):
945 self.active_pane.app_details_view.desc.select_all()
946 self.active_pane.app_details_view.desc.grab_focus()
947-
948 elif self.active_pane:
949 self.active_pane.searchentry.select_region(0, -1)
950
951@@ -1085,11 +1081,10 @@
952 # get our active pane
953 self.active_pane = vm.get_view_widget(vm.get_active_view())
954 if (self.active_pane and
955- self.active_pane == self.available_pane or
956- self.active_pane == self.installed_pane):
957+ self.active_pane == self.available_pane or
958+ self.active_pane == self.installed_pane):
959 self.menuitem_view_all.set_sensitive(True)
960 self.menuitem_view_supported_only.set_sensitive(True)
961-
962 from softwarecenter.db.appfilter import get_global_filter
963 supported_only = get_global_filter().supported_only
964 self.menuitem_view_all.set_active(not supported_only)
965@@ -1149,7 +1144,7 @@
966 vm.nav_back()
967
968 def on_navhistory_forward_action_activate(self,
969- navhistory_forward_action=None):
970+ navhistory_forward_action=None):
971 vm = get_viewmanager()
972 vm.nav_forward()
973
974
975=== modified file 'softwarecenter/ui/gtk3/aptd_gtk3.py'
976--- softwarecenter/ui/gtk3/aptd_gtk3.py 2012-09-19 08:08:17 +0000
977+++ softwarecenter/ui/gtk3/aptd_gtk3.py 2012-12-14 17:01:33 +0000
978@@ -47,7 +47,7 @@
979 return False
980
981 def error(self, parent, primary, secondary, details=None,
982- alternative_action=None):
983+ alternative_action=None):
984 from dialogs import error
985 res = "ok"
986 res = error(parent=parent,
987
988=== modified file 'softwarecenter/ui/gtk3/dialogs/deauthorize_dialog.py'
989--- softwarecenter/ui/gtk3/dialogs/deauthorize_dialog.py 2012-09-14 15:01:37 +0000
990+++ softwarecenter/ui/gtk3/dialogs/deauthorize_dialog.py 2012-12-14 17:01:33 +0000
991@@ -35,7 +35,7 @@
992
993
994 def deauthorize_computer(parent, datadir, db, icons, account_name,
995- purchased_packages):
996+ purchased_packages):
997 """ Display a dialog to deauthorize the current computer for purchases
998 """
999 cache = db._aptcache
1000@@ -53,8 +53,7 @@
1001
1002 # use the icon for software-center in the dialog
1003 icon_name = "softwarecenter"
1004- if (icon_name is None or
1005- not icons.has_icon(icon_name)):
1006+ if icon_name is None or not icons.has_icon(icon_name):
1007 icon_name = Icons.MISSING_APP
1008 glade_dialog.image_icon.set_from_icon_name(icon_name,
1009 Gtk.IconSize.DIALOG)
1010
1011=== modified file 'softwarecenter/ui/gtk3/dialogs/dependency_dialogs.py'
1012--- softwarecenter/ui/gtk3/dialogs/dependency_dialogs.py 2012-09-14 15:01:37 +0000
1013+++ softwarecenter/ui/gtk3/dialogs/dependency_dialogs.py 2012-12-14 17:01:33 +0000
1014@@ -79,7 +79,7 @@
1015
1016
1017 def _get_confirm_internal_dialog(parent, app, db, icons, primary,
1018- button_text, depends, cache):
1019+ button_text, depends, cache):
1020 glade_dialog = SimpleGtkbuilderDialog(
1021 softwarecenter.paths.datadir, domain="software-center")
1022 dialog = glade_dialog.dialog_dependency_alert
1023@@ -90,8 +90,7 @@
1024 # get icon for the app
1025 appdetails = app.get_details(db)
1026 icon_name = appdetails.icon
1027- if (icon_name is None or
1028- not icons.has_icon(icon_name)):
1029+ if icon_name is None or not icons.has_icon(icon_name):
1030 icon_name = Icons.MISSING_APP
1031 glade_dialog.image_package_icon.set_from_icon_name(icon_name,
1032 Gtk.IconSize.DIALOG)
1033
1034=== modified file 'softwarecenter/ui/gtk3/dialogs/dialog_tos.py'
1035--- softwarecenter/ui/gtk3/dialogs/dialog_tos.py 2012-08-10 13:02:06 +0000
1036+++ softwarecenter/ui/gtk3/dialogs/dialog_tos.py 2012-12-14 17:01:33 +0000
1037@@ -73,7 +73,7 @@
1038 prop = pspec.name
1039 status = view.get_property(prop)
1040 if (status == WebKit.LoadStatus.FINISHED or
1041- status == WebKit.LoadStatus.FAILED):
1042+ status == WebKit.LoadStatus.FAILED):
1043 self.spinner.hide_spinner()
1044 if status == WebKit.LoadStatus.FINISHED:
1045 self.label.set_text(_("Do you accept these terms?"))
1046
1047=== modified file 'softwarecenter/ui/gtk3/gmenusearch.py'
1048--- softwarecenter/ui/gtk3/gmenusearch.py 2012-04-18 08:51:45 +0000
1049+++ softwarecenter/ui/gtk3/gmenusearch.py 2012-12-14 17:01:33 +0000
1050@@ -53,8 +53,8 @@
1051 if "applications/" in desktop_file_path:
1052 path_after_applications = desktop_file_path.split(
1053 "applications/")[1]
1054- if needle == path_after_applications.replace("/",
1055- APP_INSTALL_PATH_DELIMITER):
1056+ if needle == path_after_applications.replace(
1057+ "/", APP_INSTALL_PATH_DELIMITER):
1058 self._found = dirlist + [item]
1059 return
1060 current_type = dir_iter.next()
1061@@ -123,8 +123,8 @@
1062 if "applications/" in desktop_file_path:
1063 path_after_applications = desktop_file_path.split(
1064 "applications/")[1]
1065- if needle == path_after_applications.replace("/",
1066- APP_INSTALL_PATH_DELIMITER):
1067+ if needle == path_after_applications.replace(
1068+ "/", APP_INSTALL_PATH_DELIMITER):
1069 self._found = dirlist + [item]
1070 return
1071
1072
1073=== modified file 'softwarecenter/ui/gtk3/models/appstore2.py'
1074--- softwarecenter/ui/gtk3/models/appstore2.py 2012-12-06 16:16:49 +0000
1075+++ softwarecenter/ui/gtk3/models/appstore2.py 2012-12-14 17:01:33 +0000
1076@@ -364,7 +364,7 @@
1077 # the following methods ensure that the contents data is refreshed
1078 # whenever a transaction potentially changes it:
1079 def _on_transaction_started(self, backend, pkgname, appname, trans_id,
1080- trans_type):
1081+ trans_type):
1082 #~ self._refresh_transaction_map()
1083 pass
1084
1085@@ -540,7 +540,7 @@
1086 return it
1087
1088 def set_nocategory_documents(self, documents, untranslated_name=None,
1089- display_name=None):
1090+ display_name=None):
1091 category = UncategorisedRowRef(untranslated_name,
1092 display_name,
1093 len(documents))
1094
1095=== modified file 'softwarecenter/ui/gtk3/models/pendingstore.py'
1096--- softwarecenter/ui/gtk3/models/pendingstore.py 2012-11-28 15:54:20 +0000
1097+++ softwarecenter/ui/gtk3/models/pendingstore.py 2012-12-14 17:01:33 +0000
1098@@ -66,7 +66,7 @@
1099 self._signals = []
1100
1101 def _on_lowlevel_transactions_changed(self, watcher, current_tid,
1102- pending_tids):
1103+ pending_tids):
1104 logging.debug("on_transaction_changed %s (%s)" % (current_tid,
1105 len(pending_tids)))
1106 self.clear()
1107
1108=== modified file 'softwarecenter/ui/gtk3/panes/availablepane.py'
1109--- softwarecenter/ui/gtk3/panes/availablepane.py 2012-12-06 16:16:49 +0000
1110+++ softwarecenter/ui/gtk3/panes/availablepane.py 2012-12-14 17:01:33 +0000
1111@@ -433,8 +433,8 @@
1112 # see LP: #913756), also, don't add the item if NoDisplay is
1113 # specified (see LP: #1006483)
1114 if (os.path.exists(installed_desktop_file_path) and
1115- (not get_exec_line_from_desktop(installed_desktop_file_path) or
1116- is_no_display_desktop_file(installed_desktop_file_path))):
1117+ (not get_exec_line_from_desktop(installed_desktop_file_path) or
1118+ is_no_display_desktop_file(installed_desktop_file_path))):
1119 return
1120
1121 # now gather up the unity launcher info items and send the app to the
1122@@ -504,8 +504,8 @@
1123 for doc in self.enquirer.get_documents():
1124 pkgname = self.db.get_pkgname(doc)
1125 if (pkgname in self.cache and
1126- not self.cache[pkgname].is_installed and
1127- not len(self.backend.pending_transactions) > 0):
1128+ not self.cache[pkgname].is_installed and
1129+ not len(self.backend.pending_transactions) > 0):
1130 app = Application(pkgname=pkgname)
1131 installable.append(app)
1132 button_text = gettext.ngettext(
1133@@ -538,8 +538,8 @@
1134 for doc in self.enquirer.get_documents():
1135 pkgname = self.db.get_pkgname(doc)
1136 if (pkgname in self.cache and
1137- not self.cache[pkgname].is_installed and
1138- pkgname not in self.backend.pending_transactions):
1139+ not self.cache[pkgname].is_installed and
1140+ pkgname not in self.backend.pending_transactions):
1141 apps.append(self.db.get_application(doc))
1142 # add iconnames
1143 iconnames.append(self.db.get_iconname(doc))
1144@@ -805,13 +805,13 @@
1145 self.state.filter = AppFilter(self.db, self.cache)
1146
1147 if (category and category.flags and
1148- 'available-only' in category.flags):
1149+ 'available-only' in category.flags):
1150 self.state.filter.set_available_only(True)
1151 else:
1152 self.state.filter.set_available_only(False)
1153
1154 if (category and category.flags and
1155- 'not-installed-only' in category.flags):
1156+ 'not-installed-only' in category.flags):
1157 self.state.filter.set_not_installed_only(True)
1158 else:
1159 self.state.filter.set_not_installed_only(False)
1160
1161=== modified file 'softwarecenter/ui/gtk3/panes/installedpane.py'
1162--- softwarecenter/ui/gtk3/panes/installedpane.py 2012-11-28 16:08:02 +0000
1163+++ softwarecenter/ui/gtk3/panes/installedpane.py 2012-12-14 17:01:33 +0000
1164@@ -312,8 +312,8 @@
1165 # System cat is large and slow to search, filter it in default mode
1166
1167 if ('carousel-only' in cat.flags or
1168- ((self.nonapps_visible == NonAppVisibility.NEVER_VISIBLE)
1169- and cat.untranslated_name == 'System')):
1170+ ((self.nonapps_visible == NonAppVisibility.NEVER_VISIBLE)
1171+ and cat.untranslated_name == 'System')):
1172 return False
1173
1174 return True
1175
1176=== modified file 'softwarecenter/ui/gtk3/panes/softwarepane.py'
1177--- softwarecenter/ui/gtk3/panes/softwarepane.py 2012-11-28 17:36:38 +0000
1178+++ softwarecenter/ui/gtk3/panes/softwarepane.py 2012-12-14 17:01:33 +0000
1179@@ -407,7 +407,7 @@
1180 # if the category sets a custom sort order, that wins, this
1181 # is required for top-rated and whats-new
1182 if (self.state.category and
1183- self.state.category.sortmode != SortMethods.BY_ALPHABET):
1184+ self.state.category.sortmode != SortMethods.BY_ALPHABET):
1185 return self.state.category.sortmode
1186 # ask the app_view for the sort-mode
1187 return self.app_view.get_sort_mode()
1188@@ -417,9 +417,9 @@
1189 if not self.is_applist_view_showing():
1190 return
1191 if ((event.keyval == Gdk.keyval_from_name("Down") or
1192- event.keyval == Gdk.keyval_from_name("KP_Down")) and
1193- self.is_applist_view_showing() and
1194- len(self.app_view.tree_view.get_model()) > 0):
1195+ event.keyval == Gdk.keyval_from_name("KP_Down")) and
1196+ self.is_applist_view_showing() and
1197+ len(self.app_view.tree_view.get_model()) > 0):
1198 # select the first item in the applist search result
1199 self.app_view.tree_view.grab_focus()
1200 self.app_view.tree_view.set_cursor(Gtk.TreePath(),
1201
1202=== modified file 'softwarecenter/ui/gtk3/panes/viewswitcher.py'
1203--- softwarecenter/ui/gtk3/panes/viewswitcher.py 2012-11-28 16:08:02 +0000
1204+++ softwarecenter/ui/gtk3/panes/viewswitcher.py 2012-12-14 17:01:33 +0000
1205@@ -204,7 +204,7 @@
1206 return sel
1207
1208 def append_section_with_channel_sel(self, view_id, label, icon,
1209- build_func):
1210+ build_func):
1211 btn = self.append_section(view_id, label, icon)
1212 btn.draw_hint_has_channel_selector = True
1213 sel = self.append_channel_selector(btn, view_id, build_func)
1214
1215=== modified file 'softwarecenter/ui/gtk3/review_gui_helper.py'
1216--- softwarecenter/ui/gtk3/review_gui_helper.py 2012-12-06 16:16:49 +0000
1217+++ softwarecenter/ui/gtk3/review_gui_helper.py 2012-12-14 17:01:33 +0000
1218@@ -202,11 +202,11 @@
1219 self._submit_delete_if_pending()
1220 time.sleep(0.2)
1221 if (self._shutdown and
1222- self.pending_reviews.empty() and
1223- self.pending_usefulness.empty() and
1224- self.pending_reports.empty() and
1225- self.pending_modify.empty() and
1226- self.pending_delete.empty()):
1227+ self.pending_reviews.empty() and
1228+ self.pending_usefulness.empty() and
1229+ self.pending_reports.empty() and
1230+ self.pending_modify.empty() and
1231+ self.pending_delete.empty()):
1232 return
1233
1234 def _submit_usefulness_if_pending(self):
1235@@ -591,7 +591,7 @@
1236 SUCCESS_MESSAGE = _("Review submitted")
1237
1238 def __init__(self, app, version, iconname, origin, parent_xid, datadir,
1239- action="submit", review_id=0):
1240+ action="submit", review_id=0):
1241 BaseApp.__init__(self, datadir, "submit_review.ui")
1242 self.datadir = datadir
1243 # legal fineprint, do not change without consulting a lawyer
1244@@ -769,8 +769,8 @@
1245 summary_chars = self.review_summary_entry.get_text_length()
1246 review_chars = self.review_buffer.get_char_count()
1247 if (summary_chars and summary_chars <= self.SUMMARY_CHAR_LIMITS[0] and
1248- review_chars and review_chars <= self.REVIEW_CHAR_LIMITS[0] and
1249- int(self.star_rating.get_rating()) > 0):
1250+ review_chars and review_chars <= self.REVIEW_CHAR_LIMITS[0] and
1251+ int(self.star_rating.get_rating()) > 0):
1252 self.button_post.set_sensitive(True)
1253 self._change_status("clear", "")
1254 else:
1255@@ -796,22 +796,23 @@
1256 # perform an initial check on character counts to return False if any
1257 # don't match, avoids doing unnecessary string comparisons
1258 if (self.review_summary_entry.get_text_length() !=
1259- len(self.orig_summary_text) or
1260- self.review_buffer.get_char_count() != len(self.orig_review_text)):
1261+ len(self.orig_summary_text) or
1262+ self.review_buffer.get_char_count() !=
1263+ len(self.orig_review_text)):
1264 return False
1265 #compare rating
1266 if self.star_rating.get_rating() != self.orig_star_rating:
1267 return False
1268 #compare summary text
1269 if (self.review_summary_entry.get_text().decode('utf-8') !=
1270- self.orig_summary_text):
1271+ self.orig_summary_text):
1272 return False
1273 #compare review text
1274 if (self.review_buffer.get_text(
1275- self.review_buffer.get_start_iter(),
1276- self.review_buffer.get_end_iter(),
1277- include_hidden_chars=False).decode('utf-8') !=
1278- self.orig_review_text):
1279+ self.review_buffer.get_start_iter(),
1280+ self.review_buffer.get_end_iter(),
1281+ include_hidden_chars=False).decode('utf-8') !=
1282+ self.orig_review_text):
1283 return False
1284 return True
1285
1286@@ -991,7 +992,7 @@
1287
1288 def _confirm_cancellation(self):
1289 if (self._has_user_started_reviewing() and not
1290- self._displaying_cancel_confirmation):
1291+ self._displaying_cancel_confirmation):
1292
1293 def do_cancel(widget):
1294 self.submit_window.destroy()
1295@@ -1243,7 +1244,7 @@
1296
1297 def _enable_or_disable_report_button(self, widget):
1298 if (self.textview_report.get_buffer().get_char_count() > 0 and
1299- self.combobox_report_summary.get_active() != 0):
1300+ self.combobox_report_summary.get_active() != 0):
1301 self.button_post.set_sensitive(True)
1302 else:
1303 self.button_post.set_sensitive(False)
1304
1305=== modified file 'softwarecenter/ui/gtk3/session/appmanager.py'
1306--- softwarecenter/ui/gtk3/session/appmanager.py 2012-11-28 17:05:41 +0000
1307+++ softwarecenter/ui/gtk3/session/appmanager.py 2012-12-14 17:01:33 +0000
1308@@ -110,7 +110,7 @@
1309
1310 # this allows us to 'upgrade' deb files
1311 if (action == AppActions.UPGRADE and app.request and
1312- isinstance(app, DebFileApplication)):
1313+ isinstance(app, DebFileApplication)):
1314 action = AppActions.INSTALL
1315
1316 # action_func is one of:
1317
1318=== modified file 'softwarecenter/ui/gtk3/session/navhistory.py'
1319--- softwarecenter/ui/gtk3/session/navhistory.py 2012-11-23 22:57:21 +0000
1320+++ softwarecenter/ui/gtk3/session/navhistory.py 2012-12-14 17:01:33 +0000
1321@@ -192,10 +192,10 @@
1322 from softwarecenter.ui.gtk3.panes.availablepane import AvailablePane
1323 # check if both current and previous views were list views
1324 if (item.page == AvailablePane.Pages.LIST and
1325- last.page == AvailablePane.Pages.LIST):
1326+ last.page == AvailablePane.Pages.LIST):
1327 # first case, previous search and new search
1328 if (item_vs.search_term and last_vs.search_term and
1329- item_vs.search_term != last_vs.search_term):
1330+ item_vs.search_term != last_vs.search_term):
1331 # update last search term with current search_term
1332 last.view_state.search_term = item_vs.search_term
1333 # ... but return False, resulting in 'item' not being
1334
1335=== modified file 'softwarecenter/ui/gtk3/session/viewmanager.py'
1336--- softwarecenter/ui/gtk3/session/viewmanager.py 2012-11-28 17:36:38 +0000
1337+++ softwarecenter/ui/gtk3/session/viewmanager.py 2012-12-14 17:01:33 +0000
1338@@ -133,8 +133,7 @@
1339 # view_page = view_widget.get_current_page()
1340 # view_state = view_widget.state
1341
1342- if (self.search_entry.get_text() !=
1343- view_widget.state.search_term):
1344+ if self.search_entry.get_text() != view_widget.state.search_term:
1345 self.search_entry.set_text_with_no_signal(
1346 view_widget.state.search_term)
1347
1348@@ -195,7 +194,7 @@
1349 self.set_active_view(view_id)
1350
1351 if (not pane.searchentry or pane.is_app_details_view_showing() or
1352- pane.is_purchase_view_showing()):
1353+ pane.is_purchase_view_showing()):
1354 self.search_entry.hide()
1355 else:
1356 self.search_entry.show()
1357
1358=== modified file 'softwarecenter/ui/gtk3/views/appdetailsview.py'
1359--- softwarecenter/ui/gtk3/views/appdetailsview.py 2012-12-06 16:16:49 +0000
1360+++ softwarecenter/ui/gtk3/views/appdetailsview.py 2012-12-14 17:01:33 +0000
1361@@ -189,7 +189,7 @@
1362
1363 def _pulse_helper(self):
1364 if (self.pkg_state == PkgStates.INSTALLING_PURCHASED and
1365- self.progress.get_fraction() == 0.0):
1366+ self.progress.get_fraction() == 0.0):
1367 self.progress.pulse()
1368 return True
1369
1370@@ -367,15 +367,14 @@
1371 elif state == PkgStates.NEEDS_PURCHASE:
1372 self.set_label("%s" % (app_details.price))
1373 if (app_details.hardware_requirements_satisfied and
1374- app_details.region_requirements_satisfied):
1375+ app_details.region_requirements_satisfied):
1376 self.set_button_label(_(u'Buy\u2026'))
1377 else:
1378 self.set_button_label(_(u'Buy Anyway\u2026'))
1379 elif state == PkgStates.FORCE_VERSION:
1380 self.set_button_label(_('Change'))
1381- elif state in (
1382- PkgStates.PURCHASED_BUT_REPO_MUST_BE_ENABLED,
1383- PkgStates.PURCHASED_BUT_NOT_AVAILABLE_FOR_SERIES):
1384+ elif state in (PkgStates.PURCHASED_BUT_REPO_MUST_BE_ENABLED,
1385+ PkgStates.PURCHASED_BUT_NOT_AVAILABLE_FOR_SERIES):
1386
1387 # purchase_date is a string, must first convert to
1388 # datetime.datetime
1389@@ -403,7 +402,7 @@
1390 # TRANSLATORS: Free here means Gratis
1391 self.set_label(_("Free"))
1392 if (app_details.hardware_requirements_satisfied and
1393- app_details.region_requirements_satisfied):
1394+ app_details.region_requirements_satisfied):
1395 self.set_button_label(_('Install'))
1396 else:
1397 self.set_button_label(_('Install Anyway'))
1398@@ -708,7 +707,7 @@
1399 # FIXME: addons are not always free, but the old implementation
1400 # of determining price was buggy
1401 if (not self.addons_manager.addons_to_install and
1402- not self.addons_manager.addons_to_remove):
1403+ not self.addons_manager.addons_to_remove):
1404 self.hide()
1405 else:
1406 sensitive = network_state_is_connected()
1407@@ -1440,10 +1439,10 @@
1408 self.desktop_file = app_details.desktop_file
1409 # only enable test drive if we have a desktop file and exec line
1410 if (not self.weblive.ready or
1411- not self.weblive.is_pkgname_available_on_server(
1412- app_details.pkgname) or
1413- not os.path.exists(self.desktop_file) or
1414- not get_exec_line_from_desktop(self.desktop_file)):
1415+ not self.weblive.is_pkgname_available_on_server(
1416+ app_details.pkgname) or
1417+ not os.path.exists(self.desktop_file) or
1418+ not get_exec_line_from_desktop(self.desktop_file)):
1419 self.test_drive.hide()
1420 else:
1421 self.test_drive.show()
1422@@ -1455,7 +1454,7 @@
1423 self.pkg_warningbar.label.set_text(app_details.error)
1424 return
1425 if (app_details.hardware_requirements_satisfied and
1426- app_details.region_requirements_satisfied):
1427+ app_details.region_requirements_satisfied):
1428 self.pkg_warningbar.hide()
1429 else:
1430 s = get_hw_missing_long_description(
1431@@ -1730,7 +1729,7 @@
1432 # no longer in this state
1433 for state in [PkgStates.NEEDS_SOURCE, PkgStates.NOT_FOUND]:
1434 if (self.pkg_state == state and
1435- self.app_details.pkg_state != state):
1436+ self.app_details.pkg_state != state):
1437 force = True
1438 self.pkg_state = self.app_details.pkg_state
1439
1440@@ -1761,8 +1760,8 @@
1441 # common code
1442 def _review_write_new(self):
1443 if (not self.app or
1444- not self.app.pkgname in self.cache or
1445- not self.cache[self.app.pkgname].candidate):
1446+ not self.app.pkgname in self.cache or
1447+ not self.cache[self.app.pkgname].candidate):
1448 dialogs.error(None,
1449 _("Version unknown"),
1450 _("The version of the application can not "
1451@@ -1830,8 +1829,8 @@
1452
1453 # handle purchase: install purchased has multiple steps
1454 if (state == PkgStates.INSTALLING_PURCHASED and
1455- result and
1456- not result.pkgname):
1457+ result and
1458+ not result.pkgname):
1459 self.pkg_statusbar.configure(self.app_details,
1460 PkgStates.INSTALLING_PURCHASED)
1461 elif (state == PkgStates.INSTALLING_PURCHASED and
1462@@ -1906,8 +1905,8 @@
1463
1464 def _on_transaction_progress_changed(self, backend, pkgname, progress):
1465 if (self.app_details and
1466- self.app_details.pkgname and
1467- self.app_details.pkgname == pkgname):
1468+ self.app_details.pkgname and
1469+ self.app_details.pkgname == pkgname):
1470 if not self.pkg_statusbar.progress.get_property('visible'):
1471 self.pkg_statusbar.button.hide()
1472 self.pkg_statusbar.combo_multiple_versions.hide()
1473@@ -2024,8 +2023,8 @@
1474 return
1475 label_string = ""
1476 if (total_download_size == 0 and
1477- total_install_size == 0 and
1478- isinstance(self.app, DebFileApplication)):
1479+ total_install_size == 0 and
1480+ isinstance(self.app, DebFileApplication)):
1481 total_install_size = self.app_details.installed_size
1482 if total_download_size > 0:
1483 download_size = GLib.format_size(total_download_size)
1484@@ -2034,10 +2033,10 @@
1485 install_size = GLib.format_size(total_install_size)
1486 label_string += _("%s when installed") % (install_size)
1487 elif (total_install_size == 0 and
1488- self.app_details and
1489- self.app_details.pkg_state == PkgStates.INSTALLED and
1490- not self.addons_manager.addons_to_install and
1491- not self.addons_manager.addons_to_remove):
1492+ self.app_details and
1493+ self.app_details.pkg_state == PkgStates.INSTALLED and
1494+ not self.addons_manager.addons_to_install and
1495+ not self.addons_manager.addons_to_remove):
1496 pkg_version = self.cache[self.app_details.pkgname].installed
1497 # we may not always get a pkg_version returned (LP: #870822),
1498 # in that case, we'll just have to display "Unknown"
1499
1500=== modified file 'softwarecenter/ui/gtk3/views/appview.py'
1501--- softwarecenter/ui/gtk3/views/appview.py 2012-11-28 17:36:38 +0000
1502+++ softwarecenter/ui/gtk3/views/appview.py 2012-12-14 17:01:33 +0000
1503@@ -260,7 +260,7 @@
1504 """
1505 icon_size = 32
1506 if (self.tree_view.selected_row_renderer and
1507- self.tree_view.selected_row_renderer.icon):
1508+ self.tree_view.selected_row_renderer.icon):
1509 pb = self.tree_view.selected_row_renderer.icon
1510 if pb.get_width() > pb.get_height():
1511 icon_size = pb.get_width()
1512
1513=== modified file 'softwarecenter/ui/gtk3/views/catview.py'
1514--- softwarecenter/ui/gtk3/views/catview.py 2012-12-06 16:16:49 +0000
1515+++ softwarecenter/ui/gtk3/views/catview.py 2012-12-14 17:01:33 +0000
1516@@ -252,7 +252,7 @@
1517
1518 def _update_recommended_for_you_in_cat_content(self, category):
1519 if (self.recommended_for_you_in_cat and
1520- self.recommended_for_you_in_cat.get_parent()):
1521+ self.recommended_for_you_in_cat.get_parent()):
1522 self.recommended_for_you_in_cat.disconnect_by_func(
1523 self.on_application_activated)
1524 self.vbox.remove(self.recommended_for_you_in_cat)
1525@@ -373,7 +373,7 @@
1526 def set_subcategory(self, root_category, num_items=0):
1527 # nothing to do
1528 if (root_category is None or
1529- self.categories == root_category.subcategories):
1530+ self.categories == root_category.subcategories):
1531 return
1532 self._set_subcategory(root_category, num_items)
1533
1534@@ -392,7 +392,7 @@
1535 def refresh_apps(self):
1536 supported_only = get_global_filter().supported_only
1537 if (self.current_category is None or
1538- self._supported_only == supported_only):
1539+ self._supported_only == supported_only):
1540 return
1541 self._supported_only = supported_only
1542
1543
1544=== modified file 'softwarecenter/ui/gtk3/views/lobbyview.py'
1545--- softwarecenter/ui/gtk3/views/lobbyview.py 2012-11-28 15:43:49 +0000
1546+++ softwarecenter/ui/gtk3/views/lobbyview.py 2012-12-14 17:01:33 +0000
1547@@ -260,7 +260,7 @@
1548
1549 def _update_recommended_for_you_content(self):
1550 if (self.recommended_for_you_panel and
1551- self.recommended_for_you_panel.get_parent()):
1552+ self.recommended_for_you_panel.get_parent()):
1553 # disconnect listeners
1554 self.recommended_for_you_panel.disconnect_by_func(
1555 self.on_application_activated)
1556
1557=== modified file 'softwarecenter/ui/gtk3/views/pkgnamesview.py'
1558--- softwarecenter/ui/gtk3/views/pkgnamesview.py 2012-05-30 18:39:55 +0000
1559+++ softwarecenter/ui/gtk3/views/pkgnamesview.py 2012-12-14 17:01:33 +0000
1560@@ -47,8 +47,7 @@
1561 column = Gtk.TreeViewColumn(header, tr, markup=self.COL_TEXT)
1562 self.append_column(column)
1563 for pkgname in sorted(pkgnames):
1564- if (not pkgname in cache or
1565- not cache[pkgname].installed):
1566+ if not pkgname in cache or not cache[pkgname].installed:
1567 continue
1568 s = "%s \n<small>%s</small>" % (
1569 cache[pkgname].installed.summary.capitalize(), pkgname)
1570
1571=== modified file 'softwarecenter/ui/gtk3/views/purchaseview.py'
1572--- softwarecenter/ui/gtk3/views/purchaseview.py 2012-12-06 16:16:49 +0000
1573+++ softwarecenter/ui/gtk3/views/purchaseview.py 2012-12-14 17:01:33 +0000
1574@@ -258,12 +258,12 @@
1575 return
1576 if res["successful"] is False:
1577 if (res.get("user_canceled", False) or
1578- # note the different spelling
1579- res.get("user_cancelled", False) or
1580- # COMPAT with older clients that do not send the user
1581- # canceled property (LP: #696861), this msg appears
1582- # to be not translated
1583- "CANCELLED" in res.get("failures", "")):
1584+ # note the different spelling
1585+ res.get("user_cancelled", False) or
1586+ # COMPAT with older clients that do not send the user
1587+ # canceled property (LP: #696861), this msg appears
1588+ # to be not translated
1589+ "CANCELLED" in res.get("failures", "")):
1590 self.emit("purchase-cancelled-by-user")
1591 self._block_wk_handlers()
1592 return
1593
1594=== modified file 'softwarecenter/ui/gtk3/widgets/actionbar.py'
1595--- softwarecenter/ui/gtk3/widgets/actionbar.py 2012-11-28 15:52:31 +0000
1596+++ softwarecenter/ui/gtk3/widgets/actionbar.py 2012-12-14 17:01:33 +0000
1597@@ -254,7 +254,7 @@
1598
1599 def _slide_in_cb(self):
1600 if (self._is_sliding_in and
1601- self._current_height < self._target_height):
1602+ self._current_height < self._target_height):
1603 new_height = self._current_height + self.ANIMATE_STEP
1604 if new_height > self._target_height:
1605 new_height = self._target_height
1606@@ -264,7 +264,7 @@
1607
1608 def _slide_out_cb(self):
1609 if (self._is_sliding_out and
1610- self._current_height > self._target_height):
1611+ self._current_height > self._target_height):
1612 new_height = self._current_height - self.ANIMATE_STEP
1613 if new_height <= self._target_height:
1614 new_height = self._target_height
1615
1616=== modified file 'softwarecenter/ui/gtk3/widgets/apptreeview.py'
1617--- softwarecenter/ui/gtk3/widgets/apptreeview.py 2012-11-28 15:52:31 +0000
1618+++ softwarecenter/ui/gtk3/widgets/apptreeview.py 2012-12-14 17:01:33 +0000
1619@@ -171,7 +171,7 @@
1620 if old is not None:
1621 start, end = self.get_visible_range() or (None, None)
1622 if ((start and start.compare(old) != -1) or
1623- (end and end.compare(old) != 1)):
1624+ (end and end.compare(old) != 1)):
1625 self._needs_collapse.append(old)
1626 else:
1627 try: # try... a lazy solution to Bug #846204
1628@@ -263,7 +263,7 @@
1629 model = tree.get_model()
1630 app = model[path[0]][AppGenericStore.COL_ROW_DATA]
1631 if (not network_state_is_connected() and
1632- not self.appmodel.is_installed(app)):
1633+ not self.appmodel.is_installed(app)):
1634 for btn_id in self.ACTION_BTNS:
1635 btn_id = tr.get_button_by_name(CellButtonIDs.ACTION)
1636 btn_id.set_sensitive(False)
1637@@ -437,7 +437,7 @@
1638 x, y = int(event.x), int(event.y)
1639 for btn in tr.get_buttons():
1640 if (btn.point_in(x, y) and
1641- (btn.state != Gtk.StateFlags.INSENSITIVE)):
1642+ (btn.state != Gtk.StateFlags.INSENSITIVE)):
1643 self.focal_btn = btn
1644 btn.set_state(Gtk.StateFlags.ACTIVE)
1645 view.queue_draw()
1646@@ -453,7 +453,7 @@
1647 x, y = int(event.x), int(event.y)
1648 for btn in tr.get_buttons():
1649 if (btn.point_in(x, y) and
1650- (btn.state != Gtk.StateFlags.INSENSITIVE)):
1651+ (btn.state != Gtk.StateFlags.INSENSITIVE)):
1652 btn.set_state(Gtk.StateFlags.NORMAL)
1653 self.get_window().set_cursor(self._cursor_hand)
1654 if self.focal_btn is not btn:
1655@@ -485,7 +485,7 @@
1656 elif kv == Gdk.KEY_space: # spacebar
1657 for btn in tr.get_buttons():
1658 if (btn is not None and btn.has_focus and
1659- btn.state != Gtk.StateFlags.INSENSITIVE):
1660+ btn.state != Gtk.StateFlags.INSENSITIVE):
1661 btn.set_state(Gtk.StateFlags.ACTIVE)
1662 sel = self.get_selection()
1663 model, it = sel.get_selected()
1664@@ -607,7 +607,7 @@
1665 window.set_cursor(cursor)
1666
1667 def _on_transaction_started(self, backend, pkgname, appname, trans_id,
1668- trans_type, tr):
1669+ trans_type, tr):
1670 """callback when an application install/remove transaction has
1671 started
1672 """
1673
1674=== modified file 'softwarecenter/ui/gtk3/widgets/buttons.py'
1675--- softwarecenter/ui/gtk3/widgets/buttons.py 2012-12-06 16:16:49 +0000
1676+++ softwarecenter/ui/gtk3/widgets/buttons.py 2012-12-14 17:01:33 +0000
1677@@ -476,8 +476,8 @@
1678 alloc = self.get_allocation()
1679
1680 if (self._alloc is None or
1681- self._alloc.width != alloc.width or
1682- self._alloc.height != alloc.height):
1683+ self._alloc.width != alloc.width or
1684+ self._alloc.height != alloc.height):
1685 self._alloc = alloc
1686 # reset the bg cache
1687 self._bg_cache = {}
1688
1689=== modified file 'softwarecenter/ui/gtk3/widgets/cellrenderers.py'
1690--- softwarecenter/ui/gtk3/widgets/cellrenderers.py 2012-11-28 15:43:49 +0000
1691+++ softwarecenter/ui/gtk3/widgets/cellrenderers.py 2012-12-14 17:01:33 +0000
1692@@ -122,7 +122,7 @@
1693 Gtk.render_layout(context, cr, x, y, layout)
1694
1695 def _render_price(self, context, cr, app, layout, cell_area, xpad, ypad,
1696- is_rtl):
1697+ is_rtl):
1698 layout.set_markup("%s" % self.model.get_display_price(app))
1699
1700 if is_rtl:
1701@@ -180,7 +180,7 @@
1702 max_layout_width -= star_width + 6 * xpad
1703
1704 if (self.props.isactive and
1705- self.model.get_transaction_progress(app) > 0):
1706+ self.model.get_transaction_progress(app) > 0):
1707 action_btn = self.get_button_by_name(CellButtonIDs.ACTION)
1708 max_layout_width -= (xpad + action_btn.width)
1709
1710@@ -275,7 +275,7 @@
1711 context.restore()
1712
1713 def _render_buttons(self, context, cr, cell_area, layout, xpad, ypad,
1714- is_rtl):
1715+ is_rtl):
1716
1717 # layout buttons and paint
1718 y = cell_area.y + cell_area.height - ypad
1719
1720=== modified file 'softwarecenter/ui/gtk3/widgets/containers.py'
1721--- softwarecenter/ui/gtk3/widgets/containers.py 2012-12-06 16:16:49 +0000
1722+++ softwarecenter/ui/gtk3/widgets/containers.py 2012-12-14 17:01:33 +0000
1723@@ -450,7 +450,7 @@
1724 class FramedBox(Frame):
1725
1726 def __init__(self, orientation=Gtk.Orientation.VERTICAL, spacing=0,
1727- padding=0):
1728+ padding=0):
1729 Frame.__init__(self, padding)
1730 self.box = Gtk.Box.new(orientation, spacing)
1731 Gtk.Alignment.add(self, self.box)
1732
1733=== modified file 'softwarecenter/ui/gtk3/widgets/description.py'
1734--- softwarecenter/ui/gtk3/widgets/description.py 2012-11-28 15:43:49 +0000
1735+++ softwarecenter/ui/gtk3/widgets/description.py 2012-12-14 17:01:33 +0000
1736@@ -511,7 +511,7 @@
1737 # print 'drag: begin'
1738
1739 def _on_drag_data_get(self, widget, context, selection, info, timestamp,
1740- sel):
1741+ sel):
1742 # print 'drag: get data'
1743 text = self.get_selected_text(sel)
1744 selection.set_text(text, -1)
1745@@ -538,7 +538,7 @@
1746 cur_x, cur_y = int(event.x), int(event.y)
1747
1748 if (not event_helper['drag-active'] and
1749- self.drag_check_threshold(start_x, start_y, cur_x, cur_y)):
1750+ self.drag_check_threshold(start_x, start_y, cur_x, cur_y)):
1751 event_helper['drag-active'] = True
1752
1753 if not event_helper['drag-active']:
1754@@ -632,8 +632,8 @@
1755
1756 if not sel:
1757 self.copy_menuitem.set_sensitive(False)
1758- elif start == (0, 0) and \
1759- end == (len(self.order) - 1, len(self.order[-1])):
1760+ elif (start == (0, 0) and
1761+ end == (len(self.order) - 1, len(self.order[-1]))):
1762 self.select_all_menuitem.set_sensitive(False)
1763
1764 self.menu.popup(None, # parent_menu_shell,
1765@@ -651,8 +651,9 @@
1766 ctrl = (event.state & Gdk.ModifierType.CONTROL_MASK) > 0
1767 shift = (event.state & Gdk.ModifierType.SHIFT_MASK) > 0
1768
1769- if not self.PAINT_PRIMARY_CURSOR and \
1770- kv in (Gdk.KEY_uparrow, Gdk.KEY_downarrow) and not sel:
1771+ if (not self.PAINT_PRIMARY_CURSOR and
1772+ kv in (Gdk.KEY_uparrow, Gdk.KEY_downarrow) and
1773+ not sel):
1774 return False
1775
1776 if kv == Gdk.KEY_Tab:
1777
1778=== modified file 'softwarecenter/ui/gtk3/widgets/exhibits.py'
1779--- softwarecenter/ui/gtk3/widgets/exhibits.py 2012-12-06 16:16:49 +0000
1780+++ softwarecenter/ui/gtk3/widgets/exhibits.py 2012-12-14 17:01:33 +0000
1781@@ -200,8 +200,8 @@
1782 def on_size_allocate(self, *args):
1783 a = self.get_allocation()
1784 if (self._dropshadow is not None and
1785- a.width == self._dropshadow.get_width() and
1786- a.height == self._dropshadow.get_height()):
1787+ a.width == self._dropshadow.get_width() and
1788+ a.height == self._dropshadow.get_height()):
1789 return
1790
1791 self._dropshadow = self.DROPSHADOW.scale_simple(
1792@@ -373,20 +373,20 @@
1793 def on_key_press(self, widget, event):
1794 # activate
1795 if (event.keyval == Gdk.keyval_from_name("space") or
1796- event.keyval == Gdk.keyval_from_name("Return") or
1797- event.keyval == Gdk.keyval_from_name("KP_Enter")):
1798+ event.keyval == Gdk.keyval_from_name("Return") or
1799+ event.keyval == Gdk.keyval_from_name("KP_Enter")):
1800 exhibit = self.exhibits[self.cursor]
1801 if exhibit.package_names:
1802 self.emit("show-exhibits-clicked", exhibit)
1803 return True
1804 # previous
1805 if (event.keyval == Gdk.keyval_from_name("Left") or
1806- event.keyval == Gdk.keyval_from_name("KP_Left")):
1807+ event.keyval == Gdk.keyval_from_name("KP_Left")):
1808 self.on_previous_clicked()
1809 return True
1810 # next
1811 if (event.keyval == Gdk.keyval_from_name("Right") or
1812- event.keyval == Gdk.keyval_from_name("KP_Right")):
1813+ event.keyval == Gdk.keyval_from_name("KP_Right")):
1814 self.on_next_clicked()
1815 return True
1816 return False
1817
1818=== modified file 'softwarecenter/ui/gtk3/widgets/menubutton.py'
1819--- softwarecenter/ui/gtk3/widgets/menubutton.py 2012-03-09 12:50:38 +0000
1820+++ softwarecenter/ui/gtk3/widgets/menubutton.py 2012-12-14 17:01:33 +0000
1821@@ -75,7 +75,7 @@
1822 if x_position < monitor_geo.x:
1823 x_position = monitor_geo.x
1824 if (x_position + menu.get_allocated_width() > monitor_geo.x +
1825- monitor_geo.width):
1826+ monitor_geo.width):
1827 x_position = (monitor_geo.x + monitor_geo.width -
1828 menu.get_allocated_width())
1829
1830
1831=== modified file 'softwarecenter/ui/gtk3/widgets/oneconfviews.py'
1832--- softwarecenter/ui/gtk3/widgets/oneconfviews.py 2012-11-28 17:36:38 +0000
1833+++ softwarecenter/ui/gtk3/widgets/oneconfviews.py 2012-12-14 17:01:33 +0000
1834@@ -123,7 +123,7 @@
1835 if not self.get_model().get_value(iter2, self.COL_HOSTID):
1836 return 1
1837 if (self.get_model().get_value(iter1, self.COL_HOSTNAME) >
1838- self.get_model().get_value(iter2, self.COL_HOSTNAME)):
1839+ self.get_model().get_value(iter2, self.COL_HOSTNAME)):
1840 return 1
1841 else:
1842 return -1
1843
1844=== modified file 'softwarecenter/ui/gtk3/widgets/recommendations.py'
1845--- softwarecenter/ui/gtk3/widgets/recommendations.py 2012-12-06 16:16:49 +0000
1846+++ softwarecenter/ui/gtk3/widgets/recommendations.py 2012-12-14 17:01:33 +0000
1847@@ -89,7 +89,7 @@
1848 def _on_transaction_started(self, backend, pkgname, appname, trans_id,
1849 trans_type):
1850 if (trans_type != TransactionTypes.INSTALL and
1851- pkgname in self.recommended_apps_viewed):
1852+ pkgname in self.recommended_apps_viewed):
1853 # if the transaction is not an installation we don't want to
1854 # track it as a recommended item
1855 self.recommended_apps_viewed.remove(pkgname)
1856
1857=== modified file 'softwarecenter/ui/gtk3/widgets/reviews.py'
1858--- softwarecenter/ui/gtk3/widgets/reviews.py 2012-12-06 16:16:49 +0000
1859+++ softwarecenter/ui/gtk3/widgets/reviews.py 2012-12-14 17:01:33 +0000
1860@@ -289,8 +289,8 @@
1861 else:
1862 # no reviews, either offer to write one or show "none"
1863 if (self.get_active_review_language() != 'any' and
1864- self.global_review_stats and
1865- self.global_review_stats.ratings_total > 0):
1866+ self.global_review_stats and
1867+ self.global_review_stats.ratings_total > 0):
1868 self.vbox.pack_start(NoReviewRelaxLanguage(), True, True, 0)
1869 elif is_installed and is_connected:
1870 self._be_the_first_to_review()
1871@@ -480,13 +480,13 @@
1872 reviews.emit("submit-usefulness", self.id, is_useful)
1873
1874 def _on_error_acknowledged(self, button, current_user_reviewer,
1875- useful_total, useful_favorable):
1876+ useful_total, useful_favorable):
1877 self.usefulness_error = False
1878 self._usefulness_ui_update('renew', current_user_reviewer,
1879 useful_total, useful_favorable)
1880
1881 def _usefulness_ui_update(self, type, current_user_reviewer=False,
1882- useful_total=0, useful_favorable=0):
1883+ useful_total=0, useful_favorable=0):
1884 self._hide_usefulness_elements()
1885 #print "_usefulness_ui_update: %s" % type
1886 if type == 'renew':
1887@@ -536,7 +536,7 @@
1888 return datetime.datetime.strptime(raw_date_str, '%Y-%m-%d %H:%M:%S')
1889
1890 def _delete_ui_update(self, type, current_user_reviewer=False,
1891- action=None):
1892+ action=None):
1893 self._hide_delete_elements()
1894 if type == 'renew':
1895 self._build_delete_flag_ui(current_user_reviewer)
1896@@ -626,8 +626,8 @@
1897 }
1898 # If its for the same version, show it as such
1899 if (review_version and
1900- app_version and
1901- upstream_version_compare(review_version, app_version) == 0):
1902+ app_version and
1903+ upstream_version_compare(review_version, app_version) == 0):
1904 version_string = _("For this version (%(version)s)") % {
1905 'version': version,
1906 }
1907@@ -816,7 +816,7 @@
1908 return label
1909
1910 def _build_delete_flag_ui(self, current_user_reviewer, delete_error=False,
1911- modify_error=False):
1912+ modify_error=False):
1913 if delete_error:
1914 self._delete_ui_update('error', current_user_reviewer, 'deleting')
1915 elif modify_error:
1916
1917=== modified file 'softwarecenter/ui/gtk3/widgets/thumbnail.py'
1918--- softwarecenter/ui/gtk3/widgets/thumbnail.py 2012-11-28 15:54:20 +0000
1919+++ softwarecenter/ui/gtk3/widgets/thumbnail.py 2012-12-14 17:01:33 +0000
1920@@ -237,14 +237,16 @@
1921
1922 def _on_key_press(self, widget, event):
1923 # react to spacebar, enter, numpad-enter
1924- if (event.keyval in (Gdk.KEY_space, Gdk.KEY_Return,
1925- Gdk.KEY_KP_Enter) and self.get_is_actionable()):
1926+ if (event.keyval in (
1927+ Gdk.KEY_space, Gdk.KEY_Return, Gdk.KEY_KP_Enter) and
1928+ self.get_is_actionable()):
1929 self.set_state(Gtk.StateType.ACTIVE)
1930
1931 def _on_key_release(self, widget, event):
1932 # react to spacebar, enter, numpad-enter
1933 if (event.keyval in (Gdk.KEY_space, Gdk.KEY_Return,
1934- Gdk.KEY_KP_Enter) and self.get_is_actionable()):
1935+ Gdk.KEY_KP_Enter) and
1936+ self.get_is_actionable()):
1937 self.set_state(Gtk.StateType.NORMAL)
1938 self._show_image_dialog()
1939
1940
1941=== modified file 'softwarecenter/ui/gtk3/widgets/webkit.py'
1942--- softwarecenter/ui/gtk3/widgets/webkit.py 2012-11-23 22:57:21 +0000
1943+++ softwarecenter/ui/gtk3/widgets/webkit.py 2012-12-14 17:01:33 +0000
1944@@ -199,6 +199,6 @@
1945 self.spinner.start()
1946 self.spinner.show()
1947 if (status == webkit.LoadStatus.FINISHED or
1948- status == webkit.LoadStatus.FAILED):
1949+ status == webkit.LoadStatus.FAILED):
1950 self.spinner.stop()
1951 self.spinner.hide()
1952
1953=== modified file 'softwarecenter/ui/gtk3/widgets/weblivedialog.py'
1954--- softwarecenter/ui/gtk3/widgets/weblivedialog.py 2012-08-30 08:57:29 +0000
1955+++ softwarecenter/ui/gtk3/widgets/weblivedialog.py 2012-12-14 17:01:33 +0000
1956@@ -66,8 +66,8 @@
1957 # to a server requiring autoinstall
1958 # or doesn't need autoinstall but existing one does
1959 if ((percent_otherserver > percent_server and
1960- not autoinstall_otherserver < autoinstall_server) or
1961- autoinstall_otherserver > autoinstall_server):
1962+ not autoinstall_otherserver < autoinstall_server)or
1963+ autoinstall_otherserver > autoinstall_server):
1964 servers.remove(otherserver)
1965 servers.append(server)
1966 duplicate = True
1967
1968=== modified file 'softwarecenter/ui/qml/pkglist.py'
1969--- softwarecenter/ui/qml/pkglist.py 2012-09-19 08:08:17 +0000
1970+++ softwarecenter/ui/qml/pkglist.py 2012-12-14 17:01:33 +0000
1971@@ -110,7 +110,7 @@
1972
1973 # helper
1974 def _on_backend_transaction_progress_changed(self, backend, pkgname,
1975- progress):
1976+ progress):
1977 column = self.COLUMNS.index("_installremoveprogress")
1978 # FIXME: instead of the entire model, just find the row that changed
1979 top = self.createIndex(0, column)
1980
1981=== modified file 'tests/test_pep8.py'
1982--- tests/test_pep8.py 2012-11-28 17:36:38 +0000
1983+++ tests/test_pep8.py 2012-12-14 17:01:33 +0000
1984@@ -14,7 +14,7 @@
1985 ["pep8",
1986 "--repeat",
1987 # FIXME: FIXME!
1988- "--ignore=E125,E126,E127,E128",
1989+ "--ignore=E126,E127,E128",
1990 os.path.dirname(softwarecenter.__file__),
1991 # test the main binary too
1992 os.path.join(testdir, "..", "software-center"),

Subscribers

People subscribed via source and target branches