[Sugar-devel] [PATCH 00/21 sugar-toolkit] style cleanup series

Sascha Silbe sascha-pgp at silbe.org
Fri Oct 15 17:01:04 EDT 2010


This is the sugar-toolkit part of the style cleanups I've wanted to
land at least two releases ago, but kept missing the window.

I have done some basic testing, but naturally cannot test all code
paths I've touched (some even appear to be unused). This is why I'd like
to land this right after we branched off sucrose-0.90: to ensure it gets
enough testing before the next release.

The only remaining pylint complaint that isn't either a pylint bug or
caused by deprecated imports (that I'd like to kill off for 0.92 as
well, but not as part of this series) is this one:

[sugar.graphics.palette]
W0221:185:Palette.popup: Arguments number differs from overridden method


Bulk changes like these are naturally an annoyance to everyone who has
pending changes. However I feel that the mid- to long-term benefits
overweigh the short-term trouble and now is at least as good a time as
any to land the changes. With AC/SEETA hacking away fervently now and
in the foreseeable future (awesome!) we're not going to have a window
where there are only a few patches pending. We'll always hurt someone
so it's better to get it in early in the release cycle.

Sascha Silbe (21):
  fix EOL spaces
  PEP8 cleanup: fix number of blank lines
  PEP8 cleanup: ensure lines are shorter than 80 characters
  PEP8 cleanup: don't use has_key()
  PEP8 cleanup: fix whitespace around operator
  PEP8 cleanup: fix inline comment spacing
  PEP8 cleanup: fix spaces around keyword parameters
  PEP8 cleanup: fix whitespace before ':'
  PEP8 cleanup: fix deprecated raise syntax
  style cleanup: use """ everywhere
  style cleanup: prefer ' for strings
  pylint cleanup: replace disable-msg with disable
  pylint cleanup: remove unused import
  sugar.util: use logging.exception instead of traceback.format_exc()
  pylint cleanup: disable warnings for reasonable catch-all exception
    handlers
  pylint cleanup: pass format parameters to log functions instead of
    using %
  pylint cleanup: initialise all attributes in __init__()
  ToolInvoker._get_alignments: fix missing self parameter
  CellRendererInvoker._redraw_path(): assure column is defined
  pylint: sugar.wm._property_change_trapped: allow overriding built-in
    method
  bundlebuilder: ignore incorrect pylint warning

 examples/radiopalette.py                |    3 +-
 examples/toolbar.py                     |    1 +
 src/sugar/activity/activity.py          |   37 ++++++++++++-----------
 src/sugar/activity/activityfactory.py   |   14 ++++----
 src/sugar/activity/activityhandle.py    |    6 ++--
 src/sugar/activity/activityservice.py   |    6 ++--
 src/sugar/activity/bundlebuilder.py     |   34 +++++++++++----------
 src/sugar/activity/i18n.py              |    2 +-
 src/sugar/activity/main.py              |   18 +++++-----
 src/sugar/activity/namingalert.py       |    3 +-
 src/sugar/bundle/activitybundle.py      |   24 +++++++-------
 src/sugar/bundle/bundle.py              |    4 +-
 src/sugar/bundle/contentbundle.py       |    4 +-
 src/sugar/datastore/datastore.py        |   12 ++++----
 src/sugar/env.py                        |   13 ++------
 src/sugar/graphics/alert.py             |    6 ++-
 src/sugar/graphics/combobox.py          |    2 +-
 src/sugar/graphics/icon.py              |    5 ++-
 src/sugar/graphics/objectchooser.py     |    4 +-
 src/sugar/graphics/palettegroup.py      |    2 +-
 src/sugar/graphics/palettewindow.py     |   16 ++++++----
 src/sugar/graphics/radiotoolbutton.py   |    2 +-
 src/sugar/graphics/style.py             |   13 ++++----
 src/sugar/graphics/toggletoolbutton.py  |    4 +-
 src/sugar/graphics/toolbutton.py        |    4 +-
 src/sugar/graphics/tray.py              |    6 ++--
 src/sugar/graphics/xocolor.py           |    2 +-
 src/sugar/network.py                    |   40 ++++++++++++------------
 src/sugar/presence/activity.py          |   47 +++++++++++++++++------------
 src/sugar/presence/buddy.py             |    8 +++--
 src/sugar/presence/connectionmanager.py |   10 ++++--
 src/sugar/presence/presenceservice.py   |   20 +++++++-----
 src/sugar/presence/tubeconn.py          |    4 +-
 src/sugar/profile.py                    |   50 +++++++++++++++---------------
 src/sugar/util.py                       |   10 +++---
 src/sugar/wm.py                         |   10 ++++--
 tests/graphics/common.py                |    6 +++-
 tests/graphics/hipposcalability.py      |    3 +-
 tests/graphics/iconcache.py             |    5 ++-
 tests/graphics/iconwidget.py            |    4 +-
 tests/graphics/ticket2855.py            |    2 +-
 tests/graphics/ticket2999.py            |    2 +-
 tests/graphics/ticket3000.py            |    2 +-
 tests/graphics/toolbarpalettes.py       |    2 +-
 tests/graphics/tray.py                  |    2 +-
 tests/lib/test_mime.py                  |   17 ++++++----
 46 files changed, 260 insertions(+), 231 deletions(-)



More information about the Sugar-devel mailing list