<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Hi Sascha,<br><br>jt4sugar or JT here..... I'm signed up on Sugar-Devel but only digest. I just got about 20 emails with<br>[Sugar-devel] [Patch...] since I'm only signed up as digest I believe something is out of kilter.<br><br>Just thought I would bring to your attention. Hope it helps!<br><br>Best!<br>John Tierney<br><br>> From: sascha-pgp@silbe.org<br>> To: sugar-devel@lists.sugarlabs.org<br>> Date: Sun, 17 Oct 2010 00:20:05 +0200<br>> Subject: [Sugar-devel] [PATCH sugar 03/21] pep8 cleanup: fix number of blank      lines<br>> <br>> Signed-off-by: Sascha Silbe <sascha-pgp@silbe.org><br>> <br>> diff --git a/extensions/cpsection/aboutcomputer/__init__.py b/extensions/cpsection/aboutcomputer/__init__.py<br>> index ceb515a..faf814d 100644<br>> --- a/extensions/cpsection/aboutcomputer/__init__.py<br>> +++ b/extensions/cpsection/aboutcomputer/__init__.py<br>> @@ -19,4 +19,3 @@ from gettext import gettext as _<br>>  CLASS = 'AboutComputer'<br>>  ICON = 'module-about_my_computer'<br>>  TITLE = _('About my Computer')<br>> -<br>> diff --git a/extensions/cpsection/aboutcomputer/model.py b/extensions/cpsection/aboutcomputer/model.py<br>> index 77d3b86..b700a6b 100644<br>> --- a/extensions/cpsection/aboutcomputer/model.py<br>> +++ b/extensions/cpsection/aboutcomputer/model.py<br>> @@ -24,29 +24,35 @@ import errno<br>>  <br>>  from jarabe import config<br>>  <br>> +<br>>  _logger = logging.getLogger('ControlPanel - AboutComputer')<br>>  _not_available = _('Not available')<br>>  <br>> +<br>>  def get_aboutcomputer():<br>>      msg = 'Serial Number: %s \nBuild Number: %s \nFirmware Number: %s \n' \<br>>              % (get_serial_number(), get_build_number(), get_firmware_number())<br>>      return msg<br>>  <br>> +<br>>  def print_aboutcomputer():<br>>      print get_aboutcomputer()<br>>  <br>> +<br>>  def get_serial_number():<br>>      serial_no = _read_file('/ofw/serial-number')<br>>      if serial_no is None:<br>>          serial_no = _not_available<br>>      return serial_no<br>>  <br>> +<br>>  def print_serial_number():<br>>      serial_no = get_serial_number()<br>>      if serial_no is None:<br>>          serial_no = _not_available<br>>      print serial_no<br>>  <br>> +<br>>  def get_build_number():<br>>      build_no = _read_file('/boot/olpc_build')<br>>  <br>> @@ -68,9 +74,11 @@ def get_build_number():<br>>  <br>>      return build_no<br>>  <br>> +<br>>  def print_build_number():<br>>      print get_build_number()<br>>  <br>> +<br>>  def get_firmware_number():<br>>      firmware_no = _read_file('/ofw/openprom/model')<br>>      if firmware_no is None:<br>> @@ -81,9 +89,11 @@ def get_firmware_number():<br>>              firmware_no = firmware_no[1]<br>>      return firmware_no<br>>  <br>> +<br>>  def print_firmware_number():<br>>      print get_firmware_number()<br>>  <br>> +<br>>  def get_wireless_firmware():<br>>      try:<br>>          info = subprocess.Popen(["/usr/sbin/ethtool", "-i", "eth0"],<br>> @@ -97,9 +107,11 @@ def get_wireless_firmware():<br>>          wireless_firmware = _not_available<br>>      return wireless_firmware<br>>  <br>> +<br>>  def print_wireless_firmware():<br>>      print get_wireless_firmware()<br>>  <br>> +<br>>  def _read_file(path):<br>>      if os.access(path, os.R_OK) == 0:<br>>          return None<br>> @@ -114,6 +126,7 @@ def _read_file(path):<br>>          _logger.debug('No information in file or directory: %s', path)<br>>          return None<br>>  <br>> +<br>>  def get_license():<br>>      license_file = os.path.join(config.data_path, 'GPLv2')<br>>      lang = os.environ['LANG']<br>> diff --git a/extensions/cpsection/aboutcomputer/view.py b/extensions/cpsection/aboutcomputer/view.py<br>> index 39bacfb..68545fd 100644<br>> --- a/extensions/cpsection/aboutcomputer/view.py<br>> +++ b/extensions/cpsection/aboutcomputer/view.py<br>> @@ -26,6 +26,7 @@ from sugar.graphics import style<br>>  from jarabe import config<br>>  from jarabe.controlpanel.sectionview import SectionView<br>>  <br>> +<br>>  class AboutComputer(SectionView):<br>>      def __init__(self, model, alerts=None):<br>>          SectionView.__init__(self)<br>> diff --git a/extensions/cpsection/aboutme/__init__.py b/extensions/cpsection/aboutme/__init__.py<br>> index 98843e1..7ded428 100644<br>> --- a/extensions/cpsection/aboutme/__init__.py<br>> +++ b/extensions/cpsection/aboutme/__init__.py<br>> @@ -24,5 +24,3 @@ ICON = 'module-about_me'<br>>  TITLE = _('About Me')<br>>  client = gconf.client_get_default()<br>>  COLOR = XoColor(client.get_string('/desktop/sugar/user/color'))<br>> -<br>> -<br>> diff --git a/extensions/cpsection/aboutme/model.py b/extensions/cpsection/aboutme/model.py<br>> index 078fff4..fd7261c 100644<br>> --- a/extensions/cpsection/aboutme/model.py<br>> +++ b/extensions/cpsection/aboutme/model.py<br>> @@ -18,6 +18,7 @@<br>>  from gettext import gettext as _<br>>  import gconf<br>>  <br>> +<br>>  _COLORS = {'red': {'dark':'#b20008', 'medium':'#e6000a', 'light':'#ffadce'},<br>>             'orange': {'dark':'#9a5200', 'medium':'#c97e00', 'light':'#ffc169'},<br>>             'yellow': {'dark':'#807500', 'medium':'#be9e00', 'light':'#fffa00'},<br>> @@ -28,13 +29,16 @@ _COLORS = {'red': {'dark':'#b20008', 'medium':'#e6000a', 'light':'#ffadce'},<br>>  <br>>  _MODIFIERS = ('dark', 'medium', 'light')<br>>  <br>> +<br>>  def get_nick():<br>>      client = gconf.client_get_default()<br>>      return client.get_string("/desktop/sugar/user/nick")<br>>  <br>> +<br>>  def print_nick():<br>>      print get_nick()<br>>  <br>> +<br>>  def set_nick(nick):<br>>      """Set the nickname.<br>>      nick : e.g. 'walter'<br>> @@ -47,10 +51,12 @@ def set_nick(nick):<br>>      client.set_string("/desktop/sugar/user/nick", nick)<br>>      return 1<br>>  <br>> +<br>>  def get_color():<br>>      client = gconf.client_get_default()<br>>      return client.get_string("/desktop/sugar/user/color")<br>>  <br>> +<br>>  def print_color():<br>>      color_string = get_color()<br>>      tmp = color_string.split(',')<br>> @@ -74,6 +80,7 @@ def print_color():<br>>      else:<br>>          print _('fill:     %s') % (tmp[1])<br>>  <br>> +<br>>  def set_color(stroke, fill, stroke_modifier='medium', fill_modifier='medium'):<br>>      """Set the system color by setting a fill and stroke color.<br>>      fill : [red, orange, yellow, blue, green, purple]<br>> @@ -102,10 +109,12 @@ def set_color(stroke, fill, stroke_modifier='medium', fill_modifier='medium'):<br>>      client.set_string("/desktop/sugar/user/color", color)<br>>      return 1<br>>  <br>> +<br>>  def get_color_xo():<br>>      client = gconf.client_get_default()<br>>      return client.get_string("/desktop/sugar/user/color")<br>>  <br>> +<br>>  def set_color_xo(color):<br>>      """Set a color with an XoColor<br>>      This method is used by the graphical user interface<br>> diff --git a/extensions/cpsection/datetime/model.py b/extensions/cpsection/datetime/model.py<br>> index a928b41..39d5e5e 100644<br>> --- a/extensions/cpsection/datetime/model.py<br>> +++ b/extensions/cpsection/datetime/model.py<br>> @@ -26,6 +26,7 @@ import gconf<br>>  <br>>  _zone_tab = '/usr/share/zoneinfo/zone.tab'<br>>  <br>> +<br>>  def _initialize():<br>>      '''Initialize the docstring of the set function'''<br>>      if set_timezone.__doc__ is None:<br>> @@ -36,6 +37,7 @@ def _initialize():<br>>      for timezone in timezones:<br>>          set_timezone.__doc__ += timezone + '\n'<br>>  <br>> +<br>>  def read_all_timezones(fn=_zone_tab):<br>>      fd = open (fn, 'r')<br>>      lines = fd.readlines()<br>> @@ -67,13 +69,16 @@ def read_all_timezones(fn=_zone_tab):<br>>          timezones.append(tz)<br>>      return timezones<br>>  <br>> +<br>>  def get_timezone():<br>>      client = gconf.client_get_default()<br>>      return client.get_string('/desktop/sugar/date/timezone')<br>>  <br>> +<br>>  def print_timezone():<br>>      print get_timezone()<br>>  <br>> +<br>>  def set_timezone(timezone):<br>>      """Set the system timezone<br>>      timezone : e.g. 'America/Los_Angeles'<br>> @@ -89,4 +94,3 @@ def set_timezone(timezone):<br>>  <br>>  # inilialize the docstrings for the timezone<br>>  _initialize()<br>> -<br>> diff --git a/extensions/cpsection/datetime/view.py b/extensions/cpsection/datetime/view.py<br>> index a2c4c78..72fdad1 100644<br>> --- a/extensions/cpsection/datetime/view.py<br>> +++ b/extensions/cpsection/datetime/view.py<br>> @@ -24,6 +24,7 @@ from sugar.graphics import iconentry<br>>  from jarabe.controlpanel.sectionview import SectionView<br>>  from jarabe.controlpanel.inlinealert import InlineAlert<br>>  <br>> +<br>>  class TimeZone(SectionView):<br>>      def __init__(self, model, alerts):<br>>          SectionView.__init__(self)<br>> diff --git a/extensions/cpsection/frame/model.py b/extensions/cpsection/frame/model.py<br>> index 765d183..de2da5e 100644<br>> --- a/extensions/cpsection/frame/model.py<br>> +++ b/extensions/cpsection/frame/model.py<br>> @@ -18,14 +18,17 @@<br>>  from gettext import gettext as _<br>>  import gconf<br>>  <br>> +<br>>  def get_corner_delay():<br>>      client = gconf.client_get_default()<br>>      corner_delay = client.get_int('/desktop/sugar/frame/corner_delay')<br>>      return corner_delay<br>>  <br>> +<br>>  def print_corner_delay():<br>>      print get_corner_delay()<br>>  <br>> +<br>>  def set_corner_delay(delay):<br>>      """Set a delay for the activation of the frame using hot corners.<br>>      instantaneous: 0 (0 milliseconds)<br>> @@ -40,14 +43,17 @@ def set_corner_delay(delay):<br>>      client.set_int('/desktop/sugar/frame/corner_delay', int(delay))<br>>      return 0<br>>  <br>> +<br>>  def get_edge_delay():<br>>      client = gconf.client_get_default()<br>>      edge_delay = client.get_int('/desktop/sugar/frame/edge_delay')<br>>      return edge_delay<br>>  <br>> +<br>>  def print_edge_delay():<br>>      print get_edge_delay()<br>>  <br>> +<br>>  def set_edge_delay(delay):<br>>      """Set a delay for the activation of the frame using warm edges.<br>>      instantaneous: 0 (0 milliseconds)<br>> diff --git a/extensions/cpsection/frame/view.py b/extensions/cpsection/frame/view.py<br>> index d9e1a6a..fb2b6b7 100644<br>> --- a/extensions/cpsection/frame/view.py<br>> +++ b/extensions/cpsection/frame/view.py<br>> @@ -23,11 +23,13 @@ from sugar.graphics import style<br>>  from jarabe.controlpanel.sectionview import SectionView<br>>  from jarabe.controlpanel.inlinealert import InlineAlert<br>>  <br>> +<br>>  _never =  _('never')<br>>  _instantaneous = _('instantaneous')<br>>  _seconds_label = _('%s seconds')<br>>  _MAX_DELAY = 1000<br>>  <br>> +<br>>  class Frame(SectionView):<br>>      def __init__(self, model, alerts):<br>>          SectionView.__init__(self)<br>> diff --git a/extensions/cpsection/keyboard/__init__.py b/extensions/cpsection/keyboard/__init__.py<br>> index 568e7a5..065086c 100644<br>> --- a/extensions/cpsection/keyboard/__init__.py<br>> +++ b/extensions/cpsection/keyboard/__init__.py<br>> @@ -19,4 +19,3 @@ from gettext import gettext as _<br>>  CLASS = 'Keyboard'<br>>  ICON = 'module-keyboard'<br>>  TITLE = _('Keyboard')<br>> -<br>> diff --git a/extensions/cpsection/keyboard/model.py b/extensions/cpsection/keyboard/model.py<br>> index 4c44740..b7186e2 100644<br>> --- a/extensions/cpsection/keyboard/model.py<br>> +++ b/extensions/cpsection/keyboard/model.py<br>> @@ -26,6 +26,7 @@ _LAYOUTS_KEY = '/desktop/sugar/peripherals/keyboard/layouts'<br>>  _OPTIONS_KEY = '/desktop/sugar/peripherals/keyboard/options'<br>>  _MODEL_KEY = '/desktop/sugar/peripherals/keyboard/model'<br>>  <br>> +<br>>  class KeyboardManager(object):<br>>      def __init__(self, display):<br>>          self._engine = xklavier.Engine(display)<br>> @@ -166,4 +167,3 @@ class KeyboardManager(object):<br>>          self._configrec.set_layouts(layouts_list)<br>>          self._configrec.set_variants(variants_list)<br>>          self._configrec.activate(self._engine)<br>> -<br>> diff --git a/extensions/cpsection/keyboard/view.py b/extensions/cpsection/keyboard/view.py<br>> index bcc98d8..51062fd 100644<br>> --- a/extensions/cpsection/keyboard/view.py<br>> +++ b/extensions/cpsection/keyboard/view.py<br>> @@ -26,6 +26,7 @@ from sugar.graphics.icon import Icon<br>>  <br>>  from jarabe.controlpanel.sectionview import SectionView<br>>  <br>> +<br>>  CLASS = 'Language'<br>>  ICON = 'module-keyboard'<br>>  TITLE = _('Keyboard')<br>> @@ -37,6 +38,7 @@ _APPLY_TIMEOUT = 500<br>>  #      once python-xklavier has been packaged for all major distributions<br>>  #      For more information, see: http://dev.sugarlabs.org/ticket/407<br>>  <br>> +<br>>  class LayoutCombo(gtk.HBox):<br>>  <br>>      """<br>> @@ -306,7 +308,6 @@ class Keyboard(SectionView):<br>>          except Exception:<br>>              logging.exception('Could not set new keyboard group switch option')<br>>  <br>> -<br>>          return False<br>>  <br>>      def _setup_layouts(self):<br>> @@ -417,10 +418,8 @@ class Keyboard(SectionView):<br>>  <br>>          return False<br>>  <br>> -<br>>      def undo(self):<br>>          """Reverts back to the original keyboard configuration"""<br>>          self._keyboard_manager.set_model(self._kmodel)<br>>          self._keyboard_manager.set_layouts(self._klayouts)<br>>          self._keyboard_manager.set_option_group(self._group_switch_option)<br>> -<br>> diff --git a/extensions/cpsection/language/__init__.py b/extensions/cpsection/language/__init__.py<br>> index a8f9f08..c93b7d1 100644<br>> --- a/extensions/cpsection/language/__init__.py<br>> +++ b/extensions/cpsection/language/__init__.py<br>> @@ -19,4 +19,3 @@ from gettext import gettext as _<br>>  CLASS = 'Language'<br>>  ICON = 'module-language'<br>>  TITLE = _('Language')<br>> -<br>> diff --git a/extensions/cpsection/language/model.py b/extensions/cpsection/language/model.py<br>> index bd61ed1..c6f4847 100644<br>> --- a/extensions/cpsection/language/model.py<br>> +++ b/extensions/cpsection/language/model.py<br>> @@ -25,9 +25,11 @@ import locale<br>>  from gettext import gettext as _<br>>  import subprocess<br>>  <br>> +<br>>  _default_lang = '%s.%s' % locale.getdefaultlocale()<br>>  _standard_msg = _("Could not access ~/.i18n. Create standard settings.")<br>>  <br>> +<br>>  def read_all_languages():<br>>      fdp = subprocess.Popen(['locale', '-av'], stdout=subprocess.PIPE)<br>>      lines = fdp.stdout.read().split('\n')<br>> @@ -52,6 +54,7 @@ def read_all_languages():<br>>      locales.sort()<br>>      return locales<br>>  <br>> +<br>>  def _initialize():<br>>      if set_languages.__doc__ is None:<br>>          # when running under 'python -OO', all __doc__ fields are None,<br>> @@ -63,6 +66,7 @@ def _initialize():<br>>          set_languages.__doc__ += '%s \n' % (lang[0].replace(' ', '_') + '/' +<br>>                                             lang[1].replace(' ', '_'))<br>>  <br>> +<br>>  def _write_i18n(langs):<br>>      colon = ':'<br>>      langstr = colon.join(langs)<br>> @@ -79,6 +83,7 @@ def _write_i18n(langs):<br>>          fd.write('LANGUAGE="%s"\n' % langstr)<br>>          fd.close()<br>>  <br>> +<br>>  def get_languages():<br>>      path = os.path.join(os.environ.get("HOME"), '.i18n')<br>>      if not os.access(path, os.R_OK):<br>> @@ -109,6 +114,7 @@ def get_languages():<br>>      else:<br>>          return langlist<br>>  <br>> +<br>>  def print_languages():<br>>      codes = get_languages()<br>>  <br>> @@ -124,6 +130,7 @@ def print_languages():<br>>          if not found_lang:<br>>              print (_("Language for code=%s could not be determined.") % code)<br>>  <br>> +<br>>  def set_languages(languages):<br>>      """Set the system language.<br>>      languages :<br>> @@ -146,6 +153,6 @@ def set_languages(languages):<br>>      else:<br>>          _write_i18n(languages)<br>>  <br>> +<br>>  # inilialize the docstrings for the language<br>>  _initialize()<br>> -<br>> diff --git a/extensions/cpsection/language/view.py b/extensions/cpsection/language/view.py<br>> index 4ce7196..3a1f1a5 100644<br>> --- a/extensions/cpsection/language/view.py<br>> +++ b/extensions/cpsection/language/view.py<br>> @@ -32,6 +32,7 @@ CLASS = 'Language'<br>>  ICON = 'module-language'<br>>  TITLE = gettext.gettext('Language')<br>>  <br>> +<br>>  class Language(SectionView):<br>>      def __init__(self, model, alerts):<br>>          SectionView.__init__(self)<br>> @@ -99,7 +100,6 @@ class Language(SectionView):<br>>          self._attach_to_table(label, 0, 1, padding=1)<br>>          label.show()<br>>  <br>> -<br>>          store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING)<br>>          for language, country, code in self._available_locales:<br>>              description = '%s (%s)' % (_translate_language(language), \<br>> @@ -271,7 +271,6 @@ class Language(SectionView):<br>>          else:<br>>              remove_button.props.visible = True<br>>  <br>> -<br>>      def __lang_timeout_cb(self, codes):<br>>          self._lang_sid = 0<br>>          self._model.set_languages(codes)<br>> diff --git a/extensions/cpsection/modemconfiguration/__init__.py b/extensions/cpsection/modemconfiguration/__init__.py<br>> index 8a219dc..61f5904 100644<br>> --- a/extensions/cpsection/modemconfiguration/__init__.py<br>> +++ b/extensions/cpsection/modemconfiguration/__init__.py<br>> @@ -19,4 +19,3 @@ from gettext import gettext as _<br>>  CLASS = 'ModemConfiguration'<br>>  ICON = 'module-modemconfiguration'<br>>  TITLE = _('Modem Configuration')<br>> -<br>> diff --git a/extensions/cpsection/modemconfiguration/model.py b/extensions/cpsection/modemconfiguration/model.py<br>> index 2545ce1..1e83c44 100755<br>> --- a/extensions/cpsection/modemconfiguration/model.py<br>> +++ b/extensions/cpsection/modemconfiguration/model.py<br>> @@ -20,51 +20,62 @@ from jarabe.model.network import GSM_USERNAME_PATH, GSM_PASSWORD_PATH, \<br>>                                   GSM_NUMBER_PATH, GSM_APN_PATH, GSM_PIN_PATH, \<br>>                                   GSM_PUK_PATH<br>>  <br>> +<br>>  def get_username():<br>>      client = gconf.client_get_default()<br>>      return client.get_string(GSM_USERNAME_PATH) or ''<br>>  <br>> +<br>>  def get_password():<br>>      client = gconf.client_get_default()<br>>      return client.get_string(GSM_PASSWORD_PATH) or ''<br>>  <br>> +<br>>  def get_number():<br>>      client = gconf.client_get_default()<br>>      return client.get_string(GSM_NUMBER_PATH) or ''<br>>  <br>> +<br>>  def get_apn():<br>>      client = gconf.client_get_default()<br>>      return client.get_string(GSM_APN_PATH) or ''<br>>  <br>> +<br>>  def get_pin():<br>>      client = gconf.client_get_default()<br>>      return client.get_string(GSM_PIN_PATH) or ''<br>>  <br>> +<br>>  def get_puk():<br>>      client = gconf.client_get_default()<br>>      return client.get_string(GSM_PUK_PATH) or ''<br>>  <br>> +<br>>  def set_username(username):<br>>      client = gconf.client_get_default()<br>>      client.set_string(GSM_USERNAME_PATH, username)<br>>  <br>> +<br>>  def set_password(password):<br>>      client = gconf.client_get_default()<br>>      client.set_string(GSM_PASSWORD_PATH, password)<br>>  <br>> +<br>>  def set_number(number):<br>>      client = gconf.client_get_default()<br>>      client.set_string(GSM_NUMBER_PATH, number)<br>>  <br>> +<br>>  def set_apn(apn):<br>>      client = gconf.client_get_default()<br>>      client.set_string(GSM_APN_PATH, apn)<br>>  <br>> +<br>>  def set_pin(pin):<br>>      client = gconf.client_get_default()<br>>      client.set_string(GSM_PIN_PATH, pin)<br>>  <br>> +<br>>  def set_puk(puk):<br>>      client = gconf.client_get_default()<br>>      client.set_string(GSM_PUK_PATH, puk)<br>> -<br>> diff --git a/extensions/cpsection/modemconfiguration/view.py b/extensions/cpsection/modemconfiguration/view.py<br>> index af8f332..11396d7 100644<br>> --- a/extensions/cpsection/modemconfiguration/view.py<br>> +++ b/extensions/cpsection/modemconfiguration/view.py<br>> @@ -25,8 +25,10 @@ from sugar.graphics import style<br>>  <br>>  from jarabe.controlpanel.sectionview import SectionView<br>>  <br>> +<br>>  APPLY_TIMEOUT = 1000<br>>  <br>> +<br>>  class EntryWithLabel(gtk.HBox):<br>>      __gtype_name__ = "SugarEntryWithLabel"<br>>  <br>> @@ -86,6 +88,7 @@ class EntryWithLabel(gtk.HBox):<br>>          return self._is_valid<br>>      is_valid = gobject.property(type=bool, getter=_get_is_valid, default=True)<br>>  <br>> +<br>>  class UsernameEntry(EntryWithLabel):<br>>      def __init__(self, model):<br>>          EntryWithLabel.__init__(self, _('Username:'))<br>> @@ -97,6 +100,7 @@ class UsernameEntry(EntryWithLabel):<br>>      def set_value(self, username):<br>>          self._model.set_username(username)<br>>  <br>> +<br>>  class PasswordEntry(EntryWithLabel):<br>>      def __init__(self, model):<br>>          EntryWithLabel.__init__(self, _('Password:'))<br>> @@ -108,6 +112,7 @@ class PasswordEntry(EntryWithLabel):<br>>      def set_value(self, password):<br>>          self._model.set_password(password)<br>>  <br>> +<br>>  class NumberEntry(EntryWithLabel):<br>>      def __init__(self, model):<br>>          EntryWithLabel.__init__(self, _('Number:'))<br>> @@ -119,6 +124,7 @@ class NumberEntry(EntryWithLabel):<br>>      def set_value(self, number):<br>>          self._model.set_number(number)<br>>  <br>> +<br>>  class ApnEntry(EntryWithLabel):<br>>      def __init__(self, model):<br>>          EntryWithLabel.__init__(self, _('Access Point Name (APN):'))<br>> @@ -130,6 +136,7 @@ class ApnEntry(EntryWithLabel):<br>>      def set_value(self, apn):<br>>          self._model.set_apn(apn)<br>>  <br>> +<br>>  class PinEntry(EntryWithLabel):<br>>      def __init__(self, model):<br>>          EntryWithLabel.__init__(self, _('Personal Identity Number (PIN):'))<br>> @@ -141,6 +148,7 @@ class PinEntry(EntryWithLabel):<br>>      def set_value(self, pin):<br>>          self._model.set_pin(pin)<br>>  <br>> +<br>>  class PukEntry(EntryWithLabel):<br>>      def __init__(self, model):<br>>          EntryWithLabel.__init__(self, _('Personal Unblocking Key (PUK):'))<br>> @@ -247,4 +255,3 @@ class ModemConfiguration(SectionView):<br>>          if entry.is_valid:<br>>              self.needs_restart = True<br>>          self._validate()<br>> -<br>> diff --git a/extensions/cpsection/network/__init__.py b/extensions/cpsection/network/__init__.py<br>> index 8fea274..86546f7 100644<br>> --- a/extensions/cpsection/network/__init__.py<br>> +++ b/extensions/cpsection/network/__init__.py<br>> @@ -20,6 +20,3 @@ CLASS = 'Network'<br>>  ICON = 'module-network'<br>>  TITLE = _('Network')<br>>  KEYWORDS = ['network', 'jabber', 'radio', 'server']<br>> -<br>> -<br>> -<br>> diff --git a/extensions/cpsection/network/model.py b/extensions/cpsection/network/model.py<br>> index aad0607..c1e7229 100644<br>> --- a/extensions/cpsection/network/model.py<br>> +++ b/extensions/cpsection/network/model.py<br>> @@ -25,19 +25,24 @@ _NM_IFACE = 'org.freedesktop.NetworkManager'<br>>  <br>>  KEYWORDS = ['network', 'jabber', 'radio', 'server']<br>>  <br>> +<br>>  class ReadError(Exception):<br>>      def __init__(self, value):<br>>          self.value = value<br>> +<br>>      def __str__(self):<br>>          return repr(self.value)<br>>  <br>> +<br>>  def get_jabber():<br>>      client = gconf.client_get_default()<br>>      return client.get_string('/desktop/sugar/collaboration/jabber_server')<br>>  <br>> +<br>>  def print_jabber():<br>>      print get_jabber()<br>>  <br>> +<br>>  def set_jabber(server):<br>>      """Set the jabber server<br>>      server : e.g. 'olpc.collabora.co.uk'<br>> @@ -47,6 +52,7 @@ def set_jabber(server):<br>>  <br>>      return 0<br>>  <br>> +<br>>  def get_radio():<br>>      try:<br>>          bus = dbus.SystemBus()<br>> @@ -61,9 +67,11 @@ def get_radio():<br>>      else:<br>>          raise ReadError(_('State is unknown.'))<br>>  <br>> +<br>>  def print_radio():<br>>      print ('off', 'on')[get_radio()]<br>>  <br>> +<br>>  def set_radio(state):<br>>      """Turn Radio 'on' or 'off'<br>>      state : 'on/off'<br>> @@ -89,6 +97,7 @@ def set_radio(state):<br>>  <br>>      return 0<br>>  <br>> +<br>>  def clear_registration():<br>>      """Clear the registration with the schoolserver<br>>      """<br>> @@ -96,19 +105,23 @@ def clear_registration():<br>>      client.set_string('/desktop/sugar/backup_url', '')<br>>      return 1<br>>  <br>> +<br>>  def clear_networks():<br>>      """Clear saved passwords and network configurations.<br>>      """<br>>      pass<br>>  <br>> +<br>>  def get_publish_information():<br>>      client = gconf.client_get_default()<br>>      publish = client.get_bool('/desktop/sugar/collaboration/publish_gadget')<br>>      return publish<br>>  <br>> +<br>>  def print_publish_information():<br>>      print get_publish_information()<br>>  <br>> +<br>>  def set_publish_information(value):<br>>      """ If set to true, Sugar will make you searchable for<br>>      the other users of the Jabber server.<br>> diff --git a/extensions/cpsection/network/view.py b/extensions/cpsection/network/view.py<br>> index a331bbd..447a51d 100644<br>> --- a/extensions/cpsection/network/view.py<br>> +++ b/extensions/cpsection/network/view.py<br>> @@ -23,12 +23,14 @@ from sugar.graphics import style<br>>  from jarabe.controlpanel.sectionview import SectionView<br>>  from jarabe.controlpanel.inlinealert import InlineAlert<br>>  <br>> +<br>>  CLASS = 'Network'<br>>  ICON = 'module-network'<br>>  TITLE = _('Network')<br>>  <br>>  _APPLY_TIMEOUT = 3000<br>>  <br>> +<br>>  class Network(SectionView):<br>>      def __init__(self, model, alerts):<br>>          SectionView.__init__(self)<br>> diff --git a/extensions/cpsection/power/__init__.py b/extensions/cpsection/power/__init__.py<br>> index 8b2e85f..35f7efd 100644<br>> --- a/extensions/cpsection/power/__init__.py<br>> +++ b/extensions/cpsection/power/__init__.py<br>> @@ -20,4 +20,3 @@ CLASS = 'Power'<br>>  ICON = 'module-power'<br>>  TITLE = _('Power')<br>>  KEYWORDS = ['automatic', 'extreme', 'power', 'suspend', 'battery']<br>> -<br>> diff --git a/extensions/cpsection/power/model.py b/extensions/cpsection/power/model.py<br>> index 6c03ca8..ffbb5a2 100644<br>> --- a/extensions/cpsection/power/model.py<br>> +++ b/extensions/cpsection/power/model.py<br>> @@ -35,14 +35,17 @@ _logger = logging.getLogger('ControlPanel - Power')<br>>  class ReadError(Exception):<br>>      def __init__(self, value):<br>>          self.value = value<br>> +<br>>      def __str__(self):<br>>          return repr(self.value)<br>>  <br>> +<br>>  def using_powerd():<br>>      # directory exists if powerd running, and it's recent<br>>      # enough to be controllable.<br>>      return os.access(POWERD_FLAG_DIR, os.W_OK)<br>>  <br>> +<br>>  def get_automatic_pm():<br>>      if using_powerd():<br>>          return not os.access(POWERD_INHIBIT_FLAG, os.R_OK)<br>> @@ -51,9 +54,11 @@ def get_automatic_pm():<br>>      client = gconf.client_get_default()<br>>      return client.get_bool('/desktop/sugar/power/automatic')<br>>  <br>> +<br>>  def print_automatic_pm():<br>>      print ('off', 'on')[get_automatic_pm()]<br>>  <br>> +<br>>  def set_automatic_pm(enabled):<br>>      """Automatic suspends on/off."""<br>>  <br>> @@ -88,13 +93,16 @@ def set_automatic_pm(enabled):<br>>      client.set_bool('/desktop/sugar/power/automatic', enabled)<br>>      return<br>>  <br>> +<br>>  def get_extreme_pm():<br>>      client = gconf.client_get_default()<br>>      return client.get_bool('/desktop/sugar/power/extreme')<br>>  <br>> +<br>>  def print_extreme_pm():<br>>      print ('off', 'on')[get_extreme_pm()]<br>>  <br>> +<br>>  def set_extreme_pm(enabled):<br>>      """Extreme power management on/off."""<br>>  <br>> diff --git a/extensions/cpsection/power/view.py b/extensions/cpsection/power/view.py<br>> index 8f1ed56..fd89efa 100644<br>> --- a/extensions/cpsection/power/view.py<br>> +++ b/extensions/cpsection/power/view.py<br>> @@ -22,6 +22,7 @@ from sugar.graphics import style<br>>  from jarabe.controlpanel.sectionview import SectionView<br>>  from jarabe.controlpanel.inlinealert import InlineAlert<br>>  <br>> +<br>>  class Power(SectionView):<br>>      def __init__(self, model, alerts):<br>>          SectionView.__init__(self)<br>> diff --git a/extensions/cpsection/updater/model.py b/extensions/cpsection/updater/model.py<br>> index 4cb90ed..7db49fe 100755<br>> --- a/extensions/cpsection/updater/model.py<br>> +++ b/extensions/cpsection/updater/model.py<br>> @@ -216,6 +216,7 @@ class UpdateModel(gobject.GObject):<br>>          self._bundles_to_update = None<br>>          self._cancelling = False<br>>  <br>> +<br>>  class BundleUpdate(object):<br>>  <br>>      def __init__(self, bundle, version, link, size):<br>> diff --git a/extensions/cpsection/updater/view.py b/extensions/cpsection/updater/view.py<br>> index 31a5737..2bec3f0 100644<br>> --- a/extensions/cpsection/updater/view.py<br>> +++ b/extensions/cpsection/updater/view.py<br>> @@ -179,6 +179,7 @@ class ActivityUpdater(SectionView):<br>>      def undo(self):<br>>          self._model.cancel()<br>>  <br>> +<br>>  class ProgressPane(gtk.VBox):<br>>      '''Container which replaces the `ActivityPane` during refresh or<br>>      install.'''<br>> diff --git a/extensions/deviceicon/battery.py b/extensions/deviceicon/battery.py<br>> index 8b1bac8..c1c920b 100644<br>> --- a/extensions/deviceicon/battery.py<br>> +++ b/extensions/deviceicon/battery.py<br>> @@ -30,6 +30,7 @@ from sugar.graphics.xocolor import XoColor<br>>  <br>>  from jarabe.frame.frameinvoker import FrameWidgetInvoker<br>>  <br>> +<br>>  _ICON_NAME = 'battery'<br>>  <br>>  _STATUS_CHARGING = 0<br>> @@ -42,6 +43,7 @@ _CHARGING_PROP = 'battery.rechargeable.is_charging'<br>>  _DISCHARGING_PROP = 'battery.rechargeable.is_discharging'<br>>  _PRESENT_PROP = 'battery.present'<br>>  <br>> +<br>>  class DeviceView(TrayIcon):<br>>  <br>>      FRAME_POSITION_RELATIVE = 102<br>> @@ -101,6 +103,7 @@ class DeviceView(TrayIcon):<br>>      def _battery_status_changed_cb(self, pspec, param):<br>>          self._update_info()<br>>  <br>> +<br>>  class BatteryPalette(Palette):<br>>  <br>>      def __init__(self, primary_text):<br>> @@ -155,6 +158,7 @@ class BatteryPalette(Palette):<br>>          self.props.secondary_text = secondary_text<br>>          self._status_label.set_text(status_text)<br>>  <br>> +<br>>  class DeviceModel(gobject.GObject):<br>>      __gproperties__ = {<br>>          'level'       : (int, None, None, 0, 100, 0,<br>> @@ -241,6 +245,7 @@ class DeviceModel(gobject.GObject):<br>>                  self._present = self._get_present()<br>>                  self.notify('present')<br>>  <br>> +<br>>  def setup(tray):<br>>      bus = dbus.Bus(dbus.Bus.TYPE_SYSTEM)<br>>      proxy = bus.get_object('org.freedesktop.Hal',<br>> diff --git a/extensions/deviceicon/network.py b/extensions/deviceicon/network.py<br>> index 447cad5..55e334f 100644<br>> --- a/extensions/deviceicon/network.py<br>> +++ b/extensions/deviceicon/network.py<br>> @@ -49,6 +49,7 @@ from jarabe.model.network import IP4Config<br>>  from jarabe.frame.frameinvoker import FrameWidgetInvoker<br>>  from jarabe.view.pulsingicon import PulsingIcon<br>>  <br>> +<br>>  IP_ADDRESS_TEXT_TEMPLATE = _("IP address: %s")<br>>  <br>>  _NM_SERVICE = 'org.freedesktop.NetworkManager'<br>> @@ -199,6 +200,7 @@ class WiredPalette(Palette):<br>>              ip_address_text = ""<br>>          self._ip_address_label.set_text(ip_address_text)<br>>  <br>> +<br>>  class GsmPalette(Palette):<br>>      __gtype_name__ = 'SugarGsmPalette'<br>>  <br>> @@ -749,6 +751,7 @@ class GsmDeviceView(TrayIcon):<br>>                                        signal_name='PppStats',<br>>                                        path=self._device.object_path,<br>>                                        dbus_interface=_NM_SERIAL_IFACE)<br>> +<br>>      def create_palette(self):<br>>          palette = GsmPalette()<br>>  <br>> @@ -1001,6 +1004,7 @@ class WiredDeviceObserver(object):<br>>                  del self._device_view<br>>                  self._device_view = None<br>>  <br>> +<br>>  class GsmDeviceObserver(object):<br>>      def __init__(self, device, tray):<br>>          self._device = device<br>> @@ -1015,6 +1019,7 @@ class GsmDeviceObserver(object):<br>>          self._tray.remove_device(self._device_view)<br>>          self._device_view = None<br>>  <br>> +<br>>  class NetworkManagerObserver(object):<br>>      def __init__(self, tray):<br>>          self._bus = dbus.SystemBus()<br>> @@ -1073,5 +1078,6 @@ class NetworkManagerObserver(object):<br>>              device.disconnect()<br>>              del self._devices[device_op]<br>>  <br>> +<br>>  def setup(tray):<br>>      device_observer = NetworkManagerObserver(tray)<br>> diff --git a/extensions/deviceicon/speaker.py b/extensions/deviceicon/speaker.py<br>> index cf06e01..ae84036 100644<br>> --- a/extensions/deviceicon/speaker.py<br>> +++ b/extensions/deviceicon/speaker.py<br>> @@ -32,6 +32,7 @@ from jarabe.model import sound<br>>  <br>>  _ICON_NAME = 'speaker'<br>>  <br>> +<br>>  class DeviceView(TrayIcon):<br>>  <br>>      FRAME_POSITION_RELATIVE = 103<br>> @@ -86,6 +87,7 @@ class DeviceView(TrayIcon):<br>>      def __speaker_status_changed_cb(self, pspec_, param_):<br>>          self._update_info()<br>>  <br>> +<br>>  class SpeakerPalette(Palette):<br>>  <br>>      def __init__(self, primary_text, model):<br>> @@ -167,6 +169,7 @@ class SpeakerPalette(Palette):<br>>          self._update_level()<br>>          self._update_muted()<br>>  <br>> +<br>>  class DeviceModel(gobject.GObject):<br>>      __gproperties__ = {<br>>          'level'   : (int, None, None, 0, 100, 0, gobject.PARAM_READWRITE),<br>> @@ -212,5 +215,6 @@ class DeviceModel(gobject.GObject):<br>>          elif pspec.name == "muted":<br>>              self._set_muted(value)<br>>  <br>> +<br>>  def setup(tray):<br>>      tray.add_device(DeviceView())<br>> diff --git a/extensions/deviceicon/volume.py b/extensions/deviceicon/volume.py<br>> index e7f62a2..ea2377d 100644<br>> --- a/extensions/deviceicon/volume.py<br>> +++ b/extensions/deviceicon/volume.py<br>> @@ -28,8 +28,10 @@ from jarabe.journal import journalactivity<br>>  from jarabe.view.palettes import VolumePalette<br>>  from jarabe.frame.frameinvoker import FrameWidgetInvoker<br>>  <br>> +<br>>  _icons = {}<br>>  <br>> +<br>>  class DeviceView(TrayIcon):<br>>  <br>>      FRAME_POSITION_RELATIVE = 500<br>> @@ -70,9 +72,11 @@ class DeviceView(TrayIcon):<br>>          journal.reveal()<br>>          return True<br>>  <br>> +<br>>  def setup(tray):<br>>      gobject.idle_add(_setup_volumes, tray)<br>>  <br>> +<br>>  def _setup_volumes(tray):<br>>      volume_monitor = gio.volume_monitor_get()<br>>  <br>> @@ -86,9 +90,11 @@ def _setup_volumes(tray):<br>>      volume_monitor.connect('mount-added', _mount_added_cb, tray)<br>>      volume_monitor.connect('mount-removed', _mount_removed_cb, tray)<br>>  <br>> +<br>>  def _volume_added_cb(volume_monitor, volume, tray):<br>>      _mount(volume, tray)<br>>  <br>> +<br>>  def _mount(volume, tray):<br>>      # Follow Nautilus behaviour here<br>>      # since it has the same issue with removable device<br>> @@ -102,20 +108,23 @@ def _mount(volume, tray):<br>>          #TODO: pass None as mount_operation, or better, SugarMountOperation<br>>          volume.mount(gtk.MountOperation(tray.get_toplevel()), _mount_cb)<br>>  <br>> +<br>>  def _mount_cb(volume, result):<br>>      logging.debug('_mount_cb %r %r', volume, result)<br>>      volume.mount_finish(result)<br>>  <br>> +<br>>  def _mount_added_cb(volume_monitor, mount, tray):<br>>      _add_device(mount, tray)<br>>  <br>> +<br>>  def _mount_removed_cb(volume_monitor, mount, tray):<br>>      icon = _icons[mount]<br>>      tray.remove_device(icon)<br>>      del _icons[mount]<br>>  <br>> +<br>>  def _add_device(mount, tray):<br>>      icon = DeviceView(mount)<br>>      _icons[mount] = icon<br>>      tray.add_device(icon)<br>> -<br>> diff --git a/extensions/globalkey/screenshot.py b/extensions/globalkey/screenshot.py<br>> index 8b4d4c2..b62806f 100644<br>> --- a/extensions/globalkey/screenshot.py<br>> +++ b/extensions/globalkey/screenshot.py<br>> @@ -31,6 +31,7 @@ from jarabe.model import shell<br>>  <br>>  BOUND_KEYS = ['<alt>1', 'Print']<br>>  <br>> +<br>>  def handle_key_press(key):<br>>      tmp_dir = os.path.join(env.get_profile_path(), 'data')<br>>      fd, file_path = tempfile.mkstemp(dir=tmp_dir)<br>> @@ -87,14 +88,15 @@ def handle_key_press(key):<br>>          jobject.destroy()<br>>          del jobject<br>>  <br>> +<br>>  def _get_preview_data(screenshot):<br>>      preview = screenshot.scale_simple(style.zoom(300), style.zoom(225),<br>>                                        gtk.gdk.INTERP_BILINEAR)<br>>      preview_data = []<br>> +<br>>      def save_func(buf, data):<br>>          data.append(buf)<br>>  <br>>      preview.save_to_callback(save_func, 'png', user_data=preview_data)<br>>  <br>>      return dbus.ByteArray(''.join(preview_data))<br>> -<br>> diff --git a/extensions/globalkey/viewsource.py b/extensions/globalkey/viewsource.py<br>> index df3cd9e..96e7c6b 100644<br>> --- a/extensions/globalkey/viewsource.py<br>> +++ b/extensions/globalkey/viewsource.py<br>> @@ -18,8 +18,10 @@<br>>  from jarabe.view.viewsource import setup_view_source<br>>  from jarabe.model import shell<br>>  <br>> +<br>>  BOUND_KEYS = ['0xEC', '<alt><shift>v']<br>>  <br>> +<br>>  def handle_key_press(key):<br>>      shell_model = shell.get_model()<br>>      activity = shell_model.get_active_activity()<br>> diff --git a/src/jarabe/__init__.py b/src/jarabe/__init__.py<br>> index 41b4b1c..ed2f639 100644<br>> --- a/src/jarabe/__init__.py<br>> +++ b/src/jarabe/__init__.py<br>> @@ -23,4 +23,3 @@ refer to a command-line "shell" interface.<br>>  # You should have received a copy of the GNU General Public License<br>>  # along with this program; if not, write to the Free Software<br>>  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA<br>> -<br>> diff --git a/src/jarabe/controlpanel/__init__.py b/src/jarabe/controlpanel/__init__.py<br>> index a9dd95a..85f6a24 100644<br>> --- a/src/jarabe/controlpanel/__init__.py<br>> +++ b/src/jarabe/controlpanel/__init__.py<br>> @@ -13,4 +13,3 @@<br>>  # You should have received a copy of the GNU General Public License<br>>  # along with this program; if not, write to the Free Software<br>>  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA<br>> -<br>> diff --git a/src/jarabe/controlpanel/cmd.py b/src/jarabe/controlpanel/cmd.py<br>> index 7144b33..6d5f127 100644<br>> --- a/src/jarabe/controlpanel/cmd.py<br>> +++ b/src/jarabe/controlpanel/cmd.py<br>> @@ -23,6 +23,7 @@ import logging<br>>  <br>>  from jarabe import config<br>>  <br>> +<br>>  _RESTART = 1<br>>  <br>>  _same_option_warning = _("sugar-control-panel: WARNING, found more than"<br>> @@ -30,6 +31,7 @@ _same_option_warning = _("sugar-control-panel: WARNING, found more than"<br>>  _no_option_error = _("sugar-control-panel: key=%s not an available option")<br>>  _general_error = _("sugar-control-panel: %s")<br>>  <br>> +<br>>  def cmd_help():<br>>      '''Print the help to the screen'''<br>>      # TRANS: Translators, there's a empty line at the end of this string,<br>> @@ -45,11 +47,13 @@ def cmd_help():<br>>      -c key       clear the current value for the key \n\<br>>      ')<br>>  <br>> +<br>>  def note_restart():<br>>      '''Instructions how to restart sugar'''<br>>      print _('To apply your changes you have to restart sugar.\n' +<br>>              'Hit ctrl+alt+erase on the keyboard to trigger a restart.')<br>>  <br>> +<br>>  def load_modules():<br>>      '''Build a list of pointers to available modules and import them.<br>>      '''<br>> @@ -72,6 +76,7 @@ def load_modules():<br>>  <br>>      return modules<br>>  <br>> +<br>>  def main():<br>>      try:<br>>          options, args = getopt.getopt(sys.argv[1:], "h:s:g:c:l", [])<br>> diff --git a/src/jarabe/controlpanel/gui.py b/src/jarabe/controlpanel/gui.py<br>> index 51d9820..4e2cbd1 100644<br>> --- a/src/jarabe/controlpanel/gui.py<br>> +++ b/src/jarabe/controlpanel/gui.py<br>> @@ -32,9 +32,11 @@ from jarabe.controlpanel.toolbar import MainToolbar<br>>  from jarabe.controlpanel.toolbar import SectionToolbar<br>>  from jarabe import config<br>>  <br>> +<br>>  _logger = logging.getLogger('ControlPanel')<br>>  _MAX_COLUMNS = 5<br>>  <br>> +<br>>  class ControlPanel(gtk.Window):<br>>      __gtype_name__ = 'SugarControlPanel'<br>>  <br>> @@ -333,6 +335,7 @@ class ControlPanel(gtk.Window):<br>>          section_is_valid = section_view.props.is_valid<br>>          self._section_toolbar.accept_button.set_sensitive(section_is_valid)<br>>  <br>> +<br>>  class ModelWrapper(object):<br>>      def __init__(self, module):<br>>          self._module = module<br>> @@ -360,6 +363,7 @@ class ModelWrapper(object):<br>>                  except Exception, detail:<br>>                      _logger.debug('Error undo option: %s', detail)<br>>  <br>> +<br>>  class _SectionIcon(gtk.EventBox):<br>>      __gtype_name__ = "SugarSectionIcon"<br>>  <br>> diff --git a/src/jarabe/controlpanel/inlinealert.py b/src/jarabe/controlpanel/inlinealert.py<br>> index b1880da..9c08c62 100644<br>> --- a/src/jarabe/controlpanel/inlinealert.py<br>> +++ b/src/jarabe/controlpanel/inlinealert.py<br>> @@ -21,6 +21,7 @@ import pango<br>>  from sugar.graphics import style<br>>  from sugar.graphics.icon import Icon<br>>  <br>> +<br>>  class InlineAlert(gtk.HBox):<br>>      """UI interface for Inline alerts<br>>  <br>> @@ -80,4 +81,3 @@ class InlineAlert(gtk.HBox):<br>>      def do_get_property(self, pspec):<br>>          if pspec.name == 'msg':<br>>              return self._msg<br>> -<br>> diff --git a/src/jarabe/controlpanel/sectionview.py b/src/jarabe/controlpanel/sectionview.py<br>> index 4de27a2..5b44161 100644<br>> --- a/src/jarabe/controlpanel/sectionview.py<br>> +++ b/src/jarabe/controlpanel/sectionview.py<br>> @@ -18,6 +18,7 @@ import gobject<br>>  import gtk<br>>  from gettext import gettext as _<br>>  <br>> +<br>>  class SectionView(gtk.VBox):<br>>      __gtype_name__ = 'SugarSectionView'<br>>  <br>> diff --git a/src/jarabe/controlpanel/toolbar.py b/src/jarabe/controlpanel/toolbar.py<br>> index 320a8eb..72b1be3 100644<br>> --- a/src/jarabe/controlpanel/toolbar.py<br>> +++ b/src/jarabe/controlpanel/toolbar.py<br>> @@ -25,6 +25,7 @@ from sugar.graphics.toolbutton import ToolButton<br>>  from sugar.graphics import iconentry<br>>  from sugar.graphics import style<br>>  <br>> +<br>>  class MainToolbar(gtk.Toolbar):<br>>      """ Main toolbar of the control panel<br>>      """<br>> @@ -38,6 +39,7 @@ class MainToolbar(gtk.Toolbar):<br>>                            gobject.TYPE_NONE,<br>>                            ([str]))<br>>      }<br>> +<br>>      def __init__(self):<br>>          gtk.Toolbar.__init__(self)<br>>  <br>> @@ -83,6 +85,7 @@ class MainToolbar(gtk.Toolbar):<br>>      def __stop_clicked_cb(self, button):<br>>          self.emit('stop-clicked')<br>>  <br>> +<br>>  class SectionToolbar(gtk.Toolbar):<br>>      """ Toolbar of the sections of the control panel<br>>      """<br>> @@ -96,6 +99,7 @@ class SectionToolbar(gtk.Toolbar):<br>>                              gobject.TYPE_NONE,<br>>                              ([]))<br>>      }<br>> +<br>>      def __init__(self):<br>>          gtk.Toolbar.__init__(self)<br>>  <br>> @@ -154,4 +158,3 @@ class SectionToolbar(gtk.Toolbar):<br>>  <br>>      def __accept_button_clicked_cb(self, widget, data=None):<br>>          self.emit('accept-clicked')<br>> -<br>> diff --git a/src/jarabe/desktop/__init__.py b/src/jarabe/desktop/__init__.py<br>> index a9dd95a..85f6a24 100644<br>> --- a/src/jarabe/desktop/__init__.py<br>> +++ b/src/jarabe/desktop/__init__.py<br>> @@ -13,4 +13,3 @@<br>>  # You should have received a copy of the GNU General Public License<br>>  # along with this program; if not, write to the Free Software<br>>  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA<br>> -<br>> diff --git a/src/jarabe/desktop/activitieslist.py b/src/jarabe/desktop/activitieslist.py<br>> index 56b3b5f..9476370 100644<br>> --- a/src/jarabe/desktop/activitieslist.py<br>> +++ b/src/jarabe/desktop/activitieslist.py<br>> @@ -38,6 +38,7 @@ from jarabe.view.palettes import ActivityPalette<br>>  from jarabe.view import launcher<br>>  from jarabe.journal import misc<br>>  <br>> +<br>>  class ActivitiesTreeView(gtk.TreeView):<br>>      __gtype_name__ = 'SugarActivitiesTreeView'<br>>  <br>> @@ -154,6 +155,7 @@ class ActivitiesTreeView(gtk.TreeView):<br>>          title = model[tree_iter][ListModel.COLUMN_TITLE]<br>>          return title is not None and title.lower().find(self._query) > -1<br>>  <br>> +<br>>  class ListModel(gtk.TreeModelSort):<br>>      __gtype_name__ = 'SugarListModel'<br>>  <br>> @@ -238,6 +240,7 @@ class ListModel(gtk.TreeModelSort):<br>>      def refilter(self):<br>>          self._model_filter.refilter()<br>>  <br>> +<br>>  class CellRendererFavorite(CellRendererIcon):<br>>      __gtype_name__ = 'SugarCellRendererFavorite'<br>>  <br>> @@ -252,6 +255,7 @@ class CellRendererFavorite(CellRendererIcon):<br>>          self.props.prelit_stroke_color = style.COLOR_BUTTON_GREY.get_svg()<br>>          self.props.prelit_fill_color = style.COLOR_BUTTON_GREY.get_svg()<br>>  <br>> +<br>>  class CellRendererActivityIcon(CellRendererIcon):<br>>      __gtype_name__ = 'SugarCellRendererActivityIcon'<br>>  <br>> @@ -290,6 +294,7 @@ class CellRendererActivityIcon(CellRendererIcon):<br>>      def __erase_activated_cb(self, palette, bundle_id):<br>>          self.emit('erase-activated', bundle_id)<br>>  <br>> +<br>>  class ActivitiesList(gtk.VBox):<br>>      __gtype_name__ = 'SugarActivitiesList'<br>>  <br>> @@ -373,6 +378,7 @@ class ActivitiesList(gtk.VBox):<br>>              bundle = registry.get_bundle(bundle_id)<br>>              registry.uninstall(bundle, delete_profile=True)<br>>  <br>> +<br>>  class ActivityListPalette(ActivityPalette):<br>>      __gtype_name__ = 'SugarActivityListPalette'<br>>  <br>> @@ -452,4 +458,3 @@ class ActivityListPalette(ActivityPalette):<br>>  <br>>      def __erase_activate_cb(self, menu_item):<br>>          self.emit('erase-activated', self._bundle_id)<br>> -<br>> diff --git a/src/jarabe/desktop/favoriteslayout.py b/src/jarabe/desktop/favoriteslayout.py<br>> index 7b847ac..433dd2d 100644<br>> --- a/src/jarabe/desktop/favoriteslayout.py<br>> +++ b/src/jarabe/desktop/favoriteslayout.py<br>> @@ -29,6 +29,7 @@ from sugar.graphics import style<br>>  from jarabe.model import bundleregistry<br>>  from jarabe.desktop.grid import Grid<br>>  <br>> +<br>>  _logger = logging.getLogger('FavoritesLayout')<br>>  <br>>  _CELL_SIZE = 4<br>> @@ -109,6 +110,7 @@ class FavoritesLayout(gobject.GObject, hippo.CanvasLayout):<br>>      def allow_dnd(self):<br>>          return False<br>>  <br>> +<br>>  class RandomLayout(FavoritesLayout):<br>>      """Lay out icons randomly; try to nudge them around to resolve overlaps."""<br>>  <br>> @@ -189,6 +191,7 @@ class RandomLayout(FavoritesLayout):<br>>      def allow_dnd(self):<br>>          return True<br>>  <br>> +<br>>  _MINIMUM_RADIUS = style.XLARGE_ICON_SIZE / 2 + style.DEFAULT_SPACING + \<br>>          style.STANDARD_ICON_SIZE * 2<br>>  _MAXIMUM_RADIUS = (gtk.gdk.screen_height() - style.GRID_CELL_SIZE) / 2 - \<br>> @@ -351,6 +354,7 @@ class RingLayout(FavoritesLayout):<br>>          else:<br>>              return 0<br>>  <br>> +<br>>  _SUNFLOWER_CONSTANT = style.STANDARD_ICON_SIZE * .75<br>>  """Chose a constant such that STANDARD_ICON_SIZE icons are nicely spaced."""<br>>  <br>> @@ -376,6 +380,7 @@ This is the golden angle: http://en.wikipedia.org/wiki/Golden_angle<br>>  Calculation: math.radians(360) / ( _GOLDEN_RATIO * _GOLDEN_RATIO )<br>>  """<br>>  <br>> +<br>>  class SunflowerLayout(RingLayout):<br>>      """Spiral layout based on Fibonacci ratio in phyllotaxis.<br>>  <br>> @@ -446,6 +451,7 @@ class SunflowerLayout(RingLayout):<br>>  <br>>              return x, y<br>>  <br>> +<br>>  class BoxLayout(RingLayout):<br>>      """Lay out icons in a square around the XO man."""<br>>  <br>> @@ -487,6 +493,7 @@ class BoxLayout(RingLayout):<br>>                 (self, radius, icon_size, index, children_count,<br>>                  sin=sin, cos=cos)<br>>  <br>> +<br>>  class TriangleLayout(RingLayout):<br>>      """Lay out icons in a triangle around the XO man."""<br>>  <br>> diff --git a/src/jarabe/desktop/favoritesview.py b/src/jarabe/desktop/favoritesview.py<br>> index d582433..08c3675 100644<br>> --- a/src/jarabe/desktop/favoritesview.py<br>> +++ b/src/jarabe/desktop/favoritesview.py<br>> @@ -48,6 +48,7 @@ from jarabe.desktop import schoolserver<br>>  from jarabe.desktop.schoolserver import RegisterError<br>>  from jarabe.desktop import favoriteslayout<br>>  <br>> +<br>>  _logger = logging.getLogger('FavoritesView')<br>>  <br>>  _ICON_DND_TARGET = ('activity-icon', gtk.TARGET_SAME_WIDGET, 0)<br>> @@ -509,6 +510,7 @@ class ActivityIcon(CanvasIcon):<br>>          self._resume_mode = resume_mode<br>>          self._update()<br>>  <br>> +<br>>  class FavoritePalette(ActivityPalette):<br>>      __gtype_name__ = 'SugarFavoritePalette'<br>>  <br>> @@ -557,6 +559,7 @@ class FavoritePalette(ActivityPalette):<br>>          if entry is not None:<br>>              self.emit('entry-activate', entry)<br>>  <br>> +<br>>  class CurrentActivityIcon(CanvasIcon, hippo.CanvasItem):<br>>      def __init__(self):<br>>          CanvasIcon.__init__(self, cache=True)<br>> @@ -595,6 +598,7 @@ class CurrentActivityIcon(CanvasIcon, hippo.CanvasItem):<br>>          self._home_activity = home_activity<br>>          self._update()<br>>  <br>> +<br>>  class OwnerIcon(BuddyIcon):<br>>      __gtype_name__ = 'SugarFavoritesOwnerIcon'<br>>  <br>> @@ -602,6 +606,7 @@ class OwnerIcon(BuddyIcon):<br>>          'register-activate' : (gobject.SIGNAL_RUN_FIRST,<br>>                                  gobject.TYPE_NONE, ([]))<br>>      }<br>> +<br>>      def __init__(self, size):<br>>          BuddyIcon.__init__(self, buddy=get_owner_instance(), size=size)<br>>  <br>> @@ -634,6 +639,7 @@ class OwnerIcon(BuddyIcon):<br>>      def remove_register_menu(self):<br>>          self.palette.menu.remove(self._register_menu)<br>>  <br>> +<br>>  class FavoritesSetting(object):<br>>  <br>>      _FAVORITES_KEY = "/desktop/sugar/desktop/favorites_layout"<br>> diff --git a/src/jarabe/desktop/friendview.py b/src/jarabe/desktop/friendview.py<br>> index 53b8f5e..8dab35f 100644<br>> --- a/src/jarabe/desktop/friendview.py<br>> +++ b/src/jarabe/desktop/friendview.py<br>> @@ -23,6 +23,7 @@ from sugar.graphics import style<br>>  from jarabe.view.buddyicon import BuddyIcon<br>>  from jarabe.model import bundleregistry<br>>  <br>> +<br>>  class FriendView(hippo.CanvasBox):<br>>      def __init__(self, buddy, **kwargs):<br>>          hippo.CanvasBox.__init__(self, **kwargs)<br>> @@ -81,4 +82,3 @@ class FriendView(hippo.CanvasBox):<br>>      def __buddy_notify_color_cb(self, buddy, pspec):<br>>          # TODO: shouldn't this change self._buddy_icon instead?<br>>          self._activity_icon.props.xo_color = buddy.props.color<br>> -<br>> diff --git a/src/jarabe/desktop/grid.py b/src/jarabe/desktop/grid.py<br>> index f3412c9..319ff38 100644<br>> --- a/src/jarabe/desktop/grid.py<br>> +++ b/src/jarabe/desktop/grid.py<br>> @@ -22,17 +22,20 @@ import gtk<br>>  <br>>  from sugar import _sugarext<br>>  <br>> +<br>>  _PLACE_TRIALS = 20<br>>  _MAX_WEIGHT = 255<br>>  _REFRESH_RATE = 200<br>>  _MAX_COLLISIONS_PER_REFRESH = 20<br>>  <br>> +<br>>  class Grid(_sugarext.Grid):<br>>      __gsignals__ = {<br>>          'child-changed' : (gobject.SIGNAL_RUN_FIRST,<br>>                             gobject.TYPE_NONE,<br>>                             ([gobject.TYPE_PYOBJECT]))<br>>      }<br>> +<br>>      def __init__(self, width, height):<br>>          gobject.GObject.__init__(self)<br>>  <br>> diff --git a/src/jarabe/desktop/groupbox.py b/src/jarabe/desktop/groupbox.py<br>> index 89043fe..8172f83 100644<br>> --- a/src/jarabe/desktop/groupbox.py<br>> +++ b/src/jarabe/desktop/groupbox.py<br>> @@ -30,8 +30,10 @@ from jarabe.model import friends<br>>  from jarabe.desktop.friendview import FriendView<br>>  from jarabe.desktop.spreadlayout import SpreadLayout<br>>  <br>> +<br>>  class GroupBox(hippo.Canvas):<br>>      __gtype_name__ = 'SugarGroupBox'<br>> +<br>>      def __init__(self):<br>>          logging.debug("STARTUP: Loading the group view")<br>>  <br>> diff --git a/src/jarabe/desktop/homebox.py b/src/jarabe/desktop/homebox.py<br>> index 85279ff..beaaf41 100644<br>> --- a/src/jarabe/desktop/homebox.py<br>> +++ b/src/jarabe/desktop/homebox.py<br>> @@ -30,11 +30,13 @@ from sugar.graphics.icon import Icon<br>>  from jarabe.desktop import favoritesview<br>>  from jarabe.desktop.activitieslist import ActivitiesList<br>>  <br>> +<br>>  _FAVORITES_VIEW = 0<br>>  _LIST_VIEW = 1<br>>  <br>>  _AUTOSEARCH_TIMEOUT = 1000<br>>  <br>> +<br>>  class HomeBox(gtk.VBox):<br>>      __gtype_name__ = 'SugarHomeBox'<br>>  <br>> @@ -144,6 +146,7 @@ class HomeBox(gtk.VBox):<br>>      def set_resume_mode(self, resume_mode):<br>>          self._favorites_view.set_resume_mode(resume_mode)<br>>  <br>> +<br>>  class HomeToolbar(gtk.Toolbar):<br>>      __gtype_name__ = 'SugarHomeToolbar'<br>>  <br>> @@ -246,6 +249,7 @@ class HomeToolbar(gtk.Toolbar):<br>>          self.search_entry.activate()<br>>          return False<br>>  <br>> +<br>>  class FavoritesButton(RadioToolButton):<br>>      __gtype_name__ = 'SugarFavoritesButton'<br>>  <br>> @@ -295,4 +299,3 @@ class FavoritesButton(RadioToolButton):<br>>      def _update_icon(self):<br>>          self.props.named_icon = favoritesview.LAYOUT_MAP[self._layout]\<br>>                                  .icon_name<br>> -<br>> diff --git a/src/jarabe/desktop/homewindow.py b/src/jarabe/desktop/homewindow.py<br>> index ae970be..a2ea688 100644<br>> --- a/src/jarabe/desktop/homewindow.py<br>> +++ b/src/jarabe/desktop/homewindow.py<br>> @@ -28,6 +28,7 @@ from jarabe.desktop.transitionbox import TransitionBox<br>>  from jarabe.model.shell import ShellModel<br>>  from jarabe.model import shell<br>>  <br>> +<br>>  _HOME_PAGE       = 0<br>>  _GROUP_PAGE      = 1<br>>  _MESH_PAGE       = 2<br>> @@ -192,4 +193,3 @@ def get_instance():<br>>      if not _instance:<br>>          _instance = HomeWindow()<br>>      return _instance<br>> -<br>> diff --git a/src/jarabe/desktop/keydialog.py b/src/jarabe/desktop/keydialog.py<br>> index a83f77b..63099e2 100644<br>> --- a/src/jarabe/desktop/keydialog.py<br>> +++ b/src/jarabe/desktop/keydialog.py<br>> @@ -24,6 +24,7 @@ import dbus<br>>  from jarabe.model import network<br>>  from jarabe.model.network import Secrets<br>>  <br>> +<br>>  IW_AUTH_ALG_OPEN_SYSTEM = 'open'<br>>  IW_AUTH_ALG_SHARED_KEY  = 'shared'<br>>  <br>> @@ -39,6 +40,7 @@ def string_is_hex(key):<br>>              is_hex = False<br>>      return is_hex<br>>  <br>> +<br>>  def string_is_ascii(string):<br>>      try:<br>>          string.encode('ascii')<br>> @@ -46,12 +48,14 @@ def string_is_ascii(string):<br>>      except UnicodeEncodeError:<br>>          return False<br>>  <br>> +<br>>  def string_to_hex(passphrase):<br>>      key = ''<br>>      for c in passphrase:<br>>          key += '%02x' % ord(c)<br>>      return key<br>>  <br>> +<br>>  def hash_passphrase(passphrase):<br>>      # passphrase must have a length of 64<br>>      if len(passphrase) > 64:<br>> @@ -62,11 +66,13 @@ def hash_passphrase(passphrase):<br>>      passphrase = hashlib.md5(passphrase).digest()<br>>      return string_to_hex(passphrase)[:26]<br>>  <br>> +<br>>  class CanceledKeyRequestError(dbus.DBusException):<br>>      def __init__(self):<br>>          dbus.DBusException.__init__(self)<br>>          self._dbus_error_name = network.NM_SETTINGS_IFACE + '.CanceledError'<br>>  <br>> +<br>>  class KeyDialog(gtk.Dialog):<br>>      def __init__(self, ssid, flags, wpa_flags, rsn_flags, dev_caps, settings,<br>>                   response):<br>> @@ -211,6 +217,7 @@ class WEPKeyDialog(KeyDialog):<br>>  <br>>          self.set_response_sensitive(gtk.RESPONSE_OK, valid)<br>>  <br>> +<br>>  class WPAKeyDialog(KeyDialog):<br>>      def __init__(self, ssid, flags, wpa_flags, rsn_flags, dev_caps, settings,<br>>                   response):<br>> @@ -283,6 +290,7 @@ class WPAKeyDialog(KeyDialog):<br>>          self.set_response_sensitive(gtk.RESPONSE_OK, valid)<br>>          return False<br>>  <br>> +<br>>  def create(ssid, flags, wpa_flags, rsn_flags, dev_caps, settings, response):<br>>      if wpa_flags == network.NM_802_11_AP_SEC_NONE and \<br>>              rsn_flags == network.NM_802_11_AP_SEC_NONE:<br>> @@ -296,9 +304,11 @@ def create(ssid, flags, wpa_flags, rsn_flags, dev_caps, settings, response):<br>>      key_dialog.connect("destroy", _key_dialog_destroy_cb)<br>>      key_dialog.show_all()<br>>  <br>> +<br>>  def _key_dialog_destroy_cb(key_dialog, data=None):<br>>      _key_dialog_response_cb(key_dialog, gtk.RESPONSE_CANCEL)<br>>  <br>> +<br>>  def _key_dialog_response_cb(key_dialog, response_id):<br>>      response = key_dialog.get_response_object()<br>>      secrets = None<br>> @@ -316,4 +326,3 @@ def _key_dialog_response_cb(key_dialog, response_id):<br>>          raise RuntimeError("Unhandled key dialog response %d" % response_id)<br>>  <br>>      key_dialog.destroy()<br>> -<br>> diff --git a/src/jarabe/desktop/meshbox.py b/src/jarabe/desktop/meshbox.py<br>> index 18e3b1c..ededa6d 100644<br>> --- a/src/jarabe/desktop/meshbox.py<br>> +++ b/src/jarabe/desktop/meshbox.py<br>> @@ -47,6 +47,7 @@ from jarabe.model.olpcmesh import OlpcMeshManager<br>>  from jarabe.model.adhoc import get_adhoc_manager_instance<br>>  from jarabe.journal import misc<br>>  <br>> +<br>>  _NM_SERVICE = 'org.freedesktop.NetworkManager'<br>>  _NM_IFACE = 'org.freedesktop.NetworkManager'<br>>  _NM_PATH = '/org/freedesktop/NetworkManager'<br>> @@ -228,6 +229,7 @@ class DeviceObserver(gobject.GObject):<br>>          'access-point-removed': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,<br>>                                   ([gobject.TYPE_PYOBJECT]))<br>>      }<br>> +<br>>      def __init__(self, device):<br>>          gobject.GObject.__init__(self)<br>>          self._bus = dbus.SystemBus()<br>> diff --git a/src/jarabe/desktop/networkviews.py b/src/jarabe/desktop/networkviews.py<br>> index 87f182f..8cd6303 100644<br>> --- a/src/jarabe/desktop/networkviews.py<br>> +++ b/src/jarabe/desktop/networkviews.py<br>> @@ -41,6 +41,7 @@ from jarabe.model.network import IP4Config<br>>  from jarabe.model.network import WirelessSecurity<br>>  from jarabe.model.adhoc import get_adhoc_manager_instance<br>>  <br>> +<br>>  _NM_SERVICE = 'org.freedesktop.NetworkManager'<br>>  _NM_IFACE = 'org.freedesktop.NetworkManager'<br>>  _NM_PATH = '/org/freedesktop/NetworkManager'<br>> @@ -438,6 +439,7 @@ class WirelessNetworkView(CanvasPulsingIcon):<br>>                                           path=self._device.object_path,<br>>                                           dbus_interface=_NM_WIRELESS_IFACE)<br>>  <br>> +<br>>  class SugarAdhocView(CanvasPulsingIcon):<br>>      """To mimic the mesh behavior on devices where mesh hardware is<br>>      not available we support the creation of an Ad-hoc network on<br>> @@ -712,4 +714,3 @@ class OlpcMeshView(CanvasPulsingIcon):<br>>                                           signal_name='PropertiesChanged',<br>>                                           path=device_object_path,<br>>                                           dbus_interface=_NM_OLPC_MESH_IFACE)<br>> -<br>> diff --git a/src/jarabe/desktop/schoolserver.py b/src/jarabe/desktop/schoolserver.py<br>> index f79711e..8dc7d71 100644<br>> --- a/src/jarabe/desktop/schoolserver.py<br>> +++ b/src/jarabe/desktop/schoolserver.py<br>> @@ -33,6 +33,7 @@ from sugar.profile import get_profile<br>>  REGISTER_URL = 'http://schoolserver:8080/'<br>>  REGISTER_TIMEOUT = 8<br>>  <br>> +<br>>  def generate_serial_number():<br>>      """  Generates a serial number based on 3 random uppercase letters<br>>      and the last 8 digits of the current unix seconds. """<br>> @@ -48,6 +49,7 @@ def generate_serial_number():<br>>  <br>>      return serial<br>>  <br>> +<br>>  def store_identifiers(serial_number, uuid, backup_url):<br>>      """  Stores the serial number, uuid and backup_url<br>>      in the identifier folder inside the profile directory<br>> @@ -75,6 +77,7 @@ def store_identifiers(serial_number, uuid, backup_url):<br>>      backup_url_file.write(backup_url)<br>>      backup_url_file.close()<br>>  <br>> +<br>>  class RegisterError(Exception):<br>>      pass<br>>  <br>> @@ -138,9 +141,11 @@ def register_laptop(url=REGISTER_URL):<br>>  <br>>      return True<br>>  <br>> +<br>>  def have_ofw_tree():<br>>      return os.path.exists('/ofw')<br>>  <br>> +<br>>  def read_ofw(path):<br>>      path = os.path.join('/ofw', path)<br>>      if not os.path.exists(path):<br>> diff --git a/src/jarabe/desktop/snowflakelayout.py b/src/jarabe/desktop/snowflakelayout.py<br>> index 5782cff..e4963ba 100644<br>> --- a/src/jarabe/desktop/snowflakelayout.py<br>> +++ b/src/jarabe/desktop/snowflakelayout.py<br>> @@ -21,11 +21,14 @@ import hippo<br>>  <br>>  from sugar.graphics import style<br>>  <br>> +<br>>  _BASE_DISTANCE = style.zoom(25)<br>>  _CHILDREN_FACTOR = style.zoom(3)<br>>  <br>> +<br>>  class SnowflakeLayout(gobject.GObject, hippo.CanvasLayout):<br>>      __gtype_name__ = 'SugarSnowflakeLayout'<br>> +<br>>      def __init__(self):<br>>          gobject.GObject.__init__(self)<br>>          self._nflakes = 0<br>> diff --git a/src/jarabe/desktop/spreadlayout.py b/src/jarabe/desktop/spreadlayout.py<br>> index ffc5bc7..9200361 100644<br>> --- a/src/jarabe/desktop/spreadlayout.py<br>> +++ b/src/jarabe/desktop/spreadlayout.py<br>> @@ -22,10 +22,13 @@ from sugar.graphics import style<br>>  <br>>  from jarabe.desktop.grid import Grid<br>>  <br>> +<br>>  _CELL_SIZE = 4.0<br>>  <br>> +<br>>  class SpreadLayout(gobject.GObject, hippo.CanvasLayout):<br>>      __gtype_name__ = 'SugarSpreadLayout'<br>> +<br>>      def __init__(self):<br>>          gobject.GObject.__init__(self)<br>>          self._box = None<br>> @@ -80,4 +83,3 @@ class SpreadLayout(gobject.GObject, hippo.CanvasLayout):<br>>  <br>>      def _grid_child_changed_cb(self, grid, child):<br>>          child.emit_request_changed()<br>> -<br>> diff --git a/src/jarabe/desktop/transitionbox.py b/src/jarabe/desktop/transitionbox.py<br>> index cf9e0d6..184f62c 100644<br>> --- a/src/jarabe/desktop/transitionbox.py<br>> +++ b/src/jarabe/desktop/transitionbox.py<br>> @@ -23,6 +23,7 @@ from sugar.graphics import animator<br>>  from jarabe.model.buddy import get_owner_instance<br>>  from jarabe.view.buddyicon import BuddyIcon<br>>  <br>> +<br>>  class _Animation(animator.Animation):<br>>      def __init__(self, icon, start_size, end_size):<br>>          animator.Animation.__init__(self, 0.0, 1.0)<br>> @@ -35,8 +36,10 @@ class _Animation(animator.Animation):<br>>          d = (self.end_size - self.start_size) * current<br>>          self._icon.props.size = self.start_size + d<br>>  <br>> +<br>>  class _Layout(gobject.GObject, hippo.CanvasLayout):<br>>      __gtype_name__ = 'SugarTransitionBoxLayout'<br>> +<br>>      def __init__(self):<br>>          gobject.GObject.__init__(self)<br>>          self._box = None<br>> @@ -60,6 +63,7 @@ class _Layout(gobject.GObject, hippo.CanvasLayout):<br>>                             y + (height - child_height) / 2,<br>>                             child_width, child_height, origin_changed)<br>>  <br>> +<br>>  class TransitionBox(hippo.Canvas):<br>>      __gtype_name__ = 'SugarTransitionBox'<br>>  <br>> diff --git a/src/jarabe/frame/__init__.py b/src/jarabe/frame/__init__.py<br>> index d7aec3d..b3e4b80 100644<br>> --- a/src/jarabe/frame/__init__.py<br>> +++ b/src/jarabe/frame/__init__.py<br>> @@ -16,8 +16,10 @@<br>>  <br>>  from jarabe.frame.frame import Frame<br>>  <br>> +<br>>  _view = None<br>>  <br>> +<br>>  def get_view():<br>>      global _view<br>>      if not _view:<br>> diff --git a/src/jarabe/frame/activitiestray.py b/src/jarabe/frame/activitiestray.py<br>> index 6bd2a1b..05891b4 100644<br>> --- a/src/jarabe/frame/activitiestray.py<br>> +++ b/src/jarabe/frame/activitiestray.py<br>> @@ -98,7 +98,6 @@ class ActivityButton(RadioToolButton):<br>>              self._icon.props.pulsing = False<br>>  <br>>  <br>> -<br>>  class InviteButton(ToolButton):<br>>      """Invite to shared activity"""<br>>      def __init__(self, invite):<br>> @@ -313,6 +312,7 @@ class ActivitiesTray(HTray):<br>>          self.add_item(button)<br>>          button.show()<br>>  <br>> +<br>>  class BaseTransferButton(ToolButton):<br>>      """Button with a notification attached<br>>      """<br>> @@ -349,6 +349,7 @@ class BaseTransferButton(ToolButton):<br>>                 filetransfer.FT_REASON_LOCAL_STOPPED:<br>>                  self.remove()<br>>  <br>> +<br>>  class IncomingTransferButton(BaseTransferButton):<br>>      """UI element representing an ongoing incoming file transfer<br>>      """<br>> @@ -429,6 +430,7 @@ class IncomingTransferButton(BaseTransferButton):<br>>      def __dismiss_clicked_cb(self, palette):<br>>          self.remove()<br>>  <br>> +<br>>  class OutgoingTransferButton(BaseTransferButton):<br>>      """UI element representing an ongoing outgoing file transfer<br>>      """<br>> @@ -464,6 +466,7 @@ class OutgoingTransferButton(BaseTransferButton):<br>>      def __dismiss_clicked_cb(self, palette):<br>>          self.remove()<br>>  <br>> +<br>>  class BaseTransferPalette(Palette):<br>>      """Base palette class for frame or notification icon for file transfers<br>>      """<br>> @@ -526,10 +529,12 @@ class BaseTransferPalette(Palette):<br>>          total = self._format_size(self.file_transfer.file_size)<br>>          self.progress_label.props.label = _('%s of %s') % (transferred, total)<br>>  <br>> +<br>>  class IncomingTransferPalette(BaseTransferPalette):<br>>      """Palette for frame or notification icon for incoming file transfers<br>>      """<br>>      __gtype_name__ = "SugarIncomingTransferPalette"<br>> +<br>>      def __init__(self, file_transfer):<br>>          BaseTransferPalette.__init__(self, file_transfer)<br>>  <br>> @@ -652,6 +657,7 @@ class IncomingTransferPalette(BaseTransferPalette):<br>>      def __dismiss_activate_cb(self, menu_item):<br>>          self.emit('dismiss-clicked')<br>>  <br>> +<br>>  class OutgoingTransferPalette(BaseTransferPalette):<br>>      """Palette for frame or notification icon for outgoing file transfers<br>>      """<br>> diff --git a/src/jarabe/frame/clipboardicon.py b/src/jarabe/frame/clipboardicon.py<br>> index 279db08..9c44408 100644<br>> --- a/src/jarabe/frame/clipboardicon.py<br>> +++ b/src/jarabe/frame/clipboardicon.py<br>> @@ -31,6 +31,7 @@ from jarabe.frame.frameinvoker import FrameWidgetInvoker<br>>  from jarabe.frame.notification import NotificationIcon<br>>  import jarabe.frame<br>>  <br>> +<br>>  class ClipboardIcon(RadioToolButton):<br>>      __gtype_name__ = 'SugarClipboardIcon'<br>>  <br>> diff --git a/src/jarabe/frame/clipboardmenu.py b/src/jarabe/frame/clipboardmenu.py<br>> index b998110..03c953b 100644<br>> --- a/src/jarabe/frame/clipboardmenu.py<br>> +++ b/src/jarabe/frame/clipboardmenu.py<br>> @@ -35,6 +35,7 @@ from jarabe.frame import clipboard<br>>  from jarabe.journal import misc<br>>  from jarabe.model import bundleregistry<br>>  <br>> +<br>>  class ClipboardMenu(Palette):<br>>  <br>>      def __init__(self, cb_object):<br>> diff --git a/src/jarabe/frame/clipboardobject.py b/src/jarabe/frame/clipboardobject.py<br>> index e9403f9..90f64e7 100644<br>> --- a/src/jarabe/frame/clipboardobject.py<br>> +++ b/src/jarabe/frame/clipboardobject.py<br>> @@ -24,6 +24,7 @@ from gettext import gettext as _<br>>  from sugar import mime<br>>  from sugar.bundle.activitybundle import ActivityBundle<br>>  <br>> +<br>>  class ClipboardObject(object):<br>>  <br>>      def __init__(self, object_path, name):<br>> @@ -114,6 +115,7 @@ class ClipboardObject(object):<br>>  <br>>          return format_<br>>  <br>> +<br>>  class Format(object):<br>>  <br>>      def __init__(self, mime_type, data, on_disk):<br>> diff --git a/src/jarabe/frame/clipboardpanelwindow.py b/src/jarabe/frame/clipboardpanelwindow.py<br>> index ac324f4..f7a28a6 100644<br>> --- a/src/jarabe/frame/clipboardpanelwindow.py<br>> +++ b/src/jarabe/frame/clipboardpanelwindow.py<br>> @@ -25,6 +25,7 @@ from jarabe.frame.clipboardtray import ClipboardTray<br>>  <br>>  from jarabe.frame import clipboard<br>>  <br>> +<br>>  class ClipboardPanelWindow(FrameWindow):<br>>      def __init__(self, frame, orientation):<br>>          FrameWindow.__init__(self, orientation)<br>> @@ -100,4 +101,3 @@ class ClipboardPanelWindow(FrameWindow):<br>>                                           selection.type,<br>>                                           selection.data,<br>>                                           on_disk=False)<br>> -<br>> diff --git a/src/jarabe/frame/clipboardtray.py b/src/jarabe/frame/clipboardtray.py<br>> index 8beb6a8..40a1f65 100644<br>> --- a/src/jarabe/frame/clipboardtray.py<br>> +++ b/src/jarabe/frame/clipboardtray.py<br>> @@ -27,6 +27,7 @@ from sugar.graphics import style<br>>  from jarabe.frame import clipboard<br>>  from jarabe.frame.clipboardicon import ClipboardIcon<br>>  <br>> +<br>>  class _ContextMap(object):<br>>      """Maps a drag context to the clipboard object involved in the dragging."""<br>>      def __init__(self):<br>> @@ -56,6 +57,7 @@ class _ContextMap(object):<br>>      def has_context(self, context):<br>>          return context in self._context_map<br>>  <br>> +<br>>  class ClipboardTray(tray.VTray):<br>>  <br>>      MAX_ITEMS = gtk.gdk.screen_height() / style.GRID_CELL_SIZE - 2<br>> @@ -213,4 +215,3 @@ class ClipboardTray(tray.VTray):<br>>              return True<br>>          else:<br>>              return False<br>> -<br>> diff --git a/src/jarabe/frame/devicestray.py b/src/jarabe/frame/devicestray.py<br>> index 72affe3..1acde21 100644<br>> --- a/src/jarabe/frame/devicestray.py<br>> +++ b/src/jarabe/frame/devicestray.py<br>> @@ -23,6 +23,7 @@ from sugar.graphics import tray<br>>  <br>>  from jarabe import config<br>>  <br>> +<br>>  class DevicesTray(tray.HTray):<br>>      def __init__(self):<br>>          tray.HTray.__init__(self, align=tray.ALIGN_TO_END)<br>> diff --git a/src/jarabe/frame/eventarea.py b/src/jarabe/frame/eventarea.py<br>> index 166aaf5..cdd6f97 100644<br>> --- a/src/jarabe/frame/eventarea.py<br>> +++ b/src/jarabe/frame/eventarea.py<br>> @@ -19,8 +19,10 @@ import gobject<br>>  import wnck<br>>  import gconf<br>>  <br>> +<br>>  _MAX_DELAY = 1000<br>>  <br>> +<br>>  class EventArea(gobject.GObject):<br>>      __gsignals__ = {<br>>          'enter': (gobject.SIGNAL_RUN_FIRST,<br>> diff --git a/src/jarabe/frame/frame.py b/src/jarabe/frame/frame.py<br>> index 7dde55b..39dd31e 100644<br>> --- a/src/jarabe/frame/frame.py<br>> +++ b/src/jarabe/frame/frame.py<br>> @@ -35,6 +35,7 @@ from jarabe.frame.clipboardpanelwindow import ClipboardPanelWindow<br>>  from jarabe.frame.notification import NotificationIcon, NotificationWindow<br>>  from jarabe.model import notifications<br>>  <br>> +<br>>  TOP_RIGHT = 0<br>>  TOP_LEFT = 1<br>>  BOTTOM_RIGHT = 2<br>> @@ -43,6 +44,7 @@ BOTTOM_LEFT = 3<br>>  _FRAME_HIDING_DELAY = 500<br>>  _NOTIFICATION_DURATION = 5000<br>>  <br>> +<br>>  class _Animation(animator.Animation):<br>>      def __init__(self, frame, end):<br>>          start = frame.current_position<br>> @@ -52,6 +54,7 @@ class _Animation(animator.Animation):<br>>      def next_frame(self, current):<br>>          self._frame.move(current)<br>>  <br>> +<br>>  class _MouseListener(object):<br>>      def __init__(self, frame):<br>>          self._frame = frame<br>> @@ -79,6 +82,7 @@ class _MouseListener(object):<br>>          self._hide_sid = gobject.timeout_add(<br>>                    _FRAME_HIDING_DELAY, self._hide_frame_timeout_cb)<br>>  <br>> +<br>>  class _KeyListener(object):<br>>      def __init__(self, frame):<br>>          self._frame = frame<br>> @@ -90,6 +94,7 @@ class _KeyListener(object):<br>>          else:<br>>              self._frame.show(Frame.MODE_KEYBOARD)<br>>  <br>> +<br>>  class Frame(object):<br>>      MODE_MOUSE    = 0<br>>      MODE_KEYBOARD = 1<br>> @@ -348,4 +353,3 @@ class Frame(object):<br>>          # Do nothing for now. Our notification UI is so simple, there's no<br>>          # point yet.<br>>          pass<br>> -<br>> diff --git a/src/jarabe/frame/frameinvoker.py b/src/jarabe/frame/frameinvoker.py<br>> index e4a13e1..a4abfa8 100644<br>> --- a/src/jarabe/frame/frameinvoker.py<br>> +++ b/src/jarabe/frame/frameinvoker.py<br>> @@ -19,6 +19,7 @@ import gtk<br>>  from sugar.graphics import style<br>>  from sugar.graphics.palette import WidgetInvoker<br>>  <br>> +<br>>  def _get_screen_area():<br>>      frame_thickness = style.GRID_CELL_SIZE<br>>  <br>> @@ -28,6 +29,7 @@ def _get_screen_area():<br>>  <br>>      return gtk.gdk.Rectangle(x, y, width, height)<br>>  <br>> +<br>>  class FrameWidgetInvoker(WidgetInvoker):<br>>      def __init__(self, widget):<br>>          WidgetInvoker.__init__(self, widget, widget.child)<br>> diff --git a/src/jarabe/frame/framewindow.py b/src/jarabe/frame/framewindow.py<br>> index a7d8fe7..c77e76c 100644<br>> --- a/src/jarabe/frame/framewindow.py<br>> +++ b/src/jarabe/frame/framewindow.py<br>> @@ -19,6 +19,7 @@ import hippo<br>>  <br>>  from sugar.graphics import style<br>>  <br>> +<br>>  class FrameWindow(gtk.Window):<br>>      __gtype_name__ = 'SugarFrameWindow'<br>>  <br>> diff --git a/src/jarabe/frame/friendstray.py b/src/jarabe/frame/friendstray.py<br>> index 141505b..b387e06 100644<br>> --- a/src/jarabe/frame/friendstray.py<br>> +++ b/src/jarabe/frame/friendstray.py<br>> @@ -24,6 +24,7 @@ from jarabe.model import shell<br>>  from jarabe.model.buddy import get_owner_instance<br>>  from jarabe.model import neighborhood<br>>  <br>> +<br>>  class FriendIcon(TrayIcon):<br>>      def __init__(self, buddy):<br>>          TrayIcon.__init__(self, icon_name='computer-xo',<br>> @@ -34,6 +35,7 @@ class FriendIcon(TrayIcon):<br>>          self.palette.props.icon_visible = False<br>>          self.palette.set_group_id('frame')<br>>  <br>> +<br>>  class FriendsTray(VTray):<br>>      def __init__(self):<br>>          VTray.__init__(self)<br>> diff --git a/src/jarabe/frame/notification.py b/src/jarabe/frame/notification.py<br>> index 83dc27e..fceb41e 100644<br>> --- a/src/jarabe/frame/notification.py<br>> +++ b/src/jarabe/frame/notification.py<br>> @@ -22,6 +22,7 @@ from sugar.graphics.xocolor import XoColor<br>>  <br>>  from jarabe.view.pulsingicon import PulsingIcon<br>>  <br>> +<br>>  class NotificationIcon(gtk.EventBox):<br>>      __gtype_name__ = 'SugarNotificationIcon'<br>>  <br>> @@ -80,6 +81,7 @@ class NotificationIcon(gtk.EventBox):<br>>  <br>>      palette = property(_get_palette, _set_palette)<br>>  <br>> +<br>>  class NotificationWindow(gtk.Window):<br>>      __gtype_name__ = 'SugarNotificationWindow'<br>>  <br>> @@ -97,4 +99,3 @@ class NotificationWindow(gtk.Window):<br>>  <br>>          color = gtk.gdk.color_parse(style.COLOR_TOOLBAR_GREY.get_html())<br>>          self.modify_bg(gtk.STATE_NORMAL, color)<br>> -<br>> diff --git a/src/jarabe/frame/zoomtoolbar.py b/src/jarabe/frame/zoomtoolbar.py<br>> index 2ed3c54..6c10c61 100644<br>> --- a/src/jarabe/frame/zoomtoolbar.py<br>> +++ b/src/jarabe/frame/zoomtoolbar.py<br>> @@ -26,6 +26,7 @@ from sugar.graphics.radiotoolbutton import RadioToolButton<br>>  from jarabe.frame.frameinvoker import FrameWidgetInvoker<br>>  from jarabe.model import shell<br>>  <br>> +<br>>  class ZoomToolbar(gtk.Toolbar):<br>>      def __init__(self):<br>>          gtk.Toolbar.__init__(self)<br>> @@ -86,4 +87,3 @@ class ZoomToolbar(gtk.Toolbar):<br>>              self._activity_button.props.active = True<br>>          else:<br>>              raise ValueError('Invalid zoom level: %r' % (new_level))<br>> -<br>> diff --git a/src/jarabe/intro/__init__.py b/src/jarabe/intro/__init__.py<br>> index ca4f64d..d2932f1 100644<br>> --- a/src/jarabe/intro/__init__.py<br>> +++ b/src/jarabe/intro/__init__.py<br>> @@ -8,6 +8,7 @@ from sugar.profile import get_profile<br>>  from jarabe.intro.window import IntroWindow<br>>  from jarabe.intro.window import create_profile<br>>  <br>> +<br>>  def check_profile():<br>>      profile = get_profile()<br>>  <br>> diff --git a/src/jarabe/intro/colorpicker.py b/src/jarabe/intro/colorpicker.py<br>> index a939857..997199b 100644<br>> --- a/src/jarabe/intro/colorpicker.py<br>> +++ b/src/jarabe/intro/colorpicker.py<br>> @@ -20,6 +20,7 @@ from sugar.graphics.icon import CanvasIcon<br>>  from sugar.graphics import style<br>>  from sugar.graphics.xocolor import XoColor<br>>  <br>> +<br>>  class ColorPicker(hippo.CanvasBox, hippo.CanvasItem):<br>>      def __init__(self, **kwargs):<br>>          hippo.CanvasBox.__init__(self, **kwargs)<br>> diff --git a/src/jarabe/intro/window.py b/src/jarabe/intro/window.py<br>> index 35c0cda..4c8d224 100644<br>> --- a/src/jarabe/intro/window.py<br>> +++ b/src/jarabe/intro/window.py<br>> @@ -32,8 +32,10 @@ from sugar.graphics.xocolor import XoColor<br>>  <br>>  from jarabe.intro import colorpicker<br>>  <br>> +<br>>  _BACKGROUND_COLOR = style.COLOR_WHITE<br>>  <br>> +<br>>  def create_profile(name, color=None, pixbuf=None):<br>>      if not pixbuf:<br>>          path = os.path.join(os.path.dirname(__file__), 'default-picture.png')<br>> @@ -60,6 +62,7 @@ def create_profile(name, color=None, pixbuf=None):<br>>      else:<br>>          logging.error("Keypair exists, skip generation.")<br>>  <br>> +<br>>  class _Page(hippo.CanvasBox):<br>>      __gproperties__ = {<br>>          'valid'    : (bool, None, None, False,<br>> @@ -81,6 +84,7 @@ class _Page(hippo.CanvasBox):<br>>      def activate(self):<br>>          pass<br>>  <br>> +<br>>  class _NamePage(_Page):<br>>      def __init__(self, intro):<br>>          _Page.__init__(self, xalign=hippo.ALIGNMENT_CENTER,<br>> @@ -118,6 +122,7 @@ class _NamePage(_Page):<br>>      def activate(self):<br>>          self._entry.props.widget.grab_focus()<br>>  <br>> +<br>>  class _ColorPage(_Page):<br>>      def __init__(self, **kwargs):<br>>          _Page.__init__(self, xalign=hippo.ALIGNMENT_CENTER,<br>> @@ -138,6 +143,7 @@ class _ColorPage(_Page):<br>>      def get_color(self):<br>>          return self._cp.get_color()<br>>  <br>> +<br>>  class _IntroBox(hippo.CanvasBox):<br>>      __gsignals__ = {<br>>          'done': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,<br>> @@ -255,6 +261,7 @@ class _IntroBox(hippo.CanvasBox):<br>>  <br>>          self.emit('done', name, color)<br>>  <br>> +<br>>  class IntroWindow(gtk.Window):<br>>      def __init__(self):<br>>          gtk.Window.__init__(self)<br>> diff --git a/src/jarabe/journal/detailview.py b/src/jarabe/journal/detailview.py<br>> index b4a2339..6a04a44 100644<br>> --- a/src/jarabe/journal/detailview.py<br>> +++ b/src/jarabe/journal/detailview.py<br>> @@ -27,6 +27,7 @@ from sugar.graphics.icon import CanvasIcon<br>>  from jarabe.journal.expandedentry import ExpandedEntry<br>>  from jarabe.journal import model<br>>  <br>> +<br>>  class DetailView(gtk.VBox):<br>>      __gtype_name__ = 'DetailView'<br>>  <br>> @@ -84,6 +85,7 @@ class DetailView(gtk.VBox):<br>>      metadata = gobject.property(<br>>              type=object, getter=get_metadata, setter=set_metadata)<br>>  <br>> +<br>>  class BackBar(hippo.CanvasBox):<br>>      def __init__(self):<br>>          hippo.CanvasBox.__init__(self,<br>> diff --git a/src/jarabe/journal/expandedentry.py b/src/jarabe/journal/expandedentry.py<br>> index 725c0f9..9271313 100644<br>> --- a/src/jarabe/journal/expandedentry.py<br>> +++ b/src/jarabe/journal/expandedentry.py<br>> @@ -36,6 +36,7 @@ from jarabe.journal.palettes import ObjectPalette, BuddyPalette<br>>  from jarabe.journal import misc<br>>  from jarabe.journal import model<br>>  <br>> +<br>>  class Separator(hippo.CanvasBox, hippo.CanvasItem):<br>>      def __init__(self, orientation):<br>>          hippo.CanvasBox.__init__(self,<br>> @@ -46,6 +47,7 @@ class Separator(hippo.CanvasBox, hippo.CanvasItem):<br>>          else:<br>>              self.props.box_height = style.LINE_WIDTH<br>>  <br>> +<br>>  class BuddyList(hippo.CanvasBox):<br>>      def __init__(self, buddies):<br>>          hippo.CanvasBox.__init__(self, xalign=hippo.ALIGNMENT_START,<br>> @@ -61,6 +63,7 @@ class BuddyList(hippo.CanvasBox):<br>>              hbox.append(icon)<br>>              self.append(hbox)<br>>  <br>> +<br>>  class ExpandedEntry(hippo.CanvasBox):<br>>      def __init__(self):<br>>          hippo.CanvasBox.__init__(self)<br>> diff --git a/src/jarabe/journal/journalactivity.py b/src/jarabe/journal/journalactivity.py<br>> index c0d792d..84a376f 100644<br>> --- a/src/jarabe/journal/journalactivity.py<br>> +++ b/src/jarabe/journal/journalactivity.py<br>> @@ -45,6 +45,7 @@ from jarabe.journal.objectchooser import ObjectChooser<br>>  from jarabe.journal.modalalert import ModalAlert<br>>  from jarabe.journal import model<br>>  <br>> +<br>>  J_DBUS_SERVICE = 'org.laptop.Journal'<br>>  J_DBUS_INTERFACE = 'org.laptop.Journal'<br>>  J_DBUS_PATH = '/org/laptop/Journal'<br>> @@ -105,6 +106,7 @@ class JournalActivityDBusService(dbus.service.Object):<br>>      def ObjectChooserCancelled(self, chooser_id):<br>>          pass<br>>  <br>> +<br>>  class JournalActivity(Window):<br>>      def __init__(self):<br>>          logging.debug("STARTUP: Loading the journal")<br>> @@ -369,6 +371,6 @@ def get_journal():<br>>          _journal.show()<br>>      return _journal<br>>  <br>> +<br>>  def start():<br>>      get_journal()<br>> -<br>> diff --git a/src/jarabe/journal/journalentrybundle.py b/src/jarabe/journal/journalentrybundle.py<br>> index 41777c7..9ce676e 100644<br>> --- a/src/jarabe/journal/journalentrybundle.py<br>> +++ b/src/jarabe/journal/journalentrybundle.py<br>> @@ -25,6 +25,7 @@ from sugar.bundle.bundle import Bundle, MalformedBundleException<br>>  <br>>  from jarabe.journal import model<br>>  <br>> +<br>>  class JournalEntryBundle(Bundle):<br>>      """A Journal entry bundle<br>>  <br>> @@ -91,4 +92,3 @@ class JournalEntryBundle(Bundle):<br>>      def is_installed(self):<br>>          # These bundles can be reinstalled as many times as desired.<br>>          return False<br>> -<br>> diff --git a/src/jarabe/journal/journaltoolbox.py b/src/jarabe/journal/journaltoolbox.py<br>> index c6bd0fb..08c8b2f 100644<br>> --- a/src/jarabe/journal/journaltoolbox.py<br>> +++ b/src/jarabe/journal/journaltoolbox.py<br>> @@ -43,6 +43,7 @@ from jarabe.model import bundleregistry<br>>  from jarabe.journal import misc<br>>  from jarabe.journal import model<br>>  <br>> +<br>>  _AUTOSEARCH_TIMEOUT = 1000<br>>  <br>>  _ACTION_ANYTIME = 0<br>> @@ -68,6 +69,7 @@ class MainToolbox(Toolbox):<br>>          self.add_toolbar(_('Search'), self.search_toolbar)<br>>          self.search_toolbar.show()<br>>  <br>> +<br>>  class SearchToolbar(gtk.Toolbar):<br>>      __gtype_name__ = 'SearchToolbar'<br>>  <br>> @@ -355,6 +357,7 @@ class SearchToolbar(gtk.Toolbar):<br>>          self._when_search_combo.set_active(0)<br>>          self._favorite_button.props.active = False<br>>  <br>> +<br>>  class DetailToolbox(Toolbox):<br>>      def __init__(self):<br>>          Toolbox.__init__(self)<br>> @@ -363,12 +366,14 @@ class DetailToolbox(Toolbox):<br>>          self.add_toolbar('', self.entry_toolbar)<br>>          self.entry_toolbar.show()<br>>  <br>> +<br>>  class EntryToolbar(gtk.Toolbar):<br>>      __gsignals__ = {<br>>          'volume-error': (gobject.SIGNAL_RUN_FIRST,<br>>                           gobject.TYPE_NONE,<br>>                           ([str, str]))<br>>          }<br>> +<br>>      def __init__(self):<br>>          gtk.Toolbar.__init__(self)<br>>  <br>> diff --git a/src/jarabe/journal/keepicon.py b/src/jarabe/journal/keepicon.py<br>> index 2c692c6..1253afc 100644<br>> --- a/src/jarabe/journal/keepicon.py<br>> +++ b/src/jarabe/journal/keepicon.py<br>> @@ -22,6 +22,7 @@ from sugar.graphics.icon import CanvasIcon<br>>  from sugar.graphics import style<br>>  from sugar.graphics.xocolor import XoColor<br>>  <br>> +<br>>  class KeepIcon(CanvasIcon):<br>>      def __init__(self, keep):<br>>          CanvasIcon.__init__(self, icon_name='emblem-favorite',<br>> diff --git a/src/jarabe/journal/listmodel.py b/src/jarabe/journal/listmodel.py<br>> index 3378350..fb50ea3 100644<br>> --- a/src/jarabe/journal/listmodel.py<br>> +++ b/src/jarabe/journal/listmodel.py<br>> @@ -29,10 +29,12 @@ from sugar import util<br>>  from jarabe.journal import model<br>>  from jarabe.journal import misc<br>>  <br>> +<br>>  DS_DBUS_SERVICE = 'org.laptop.sugar.DataStore'<br>>  DS_DBUS_INTERFACE = 'org.laptop.sugar.DataStore'<br>>  DS_DBUS_PATH = '/org/laptop/sugar/DataStore'<br>>  <br>> +<br>>  class ListModel(gtk.GenericTreeModel, gtk.TreeDragSource):<br>>      __gtype_name__ = 'JournalListModel'<br>>  <br>> @@ -219,4 +221,3 @@ class ListModel(gtk.GenericTreeModel, gtk.TreeDragSource):<br>>              return True<br>>  <br>>          return False<br>> -<br>> diff --git a/src/jarabe/journal/listview.py b/src/jarabe/journal/listview.py<br>> index 3d6281a..bca9f2c 100644<br>> --- a/src/jarabe/journal/listview.py<br>> +++ b/src/jarabe/journal/listview.py<br>> @@ -34,11 +34,13 @@ from jarabe.journal.palettes import ObjectPalette, BuddyPalette<br>>  from jarabe.journal import model<br>>  from jarabe.journal import misc<br>>  <br>> +<br>>  UPDATE_INTERVAL = 300<br>>  <br>>  MESSAGE_EMPTY_JOURNAL = 0<br>>  MESSAGE_NO_MATCH = 1<br>>  <br>> +<br>>  class TreeView(gtk.TreeView):<br>>      __gtype_name__ = 'JournalTreeView'<br>>  <br>> @@ -58,6 +60,7 @@ class TreeView(gtk.TreeView):<br>>              if tree_model is not None:<br>>                  tree_model.view_is_resizing = False<br>>  <br>> +<br>>  class BaseListView(gtk.Bin):<br>>      __gtype_name__ = 'JournalBaseListView'<br>>  <br>> @@ -460,6 +463,7 @@ class BaseListView(gtk.Bin):<br>>          self.update_dates()<br>>          return True<br>>  <br>> +<br>>  class ListView(BaseListView):<br>>      __gtype_name__ = 'JournalListView'<br>>  <br>> @@ -538,6 +542,7 @@ class ListView(BaseListView):<br>>      def __editing_canceled_cb(self, cell):<br>>          self.cell_title.props.editable = False<br>>  <br>> +<br>>  class CellRendererFavorite(CellRendererIcon):<br>>      __gtype_name__ = 'JournalCellRendererFavorite'<br>>  <br>> @@ -552,6 +557,7 @@ class CellRendererFavorite(CellRendererIcon):<br>>          self.props.prelit_stroke_color = style.COLOR_BUTTON_GREY.get_svg()<br>>          self.props.prelit_fill_color = style.COLOR_BUTTON_GREY.get_svg()<br>>  <br>> +<br>>  class CellRendererDetail(CellRendererIcon):<br>>      __gtype_name__ = 'JournalCellRendererDetail'<br>>  <br>> @@ -568,6 +574,7 @@ class CellRendererDetail(CellRendererIcon):<br>>          self.props.prelit_stroke_color = style.COLOR_TRANSPARENT.get_svg()<br>>          self.props.prelit_fill_color = style.COLOR_BLACK.get_svg()<br>>  <br>> +<br>>  class CellRendererActivityIcon(CellRendererIcon):<br>>      __gtype_name__ = 'JournalCellRendererActivityIcon'<br>>  <br>> @@ -610,6 +617,7 @@ class CellRendererActivityIcon(CellRendererIcon):<br>>      show_palette = gobject.property(type=bool, default=True,<br>>                                      setter=set_show_palette)<br>>  <br>> +<br>>  class CellRendererBuddy(CellRendererIcon):<br>>      __gtype_name__ = 'JournalCellRendererBuddy'<br>>  <br>> @@ -643,4 +651,3 @@ class CellRendererBuddy(CellRendererIcon):<br>>              self.props.xo_color = xo_color<br>>  <br>>      buddy = gobject.property(type=object, setter=set_buddy)<br>> -<br>> diff --git a/src/jarabe/journal/misc.py b/src/jarabe/journal/misc.py<br>> index 32a2847..31f14b2 100644<br>> --- a/src/jarabe/journal/misc.py<br>> +++ b/src/jarabe/journal/misc.py<br>> @@ -37,6 +37,7 @@ from jarabe.model import bundleregistry, shell<br>>  from jarabe.journal.journalentrybundle import JournalEntryBundle<br>>  from jarabe.journal import model<br>>  <br>> +<br>>  def _get_icon_for_mime(mime_type):<br>>      generic_types = mime.get_all_generic_types()<br>>      for generic_type in generic_types:<br>> @@ -52,6 +53,7 @@ def _get_icon_for_mime(mime_type):<br>>          if file_name is not None:<br>>              return file_name<br>>  <br>> +<br>>  def get_icon_name(metadata):<br>>      file_name = None<br>>  <br>> @@ -81,6 +83,7 @@ def get_icon_name(metadata):<br>>  <br>>      return file_name<br>>  <br>> +<br>>  def get_date(metadata):<br>>      """ Convert from a string in iso format to a more human-like format. """<br>>      if metadata.has_key('timestamp'):<br>> @@ -92,6 +95,7 @@ def get_date(metadata):<br>>      else:<br>>          return _('No date')<br>>  <br>> +<br>>  def get_bundle(metadata):<br>>      try:<br>>          if is_activity_bundle(metadata):<br>> @@ -120,6 +124,7 @@ def get_bundle(metadata):<br>>          logging.exception('Incorrect bundle')<br>>          return None<br>>  <br>> +<br>>  def _get_activities_for_mime(mime_type):<br>>      registry = bundleregistry.get_registry()<br>>      result = registry.get_activities_for_type(mime_type)<br>> @@ -130,6 +135,7 @@ def _get_activities_for_mime(mime_type):<br>>                      result.append(activity)<br>>      return result<br>>  <br>> +<br>>  def get_activities(metadata):<br>>      activities = []<br>>  <br>> @@ -148,6 +154,7 @@ def get_activities(metadata):<br>>  <br>>      return activities<br>>  <br>> +<br>>  def resume(metadata, bundle_id=None):<br>>      registry = bundleregistry.get_registry()<br>>  <br>> @@ -206,7 +213,6 @@ def resume(metadata, bundle_id=None):<br>>  <br>>          bundle = registry.get_bundle(bundle_id)<br>>  <br>> -<br>>          if metadata.get('mountpoint', '/') == '/':<br>>              object_id = metadata['uid']<br>>          else:<br>> @@ -215,6 +221,7 @@ def resume(metadata, bundle_id=None):<br>>          launch(bundle, activity_id=activity_id, object_id=object_id,<br>>                  color=get_icon_color(metadata))<br>>  <br>> +<br>>  def launch(bundle, activity_id=None, object_id=None, uri=None, color=None,<br>>             invited=False):<br>>      if activity_id is None or not activity_id:<br>> @@ -239,21 +246,26 @@ def launch(bundle, activity_id=None, object_id=None, uri=None, color=None,<br>>              object_id=object_id, uri=uri, invited=invited)<br>>      activityfactory.create(bundle, activity_handle)<br>>  <br>> +<br>>  def is_activity_bundle(metadata):<br>>      mime_type = metadata.get('mime_type', '')<br>>      return mime_type == ActivityBundle.MIME_TYPE or \<br>>             mime_type == ActivityBundle.DEPRECATED_MIME_TYPE<br>>  <br>> +<br>>  def is_content_bundle(metadata):<br>>      return metadata.get('mime_type', '') == ContentBundle.MIME_TYPE<br>>  <br>> +<br>>  def is_journal_bundle(metadata):<br>>      return metadata.get('mime_type', '') == JournalEntryBundle.MIME_TYPE<br>>  <br>> +<br>>  def is_bundle(metadata):<br>>      return is_activity_bundle(metadata) or is_content_bundle(metadata) or \<br>>              is_journal_bundle(metadata)<br>>  <br>> +<br>>  def get_icon_color(metadata):<br>>      if metadata is None or not 'icon-color' in metadata:<br>>          client = gconf.client_get_default()<br>> diff --git a/src/jarabe/journal/modalalert.py b/src/jarabe/journal/modalalert.py<br>> index c7c6a0a..c306b9e 100644<br>> --- a/src/jarabe/journal/modalalert.py<br>> +++ b/src/jarabe/journal/modalalert.py<br>> @@ -22,6 +22,7 @@ from sugar.graphics.icon import Icon<br>>  from sugar.graphics import style<br>>  from sugar.graphics.xocolor import XoColor<br>>  <br>> +<br>>  class ModalAlert(gtk.Window):<br>>  <br>>      __gtype_name__ = 'SugarModalAlert'<br>> @@ -94,4 +95,3 @@ class ModalAlert(gtk.Window):<br>>          '''The opener will listen on the destroy signal<br>>          '''<br>>          self.destroy()<br>> -<br>> diff --git a/src/jarabe/journal/model.py b/src/jarabe/journal/model.py<br>> index bbc3778..4a9a8c8 100644<br>> --- a/src/jarabe/journal/model.py<br>> +++ b/src/jarabe/journal/model.py<br>> @@ -32,6 +32,7 @@ from sugar import dispatch<br>>  from sugar import mime<br>>  from sugar import util<br>>  <br>> +<br>>  DS_DBUS_SERVICE = 'org.laptop.sugar.DataStore'<br>>  DS_DBUS_INTERFACE = 'org.laptop.sugar.DataStore'<br>>  DS_DBUS_PATH = '/org/laptop/sugar/DataStore'<br>> @@ -192,6 +193,7 @@ class BaseResultSet(object):<br>>  <br>>          return self._cache[self._position - self._offset]<br>>  <br>> +<br>>  class DatastoreResultSet(BaseResultSet):<br>>      """Encapsulates the result of a query on the datastore<br>>      """<br>> @@ -219,6 +221,7 @@ class DatastoreResultSet(BaseResultSet):<br>>  <br>>          return entries, total_count<br>>  <br>> +<br>>  class InplaceResultSet(BaseResultSet):<br>>      """Encapsulates the result of a query on a mount point<br>>      """<br>> @@ -350,6 +353,7 @@ class InplaceResultSet(BaseResultSet):<br>>              except Exception:<br>>                  logging.exception('Error reading file %r', full_path)<br>>  <br>> +<br>>  def _get_file_metadata(path, stat):<br>>      client = gconf.client_get_default()<br>>      return {'uid': path,<br>> @@ -376,15 +380,19 @@ def _get_datastore():<br>>  <br>>      return _datastore<br>>  <br>> +<br>>  def _datastore_created_cb(object_id):<br>>      created.send(None, object_id=object_id)<br>>  <br>> +<br>>  def _datastore_updated_cb(object_id):<br>>      updated.send(None, object_id=object_id)<br>>  <br>> +<br>>  def _datastore_deleted_cb(object_id):<br>>      deleted.send(None, object_id=object_id)<br>>  <br>> +<br>>  def find(query_, page_size):<br>>      """Returns a ResultSet<br>>      """<br>> @@ -399,6 +407,7 @@ def find(query_, page_size):<br>>      else:<br>>          return InplaceResultSet(query, page_size, mount_points[0])<br>>  <br>> +<br>>  def _get_mount_point(path):<br>>      dir_path = os.path.dirname(path)<br>>      while True:<br>> @@ -407,6 +416,7 @@ def _get_mount_point(path):<br>>          else:<br>>              dir_path = dir_path.rsplit(os.sep, 1)[0]<br>>  <br>> +<br>>  def get(object_id):<br>>      """Returns the metadata for an object<br>>      """<br>> @@ -419,6 +429,7 @@ def get(object_id):<br>>          metadata['mountpoint'] = '/'<br>>      return metadata<br>>  <br>> +<br>>  def get_file(object_id):<br>>      """Returns the file for an object<br>>      """<br>> @@ -433,6 +444,7 @@ def get_file(object_id):<br>>          else:<br>>              return None<br>>  <br>> +<br>>  def get_file_size(object_id):<br>>      """Return the file size for an object<br>>      """<br>> @@ -448,12 +460,14 @@ def get_file_size(object_id):<br>>  <br>>      return 0<br>>  <br>> +<br>>  def get_unique_values(key):<br>>      """Returns a list with the different values a property has taken<br>>      """<br>>      empty_dict = dbus.Dictionary({}, signature='ss')<br>>      return _get_datastore().get_uniquevaluesfor(key, empty_dict)<br>>  <br>> +<br>>  def delete(object_id):<br>>      """Removes an object from persistent storage<br>>      """<br>> @@ -463,6 +477,7 @@ def delete(object_id):<br>>      else:<br>>          _get_datastore().delete(object_id)<br>>  <br>> +<br>>  def copy(metadata, mount_point):<br>>      """Copies an object to another mount point<br>>      """<br>> @@ -474,6 +489,7 @@ def copy(metadata, mount_point):<br>>  <br>>      return write(metadata, file_path, transfer_ownership=False)<br>>  <br>> +<br>>  def write(metadata, file_path='', update_mtime=True, transfer_ownership=True):<br>>      """Creates or updates an entry for that id<br>>      """<br>> @@ -508,6 +524,7 @@ def write(metadata, file_path='', update_mtime=True, transfer_ownership=True):<br>>  <br>>      return object_id<br>>  <br>> +<br>>  def _get_file_name(title, mime_type):<br>>      file_name = title<br>>  <br>> @@ -532,6 +549,7 @@ def _get_file_name(title, mime_type):<br>>  <br>>      return file_name<br>>  <br>> +<br>>  def _get_unique_file_name(mount_point, file_name):<br>>      if os.path.exists(os.path.join(mount_point, file_name)):<br>>          i = 1<br>> @@ -544,6 +562,7 @@ def _get_unique_file_name(mount_point, file_name):<br>>  <br>>      return file_name<br>>  <br>> +<br>>  def is_editable(metadata):<br>>      mountpoint = metadata.get('mountpoint', '/')<br>>      return mountpoint == '/'<br>> diff --git a/src/jarabe/journal/objectchooser.py b/src/jarabe/journal/objectchooser.py<br>> index 16e6c4b..97139f8 100644<br>> --- a/src/jarabe/journal/objectchooser.py<br>> +++ b/src/jarabe/journal/objectchooser.py<br>> @@ -29,6 +29,7 @@ from jarabe.journal.listmodel import ListModel<br>>  from jarabe.journal.journaltoolbox import SearchToolbar<br>>  from jarabe.journal.volumestoolbar import VolumesToolbar<br>>  <br>> +<br>>  class ObjectChooser(gtk.Window):<br>>  <br>>      __gtype_name__ = 'ObjectChooser'<br>> @@ -136,6 +137,7 @@ class ObjectChooser(gtk.Window):<br>>          visible = event.state == gtk.gdk.VISIBILITY_FULLY_OBSCURED<br>>          self._list_view.set_is_visible(visible)<br>>  <br>> +<br>>  class TitleBox(VolumesToolbar):<br>>      __gtype_name__ = 'TitleBox'<br>>  <br>> @@ -162,6 +164,7 @@ class TitleBox(VolumesToolbar):<br>>          self.insert(tool_item, -1)<br>>          tool_item.show()<br>>  <br>> +<br>>  class ChooserListView(BaseListView):<br>>      __gtype_name__ = 'ChooserListView'<br>>  <br>> @@ -196,4 +199,3 @@ class ChooserListView(BaseListView):<br>>          self.emit('entry-activated', uid)<br>>  <br>>          return False<br>> -<br>> diff --git a/src/jarabe/journal/palettes.py b/src/jarabe/journal/palettes.py<br>> index 7c3e5ff..cd8c628 100644<br>> --- a/src/jarabe/journal/palettes.py<br>> +++ b/src/jarabe/journal/palettes.py<br>> @@ -35,6 +35,7 @@ from jarabe.model import mimeregistry<br>>  from jarabe.journal import misc<br>>  from jarabe.journal import model<br>>  <br>> +<br>>  class ObjectPalette(Palette):<br>>  <br>>      __gtype_name__ = 'ObjectPalette'<br>> @@ -147,6 +148,7 @@ class ObjectPalette(Palette):<br>>          filetransfer.start_transfer(buddy, file_name, title, description,<br>>                                      mime_type)<br>>  <br>> +<br>>  class FriendsMenu(gtk.Menu):<br>>      __gtype_name__ = 'JournalFriendsMenu'<br>>  <br>> diff --git a/src/jarabe/journal/volumestoolbar.py b/src/jarabe/journal/volumestoolbar.py<br>> index 4208c17..d4caade 100644<br>> --- a/src/jarabe/journal/volumestoolbar.py<br>> +++ b/src/jarabe/journal/volumestoolbar.py<br>> @@ -30,6 +30,7 @@ from sugar.graphics.xocolor import XoColor<br>>  from jarabe.journal import model<br>>  from jarabe.view.palettes import VolumePalette<br>>  <br>> +<br>>  class VolumesToolbar(gtk.Toolbar):<br>>      __gtype_name__ = 'VolumesToolbar'<br>>  <br>> @@ -130,6 +131,7 @@ class VolumesToolbar(gtk.Toolbar):<br>>          button = self._get_button_for_mount(mount)<br>>          button.props.active = True<br>>  <br>> +<br>>  class BaseButton(RadioToolButton):<br>>      __gsignals__ = {<br>>          'volume-error': (gobject.SIGNAL_RUN_FIRST,<br>> @@ -167,6 +169,7 @@ class BaseButton(RadioToolButton):<br>>                        _('Error while copying the entry. %s') % e.strerror,<br>>                        _('Error'))<br>>  <br>> +<br>>  class VolumeButton(BaseButton):<br>>      def __init__(self, mount):<br>>          self._mount = mount<br>> @@ -197,6 +200,7 @@ class VolumeButton(BaseButton):<br>>          #palette.set_group_id('frame')<br>>          return palette<br>>  <br>> +<br>>  class JournalButton(BaseButton):<br>>      def __init__(self):<br>>          BaseButton.__init__(self, mount_point='/')<br>> @@ -206,4 +210,3 @@ class JournalButton(BaseButton):<br>>          client = gconf.client_get_default()<br>>          color = XoColor(client.get_string('/desktop/sugar/user/color'))<br>>          self.props.xo_color = color<br>> -<br>> diff --git a/src/jarabe/model/__init__.py b/src/jarabe/model/__init__.py<br>> index a9dd95a..85f6a24 100644<br>> --- a/src/jarabe/model/__init__.py<br>> +++ b/src/jarabe/model/__init__.py<br>> @@ -13,4 +13,3 @@<br>>  # You should have received a copy of the GNU General Public License<br>>  # along with this program; if not, write to the Free Software<br>>  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA<br>> -<br>> diff --git a/src/jarabe/model/adhoc.py b/src/jarabe/model/adhoc.py<br>> index ad0c941..a3f2927 100644<br>> --- a/src/jarabe/model/adhoc.py<br>> +++ b/src/jarabe/model/adhoc.py<br>> @@ -24,6 +24,7 @@ from jarabe.model.network import Settings<br>>  from sugar.util import unique_id<br>>  from jarabe.model.network import IP4Config<br>>  <br>> +<br>>  _NM_SERVICE = 'org.freedesktop.NetworkManager'<br>>  _NM_IFACE = 'org.freedesktop.NetworkManager'<br>>  _NM_PATH = '/org/freedesktop/NetworkManager'<br>> @@ -32,8 +33,9 @@ _NM_WIRELESS_IFACE = 'org.freedesktop.NetworkManager.Device.Wireless'<br>>  _NM_ACCESSPOINT_IFACE = 'org.freedesktop.NetworkManager.AccessPoint'<br>>  _NM_ACTIVE_CONN_IFACE = 'org.freedesktop.NetworkManager.Connection.Active'<br>>  <br>> -<br>>  _adhoc_manager_instance = None<br>> +<br>> +<br>>  def get_adhoc_manager_instance():<br>>      global _adhoc_manager_instance<br>>      if _adhoc_manager_instance is None:<br>> diff --git a/src/jarabe/model/buddy.py b/src/jarabe/model/buddy.py<br>> index 46a9366..dd0ad4f 100644<br>> --- a/src/jarabe/model/buddy.py<br>> +++ b/src/jarabe/model/buddy.py<br>> @@ -28,6 +28,7 @@ from sugar.profile import get_profile<br>>  <br>>  from jarabe.util.telepathy import connection_watcher<br>>  <br>> +<br>>  CONNECTION_INTERFACE_BUDDY_INFO = 'org.laptop.Telepathy.BuddyInfo'<br>>  <br>>  _owner_instance = None<br>> @@ -92,6 +93,7 @@ class BaseBuddyModel(gobject.GObject):<br>>  <br>>  class OwnerBuddyModel(BaseBuddyModel):<br>>      __gtype_name__ = 'SugarOwnerBuddyModel'<br>> +<br>>      def __init__(self):<br>>          BaseBuddyModel.__init__(self)<br>>  <br>> @@ -192,6 +194,7 @@ def get_owner_instance():<br>>  <br>>  class BuddyModel(BaseBuddyModel):<br>>      __gtype_name__ = 'SugarBuddyModel'<br>> +<br>>      def __init__(self, **kwargs):<br>>  <br>>          self._account = None<br>> diff --git a/src/jarabe/model/bundleregistry.py b/src/jarabe/model/bundleregistry.py<br>> index 2ca5d78..ff54fcf 100644<br>> --- a/src/jarabe/model/bundleregistry.py<br>> +++ b/src/jarabe/model/bundleregistry.py<br>> @@ -456,4 +456,3 @@ def get_registry():<br>>      if not _instance:<br>>          _instance = BundleRegistry()<br>>      return _instance<br>> -<br>> diff --git a/src/jarabe/model/filetransfer.py b/src/jarabe/model/filetransfer.py<br>> index 7d2d5dd..45c1bc4 100644<br>> --- a/src/jarabe/model/filetransfer.py<br>> +++ b/src/jarabe/model/filetransfer.py<br>> @@ -33,6 +33,7 @@ from sugar import dispatch<br>>  from jarabe.util.telepathy import connection_watcher<br>>  from jarabe.model import neighborhood<br>>  <br>> +<br>>  FT_STATE_NONE = 0<br>>  FT_STATE_PENDING = 1<br>>  FT_STATE_ACCEPTED = 2<br>> @@ -63,6 +64,7 @@ class StreamSplicer(gobject.GObject):<br>>                       gobject.TYPE_NONE,<br>>                       ([])),<br>>      }<br>> +<br>>      def __init__(self, input_stream, output_stream):<br>>          gobject.GObject.__init__(self)<br>>  <br>> @@ -108,6 +110,7 @@ class StreamSplicer(gobject.GObject):<br>>                                              gobject.PRIORITY_LOW,<br>>                                              user_data=data)<br>>  <br>> +<br>>  class BaseFileTransfer(gobject.GObject):<br>>  <br>>      def __init__(self, connection):<br>> @@ -179,6 +182,7 @@ class BaseFileTransfer(gobject.GObject):<br>>      def cancel(self):<br>>          self.channel[CHANNEL].Close()<br>>  <br>> +<br>>  class IncomingFileTransfer(BaseFileTransfer):<br>>      def __init__(self, connection, object_path, props):<br>>          BaseFileTransfer.__init__(self, connection)<br>> @@ -223,6 +227,7 @@ class IncomingFileTransfer(BaseFileTransfer):<br>>              self._splicer = StreamSplicer(input_stream, output_stream)<br>>              self._splicer.start()<br>>  <br>> +<br>>  class OutgoingFileTransfer(BaseFileTransfer):<br>>      def __init__(self, buddy, file_name, title, description, mime_type):<br>>  <br>> @@ -286,6 +291,7 @@ class OutgoingFileTransfer(BaseFileTransfer):<br>>      def cancel(self):<br>>          self.channel[CHANNEL].Close()<br>>  <br>> +<br>>  def _new_channels_cb(connection, channels):<br>>      for object_path, props in channels:<br>>          if props[CHANNEL + '.ChannelType'] == CHANNEL_TYPE_FILE_TRANSFER and \<br>> @@ -297,17 +303,21 @@ def _new_channels_cb(connection, channels):<br>>                                                            object_path, props)<br>>              new_file_transfer.send(None, file_transfer=incoming_file_transfer)<br>>  <br>> +<br>>  def _monitor_connection(connection):<br>>      logging.debug('connection added %r', connection)<br>>      connection[CONNECTION_INTERFACE_REQUESTS].connect_to_signal('NewChannels',<br>>              lambda channels: _new_channels_cb(connection, channels))<br>>  <br>> +<br>>  def _connection_added_cb(conn_watcher, connection):<br>>      _monitor_connection(connection)<br>>  <br>> +<br>>  def _connection_removed_cb(conn_watcher, connection):<br>>      logging.debug('connection removed %r', connection)<br>>  <br>> +<br>>  def init():<br>>      conn_watcher = connection_watcher.get_instance()<br>>      conn_watcher.connect('connection-added', _connection_added_cb)<br>> @@ -316,11 +326,13 @@ def init():<br>>      for connection in conn_watcher.get_connections():<br>>          _monitor_connection(connection)<br>>  <br>> +<br>>  def start_transfer(buddy, file_name, title, description, mime_type):<br>>      outgoing_file_transfer = OutgoingFileTransfer(buddy, file_name, title,<br>>                                                    description, mime_type)<br>>      new_file_transfer.send(None, file_transfer=outgoing_file_transfer)<br>>  <br>> +<br>>  def file_transfer_available():<br>>      conn_watcher = connection_watcher.get_instance()<br>>      for connection in conn_watcher.get_connections():<br>> @@ -353,4 +365,3 @@ if __name__ == '__main__':<br>>  <br>>      loop = gobject.MainLoop()<br>>      loop.run()<br>> -<br>> diff --git a/src/jarabe/model/friends.py b/src/jarabe/model/friends.py<br>> index ffd655b..b317130 100644<br>> --- a/src/jarabe/model/friends.py<br>> +++ b/src/jarabe/model/friends.py<br>> @@ -91,6 +91,7 @@ class FriendBuddyModel(BuddyModel):<br>>  <br>>      handle = gobject.property(type=object, getter=get_handle)<br>>  <br>> +<br>>  class Friends(gobject.GObject):<br>>      __gsignals__ = {<br>>          'friend-added':   (gobject.SIGNAL_RUN_FIRST,<br>> diff --git a/src/jarabe/model/invites.py b/src/jarabe/model/invites.py<br>> index 7020b8f..8fbc398 100644<br>> --- a/src/jarabe/model/invites.py<br>> +++ b/src/jarabe/model/invites.py<br>> @@ -38,6 +38,7 @@ from jarabe.model import bundleregistry<br>>  from jarabe.model import neighborhood<br>>  from jarabe.journal import misc<br>>  <br>> +<br>>  CONNECTION_INTERFACE_ACTIVITY_PROPERTIES = \<br>>          'org.laptop.Telepathy.ActivityProperties'<br>>  <br>> @@ -107,6 +108,7 @@ class ActivityInvite(object):<br>>          else:<br>>              logging.debug('__handle_with_reply_cb')<br>>  <br>> +<br>>  class Invites(gobject.GObject):<br>>      __gsignals__ = {<br>>          'invite-added':   (gobject.SIGNAL_RUN_FIRST,<br>> diff --git a/src/jarabe/model/neighborhood.py b/src/jarabe/model/neighborhood.py<br>> index 3885b38..ec825ac 100644<br>> --- a/src/jarabe/model/neighborhood.py<br>> +++ b/src/jarabe/model/neighborhood.py<br>> @@ -48,6 +48,7 @@ from sugar.profile import get_profile<br>>  from jarabe.model.buddy import BuddyModel, get_owner_instance<br>>  from jarabe.model import bundleregistry<br>>  <br>> +<br>>  ACCOUNT_MANAGER_SERVICE = 'org.freedesktop.Telepathy.AccountManager'<br>>  ACCOUNT_MANAGER_PATH = '/org/freedesktop/Telepathy/AccountManager'<br>>  CHANNEL_DISPATCHER_SERVICE = 'org.freedesktop.Telepathy.ChannelDispatcher'<br>> @@ -79,6 +80,7 @@ class ActivityModel(gobject.GObject):<br>>          'buddy-removed':         (gobject.SIGNAL_RUN_FIRST,<br>>                                    gobject.TYPE_NONE, ([object])),<br>>      }<br>> +<br>>      def __init__(self, activity_id, room_handle):<br>>          gobject.GObject.__init__(self)<br>>  <br>> @@ -154,6 +156,7 @@ class ActivityModel(gobject.GObject):<br>>  <br>>      current_buddies = gobject.property(type=object, getter=get_current_buddies)<br>>  <br>> +<br>>  class _Account(gobject.GObject):<br>>      __gsignals__ = {<br>>          'activity-added':       (gobject.SIGNAL_RUN_FIRST,<br>> @@ -617,6 +620,7 @@ class _Account(gobject.GObject):<br>>      def __set_enabled_cb(self):<br>>          logging.debug('_Account.__set_enabled_cb success')<br>>  <br>> +<br>>  class Neighborhood(gobject.GObject):<br>>      __gsignals__ = {<br>>          'activity-added':       (gobject.SIGNAL_RUN_FIRST,<br>> diff --git a/src/jarabe/model/network.py b/src/jarabe/model/network.py<br>> index d76e408..20fd192 100644<br>> --- a/src/jarabe/model/network.py<br>> +++ b/src/jarabe/model/network.py<br>> @@ -34,6 +34,7 @@ from sugar import dispatch<br>>  from sugar import env<br>>  from sugar.util import unique_id<br>>  <br>> +<br>>  DEVICE_TYPE_802_3_ETHERNET = 1<br>>  DEVICE_TYPE_802_11_WIRELESS = 2<br>>  DEVICE_TYPE_GSM_MODEM = 3<br>> @@ -147,6 +148,7 @@ _conn_counter = 0<br>>  <br>>  _nm_device_state_reason_description = None<br>>  <br>> +<br>>  def get_error_by_reason(reason):<br>>      global _nm_device_state_reason_description<br>>  <br>> @@ -242,7 +244,6 @@ def get_error_by_reason(reason):<br>>      return _nm_device_state_reason_description[reason]<br>>  <br>>  <br>> -<br>>  def frequency_to_channel(frequency):<br>>      """Returns the channel matching a given radio channel frequency. If a<br>>      frequency is not in the dictionary channel 1 will be returned.<br>> @@ -263,6 +264,7 @@ def frequency_to_channel(frequency):<br>>          return 1<br>>      return ftoc[frequency]<br>>  <br>> +<br>>  def is_sugar_adhoc_network(ssid):<br>>      """Checks whether an access point is a sugar Ad-hoc network.<br>>  <br>> @@ -294,6 +296,7 @@ class WirelessSecurity(object):<br>>              wireless_security['group'] = self.group<br>>          return wireless_security<br>>  <br>> +<br>>  class Wireless(object):<br>>      nm_name = "802-11-wireless"<br>>  <br>> @@ -352,6 +355,7 @@ class Connection(object):<br>>              connection['timestamp'] = self.timestamp<br>>          return connection<br>>  <br>> +<br>>  class IP4Config(object):<br>>      def __init__(self):<br>>          self.method = None<br>> @@ -362,6 +366,7 @@ class IP4Config(object):<br>>              ip4_config['method'] = self.method<br>>          return ip4_config<br>>  <br>> +<br>>  class Serial(object):<br>>      def __init__(self):<br>>          self.baud = None<br>> @@ -374,6 +379,7 @@ class Serial(object):<br>>  <br>>          return serial<br>>  <br>> +<br>>  class Ppp(object):<br>>      def __init__(self):<br>>          pass<br>> @@ -382,6 +388,7 @@ class Ppp(object):<br>>          ppp = {}<br>>          return ppp<br>>  <br>> +<br>>  class Gsm(object):<br>>      def __init__(self):<br>>          self.apn = None<br>> @@ -400,6 +407,7 @@ class Gsm(object):<br>>  <br>>          return gsm<br>>  <br>> +<br>>  class Settings(object):<br>>      def __init__(self, wireless_cfg=None):<br>>          self.connection = Connection()<br>> @@ -422,6 +430,7 @@ class Settings(object):<br>>              settings['ipv4'] = self.ip4_config.get_dict()<br>>          return settings<br>>  <br>> +<br>>  class Secrets(object):<br>>      def __init__(self, settings):<br>>          self.settings = settings<br>> @@ -447,6 +456,7 @@ class Secrets(object):<br>>  <br>>          return settings<br>>  <br>> +<br>>  class SettingsGsm(object):<br>>      def __init__(self):<br>>          self.connection = Connection()<br>> @@ -466,6 +476,7 @@ class SettingsGsm(object):<br>>  <br>>          return settings<br>>  <br>> +<br>>  class SecretsGsm(object):<br>>      def __init__(self):<br>>          self.password = None<br>> @@ -482,6 +493,7 @@ class SecretsGsm(object):<br>>              secrets['puk'] = self.puk<br>>          return {'gsm': secrets}<br>>  <br>> +<br>>  class NMSettings(dbus.service.Object):<br>>      def __init__(self):<br>>          bus = dbus.SystemBus()<br>> @@ -509,6 +521,7 @@ class NMSettings(dbus.service.Object):<br>>          self.secrets_request.send(self, connection=sender,<br>>                                    response=kwargs['response'])<br>>  <br>> +<br>>  class SecretsResponse(object):<br>>      ''' Intermediate object to report the secrets from the dialog<br>>      back to the connection object and which will inform NM<br>> @@ -525,6 +538,7 @@ class SecretsResponse(object):<br>>      def set_error(self, error):<br>>          self._error_cb(error)<br>>  <br>> +<br>>  class NMSettingsConnection(dbus.service.Object):<br>>      def __init__(self, path, settings, secrets):<br>>          bus = dbus.SystemBus()<br>> @@ -649,6 +663,7 @@ class NMSettingsConnection(dbus.service.Object):<br>>              else:<br>>                  raise Exception('The stored GSM secret has already been supplied ')<br>>  <br>> +<br>>  class AccessPoint(gobject.GObject):<br>>      __gsignals__ = {<br>>          'props-changed': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,<br>> @@ -757,6 +772,7 @@ class AccessPoint(gobject.GObject):<br>>                                           path=self.model.object_path,<br>>                                           dbus_interface=NM_ACCESSPOINT_IFACE)<br>>  <br>> +<br>>  def get_settings():<br>>      global _nm_settings<br>>      if _nm_settings is None:<br>> @@ -767,6 +783,7 @@ def get_settings():<br>>          load_connections()<br>>      return _nm_settings<br>>  <br>> +<br>>  def find_connection_by_ssid(ssid):<br>>      connections = get_settings().connections<br>>  <br>> @@ -778,6 +795,7 @@ def find_connection_by_ssid(ssid):<br>>  <br>>      return None<br>>  <br>> +<br>>  def add_connection(uuid, settings, secrets=None):<br>>      global _conn_counter<br>>  <br>> @@ -788,6 +806,7 @@ def add_connection(uuid, settings, secrets=None):<br>>      _nm_settings.add_connection(uuid, conn)<br>>      return conn<br>>  <br>> +<br>>  def load_wifi_connections():<br>>      profile_path = env.get_profile_path()<br>>      config_path = os.path.join(profile_path, 'nm', 'connections.cfg')<br>> @@ -893,10 +912,12 @@ def load_gsm_connection():<br>>      else:<br>>          logging.exception("No gsm connection was set in GConf.")<br>>  <br>> +<br>>  def load_connections():<br>>      load_wifi_connections()<br>>      load_gsm_connection()<br>>  <br>> +<br>>  def find_gsm_connection():<br>>      connections = get_settings().connections<br>>  <br>> diff --git a/src/jarabe/model/notifications.py b/src/jarabe/model/notifications.py<br>> index b5a6822..47185f1 100644<br>> --- a/src/jarabe/model/notifications.py<br>> +++ b/src/jarabe/model/notifications.py<br>> @@ -23,6 +23,7 @@ from sugar import dispatch<br>>  <br>>  from jarabe import config<br>>  <br>> +<br>>  _DBUS_SERVICE = "org.freedesktop.Notifications"<br>>  _DBUS_IFACE = "org.freedesktop.Notifications"<br>>  _DBUS_PATH = "/org/freedesktop/Notifications"<br>> @@ -76,7 +77,6 @@ class NotificationService(dbus.service.Object):<br>>      def GetServerInformation(self, name, vendor, version):<br>>          return 'Sugar Shell', 'Sugar', config.version<br>>  <br>> -<br>>      @dbus.service.signal(_DBUS_IFACE, signature="uu")<br>>      def NotificationClosed(self, notification_id, reason):<br>>          pass<br>> @@ -92,6 +92,6 @@ def get_service():<br>>          _instance = NotificationService()<br>>      return _instance<br>>  <br>> +<br>>  def init():<br>>      get_service()<br>> -<br>> diff --git a/src/jarabe/model/olpcmesh.py b/src/jarabe/model/olpcmesh.py<br>> index 7873692..ceb7e37 100644<br>> --- a/src/jarabe/model/olpcmesh.py<br>> +++ b/src/jarabe/model/olpcmesh.py<br>> @@ -24,6 +24,7 @@ from jarabe.model.network import Settings<br>>  from jarabe.model.network import OlpcMesh as OlpcMeshSettings<br>>  from sugar.util import unique_id<br>>  <br>> +<br>>  _NM_SERVICE = 'org.freedesktop.NetworkManager'<br>>  _NM_IFACE = 'org.freedesktop.NetworkManager'<br>>  _NM_PATH = '/org/freedesktop/NetworkManager'<br>> @@ -43,6 +44,7 @@ DEVICE_STATE_IP_CONFIG = 7<br>>  DEVICE_STATE_ACTIVATED = 8<br>>  DEVICE_STATE_FAILED = 9<br>>  <br>> +<br>>  class OlpcMeshManager(object):<br>>      def __init__(self, mesh_device):<br>>          self._bus = dbus.SystemBus()<br>> @@ -211,4 +213,3 @@ class OlpcMeshManager(object):<br>>          self._connection_queue.append((6, _XS_ANYCAST))<br>>          self._connection_queue.append((1, _XS_ANYCAST))<br>>          self._try_next_connection_from_queue()<br>> -<br>> diff --git a/src/jarabe/model/screen.py b/src/jarabe/model/screen.py<br>> index 4403c1c..965317d 100644<br>> --- a/src/jarabe/model/screen.py<br>> +++ b/src/jarabe/model/screen.py<br>> @@ -18,12 +18,14 @@ import logging<br>>  <br>>  import dbus<br>>  <br>> +<br>>  _HARDWARE_MANAGER_INTERFACE = 'org.freedesktop.ohm.Keystore'<br>>  _HARDWARE_MANAGER_SERVICE = 'org.freedesktop.ohm'<br>>  _HARDWARE_MANAGER_OBJECT_PATH = '/org/freedesktop/ohm/Keystore'<br>>  <br>>  _ohm_service = None<br>>  <br>> +<br>>  def _get_ohm():<br>>      global _ohm_service<br>>      if _ohm_service is None:<br>> @@ -35,9 +37,9 @@ def _get_ohm():<br>>  <br>>      return _ohm_service<br>>  <br>> +<br>>  def set_dcon_freeze(frozen):<br>>      try:<br>>          _get_ohm().SetKey("display.dcon_freeze", frozen)<br>>      except dbus.DBusException:<br>>          logging.error('Cannot unfreeze the DCON')<br>> -<br>> diff --git a/src/jarabe/model/session.py b/src/jarabe/model/session.py<br>> index 9e0f087..531b7a5 100644<br>> --- a/src/jarabe/model/session.py<br>> +++ b/src/jarabe/model/session.py<br>> @@ -24,8 +24,10 @@ import logging<br>>  from sugar import session<br>>  from sugar import env<br>>  <br>> +<br>>  _session_manager = None<br>>  <br>> +<br>>  class SessionManager(session.SessionManager):<br>>      MODE_LOGOUT = 0<br>>      MODE_SHUTDOWN = 1<br>> @@ -81,6 +83,7 @@ class SessionManager(session.SessionManager):<br>>          # killed by the X (dis)connection<br>>          sys.exit()<br>>  <br>> +<br>>  def get_session_manager():<br>>      global _session_manager<br>>  <br>> diff --git a/src/jarabe/model/shell.py b/src/jarabe/model/shell.py<br>> index 65d1c26..624648c 100644<br>> --- a/src/jarabe/model/shell.py<br>> +++ b/src/jarabe/model/shell.py<br>> @@ -638,4 +638,3 @@ def get_model():<br>>      if _model is None:<br>>          _model = ShellModel()<br>>      return _model<br>> -<br>> diff --git a/src/jarabe/model/sound.py b/src/jarabe/model/sound.py<br>> index 16e69b5..9e1e748 100644<br>> --- a/src/jarabe/model/sound.py<br>> +++ b/src/jarabe/model/sound.py<br>> @@ -20,6 +20,7 @@ from sugar import env<br>>  from sugar import _sugarext<br>>  from sugar import dispatch<br>>  <br>> +<br>>  VOLUME_STEP = 10<br>>  <br>>  muted_changed = dispatch.Signal()<br>> @@ -31,9 +32,11 @@ _volume = _sugarext.VolumeAlsa()<br>>  def get_muted():<br>>      return _volume.get_mute()<br>>  <br>> +<br>>  def get_volume():<br>>      return _volume.get_volume()<br>>  <br>> +<br>>  def set_volume(new_volume):<br>>      old_volume = _volume.get_volume()<br>>      _volume.set_volume(new_volume)<br>> @@ -41,6 +44,7 @@ def set_volume(new_volume):<br>>      volume_changed.send(None)<br>>      save()<br>>  <br>> +<br>>  def set_muted(new_state):<br>>      old_state = _volume.get_mute()<br>>      _volume.set_mute(new_state)<br>> @@ -48,11 +52,13 @@ def set_muted(new_state):<br>>      muted_changed.send(None)<br>>      save()<br>>  <br>> +<br>>  def save():<br>>      if env.is_emulator() is False:<br>>          client = gconf.client_get_default()<br>>          client.set_int('/desktop/sugar/sound/volume', get_volume())<br>>  <br>> +<br>>  def restore():<br>>      if env.is_emulator() is False:<br>>          client = gconf.client_get_default()<br>> diff --git a/src/jarabe/model/telepathyclient.py b/src/jarabe/model/telepathyclient.py<br>> index 189e344..c6fbac1 100644<br>> --- a/src/jarabe/model/telepathyclient.py<br>> +++ b/src/jarabe/model/telepathyclient.py<br>> @@ -26,6 +26,7 @@ from telepathy.server import DBusProperties<br>>  <br>>  from sugar import dispatch<br>>  <br>> +<br>>  SUGAR_CLIENT_SERVICE = 'org.freedesktop.Telepathy.Client.Sugar'<br>>  SUGAR_CLIENT_PATH = '/org/freedesktop/Telepathy/Client/Sugar'<br>>  <br>> diff --git a/src/jarabe/util/__init__.py b/src/jarabe/util/__init__.py<br>> index 1610dd0..9c80ecb 100644<br>> --- a/src/jarabe/util/__init__.py<br>> +++ b/src/jarabe/util/__init__.py<br>> @@ -16,4 +16,3 @@<br>>  # You should have received a copy of the GNU General Public License<br>>  # along with this program; if not, write to the Free Software<br>>  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA<br>> -<br>> diff --git a/src/jarabe/util/emulator.py b/src/jarabe/util/emulator.py<br>> index b6ce9dc..afcac30 100644<br>> --- a/src/jarabe/util/emulator.py<br>> +++ b/src/jarabe/util/emulator.py<br>> @@ -118,6 +118,7 @@ def _start_window_manager():<br>>  <br>>      gobject.spawn_async(cmd, flags=gobject.SPAWN_SEARCH_PATH)<br>>  <br>> +<br>>  def _setup_env(display, scaling, emulator_pid):<br>>      os.environ['SUGAR_EMULATOR'] = 'yes'<br>>      os.environ['GABBLE_LOGFILE'] = os.path.join(<br>> @@ -136,6 +137,7 @@ def _setup_env(display, scaling, emulator_pid):<br>>      if scaling:<br>>          os.environ['SUGAR_SCALING'] = scaling<br>>  <br>> +<br>>  def main():<br>>      """Script-level operations"""<br>>  <br>> diff --git a/src/jarabe/util/telepathy/__init__.py b/src/jarabe/util/telepathy/__init__.py<br>> index 387d09c..eee4abb 100644<br>> --- a/src/jarabe/util/telepathy/__init__.py<br>> +++ b/src/jarabe/util/telepathy/__init__.py<br>> @@ -16,4 +16,3 @@<br>>  # You should have received a copy of the GNU General Public License<br>>  # along with this program; if not, write to the Free Software<br>>  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA<br>> -<br>> diff --git a/src/jarabe/util/telepathy/connection_watcher.py b/src/jarabe/util/telepathy/connection_watcher.py<br>> index 27ac018..2e073ae 100644<br>> --- a/src/jarabe/util/telepathy/connection_watcher.py<br>> +++ b/src/jarabe/util/telepathy/connection_watcher.py<br>> @@ -104,6 +104,7 @@ def get_instance():<br>>          _instance = ConnectionWatcher()<br>>      return _instance<br>>  <br>> +<br>>  if __name__ == '__main__':<br>>      dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)<br>>  <br>> diff --git a/src/jarabe/view/__init__.py b/src/jarabe/view/__init__.py<br>> index a9dd95a..85f6a24 100644<br>> --- a/src/jarabe/view/__init__.py<br>> +++ b/src/jarabe/view/__init__.py<br>> @@ -13,4 +13,3 @@<br>>  # You should have received a copy of the GNU General Public License<br>>  # along with this program; if not, write to the Free Software<br>>  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA<br>> -<br>> diff --git a/src/jarabe/view/buddyicon.py b/src/jarabe/view/buddyicon.py<br>> index 332c0c8..a274605 100644<br>> --- a/src/jarabe/view/buddyicon.py<br>> +++ b/src/jarabe/view/buddyicon.py<br>> @@ -19,6 +19,7 @@ from sugar.graphics import style<br>>  <br>>  from jarabe.view.buddymenu import BuddyMenu<br>>  <br>> +<br>>  class BuddyIcon(CanvasIcon):<br>>      def __init__(self, buddy, size=style.STANDARD_ICON_SIZE):<br>>          CanvasIcon.__init__(self, icon_name='computer-xo', size=size)<br>> @@ -60,4 +61,3 @@ class BuddyIcon(CanvasIcon):<br>>          self._greyed_out = (self._buddy.get_nick().lower().find(query) == -1) \<br>>                  and not self._buddy.is_owner()<br>>          self._update_color()<br>> -<br>> diff --git a/src/jarabe/view/buddymenu.py b/src/jarabe/view/buddymenu.py<br>> index 0ba6cc1..b4bb492 100644<br>> --- a/src/jarabe/view/buddymenu.py<br>> +++ b/src/jarabe/view/buddymenu.py<br>> @@ -31,6 +31,7 @@ from jarabe.model import friends<br>>  from jarabe.model.session import get_session_manager<br>>  from jarabe.controlpanel.gui import ControlPanel<br>>  <br>> +<br>>  class BuddyMenu(Palette):<br>>      def __init__(self, buddy):<br>>          self._buddy = buddy<br>> diff --git a/src/jarabe/view/keyhandler.py b/src/jarabe/view/keyhandler.py<br>> index 93ddf47..794092d 100644<br>> --- a/src/jarabe/view/keyhandler.py<br>> +++ b/src/jarabe/view/keyhandler.py<br>> @@ -32,10 +32,12 @@ from jarabe.model.shell import ShellModel<br>>  from jarabe import config<br>>  from jarabe.journal import journalactivity<br>>  <br>> +<br>>  _VOLUME_STEP = sound.VOLUME_STEP<br>>  _VOLUME_MAX = 100<br>>  _TABBING_MODIFIER = gtk.gdk.MOD1_MASK<br>>  <br>> +<br>>  _actions_table = {<br>>      'F1'                   : 'zoom_mesh',<br>>      'F2'                   : 'zoom_group',<br>> @@ -241,4 +243,3 @@ def setup(frame):<br>>          del _instance<br>>  <br>>      _instance = KeyHandler(frame)<br>> -<br>> diff --git a/src/jarabe/view/palettes.py b/src/jarabe/view/palettes.py<br>> index 43612d4..6104538 100644<br>> --- a/src/jarabe/view/palettes.py<br>> +++ b/src/jarabe/view/palettes.py<br>> @@ -35,6 +35,7 @@ from jarabe.model import shell<br>>  from jarabe.view.viewsource import setup_view_source<br>>  from jarabe.journal import misc<br>>  <br>> +<br>>  class BasePalette(Palette):<br>>      def __init__(self, home_activity):<br>>          Palette.__init__(self)<br>> @@ -147,6 +148,7 @@ class ActivityPalette(Palette):<br>>          self.popdown(immediate=True)<br>>          misc.launch(self._activity_info)<br>>  <br>> +<br>>  class JournalPalette(BasePalette):<br>>      def __init__(self, home_activity):<br>>          self._home_activity = home_activity<br>> @@ -198,6 +200,7 @@ class JournalPalette(BasePalette):<br>>          self._free_space_label.props.label = _('%(free_space)d MB Free') % \<br>>                  {'free_space': free_space / (1024 * 1024)}<br>>  <br>> +<br>>  class VolumePalette(Palette):<br>>      def __init__(self, mount):<br>>          Palette.__init__(self, label=mount.get_name())<br>> @@ -247,4 +250,3 @@ class VolumePalette(Palette):<br>>          self._progress_bar.props.fraction = fraction<br>>          self._free_space_label.props.label = _('%(free_space)d MB Free') % \<br>>                  {'free_space': free_space / (1024 * 1024)}<br>> -<br>> diff --git a/src/jarabe/view/pulsingicon.py b/src/jarabe/view/pulsingicon.py<br>> index 43ec358..392a404 100644<br>> --- a/src/jarabe/view/pulsingicon.py<br>> +++ b/src/jarabe/view/pulsingicon.py<br>> @@ -21,9 +21,11 @@ import gobject<br>>  <br>>  from sugar.graphics.icon import Icon, CanvasIcon<br>>  <br>> +<br>>  _INTERVAL = 100<br>>  _STEP = math.pi / 10  # must be a fraction of pi, for clean caching<br>>  <br>> +<br>>  class Pulser(object):<br>>      def __init__(self, icon):<br>>          self._pulse_hid = None<br>> @@ -83,6 +85,7 @@ class Pulser(object):<br>>  <br>>          return True<br>>  <br>> +<br>>  class PulsingIcon(Icon):<br>>      __gtype_name__ = 'SugarPulsingIcon'<br>>  <br>> @@ -161,6 +164,7 @@ class PulsingIcon(Icon):<br>>          if self._palette is not None:<br>>              self._palette.destroy()<br>>  <br>> +<br>>  class CanvasPulsingIcon(CanvasIcon):<br>>      __gtype_name__ = 'SugarCanvasPulsingIcon'<br>>  <br>> diff --git a/src/jarabe/view/service.py b/src/jarabe/view/service.py<br>> index 7af778a..16299de 100644<br>> --- a/src/jarabe/view/service.py<br>> +++ b/src/jarabe/view/service.py<br>> @@ -23,10 +23,12 @@ import gtk<br>>  from jarabe.model import shell<br>>  from jarabe.model import bundleregistry<br>>  <br>> +<br>>  _DBUS_SERVICE = "org.laptop.Shell"<br>>  _DBUS_SHELL_IFACE = "org.laptop.Shell"<br>>  _DBUS_PATH = "/org/laptop/Shell"<br>>  <br>> +<br>>  class UIService(dbus.service.Object):<br>>      """Provides d-bus service to script the shell's operations<br>>  <br>> @@ -86,4 +88,3 @@ class UIService(dbus.service.Object):<br>>                           in_signature="s", out_signature="")<br>>      def NotifyLaunchFailure(self, activity_id):<br>>          shell.get_model().notify_launch_failed(activity_id)<br>> -<br>> diff --git a/src/jarabe/view/tabbinghandler.py b/src/jarabe/view/tabbinghandler.py<br>> index f52bda3..0889792 100644<br>> --- a/src/jarabe/view/tabbinghandler.py<br>> +++ b/src/jarabe/view/tabbinghandler.py<br>> @@ -21,8 +21,10 @@ import gtk<br>>  <br>>  from jarabe.model import shell<br>>  <br>> +<br>>  _RAISE_DELAY = 250<br>>  <br>> +<br>>  class TabbingHandler(object):<br>>      def __init__(self, frame, modifier):<br>>          self._frame = frame<br>> @@ -145,4 +147,3 @@ class TabbingHandler(object):<br>>  <br>>      def is_tabbing(self):<br>>          return self._tabbing<br>> -<br>> diff --git a/src/jarabe/view/viewsource.py b/src/jarabe/view/viewsource.py<br>> index 290df18..e6e7e36 100644<br>> --- a/src/jarabe/view/viewsource.py<br>> +++ b/src/jarabe/view/viewsource.py<br>> @@ -37,11 +37,13 @@ from sugar.bundle.activitybundle import ActivityBundle<br>>  from sugar.datastore import datastore<br>>  from sugar import mime<br>>  <br>> +<br>>  _SOURCE_FONT = pango.FontDescription('Monospace %d' % style.FONT_SIZE)<br>>  <br>>  _logger = logging.getLogger('ViewSource')<br>>  map_activity_to_window = {}<br>>  <br>> +<br>>  def setup_view_source(activity):<br>>      service = activity.get_service()<br>>      if service is not None:<br>> @@ -89,6 +91,7 @@ def setup_view_source(activity):<br>>      map_activity_to_window[window_xid] = view_source<br>>      view_source.show()<br>>  <br>> +<br>>  class ViewSource(gtk.Window):<br>>      __gtype_name__ = 'SugarViewSource'<br>>  <br>> @@ -195,6 +198,7 @@ class ViewSource(gtk.Window):<br>>          else:<br>>              self._source_display.file_path = None<br>>  <br>> +<br>>  class DocumentButton(RadioToolButton):<br>>      __gtype_name__ = 'SugarDocumentButton'<br>>  <br>> @@ -251,6 +255,7 @@ class DocumentButton(RadioToolButton):<br>>          logging.debug('Error saving Source object to datastore: %s', err)<br>>          self._jobject.destroy()<br>>  <br>> +<br>>  class Toolbar(gtk.Toolbar):<br>>      __gtype_name__ = 'SugarViewSourceToolbar'<br>>  <br>> @@ -339,6 +344,7 @@ class Toolbar(gtk.Toolbar):<br>>          if button.props.active:<br>>              self.emit('source-selected', path)<br>>  <br>> +<br>>  class FileViewer(gtk.ScrolledWindow):<br>>      __gtype_name__ = 'SugarFileViewer'<br>>  <br>> @@ -405,6 +411,7 @@ class FileViewer(gtk.ScrolledWindow):<br>>              file_path = model.get_value(tree_iter, 1)<br>>          self.emit('file-selected', file_path)<br>>  <br>> +<br>>  class SourceDisplay(gtk.ScrolledWindow):<br>>      __gtype_name__ = 'SugarSourceDisplay'<br>>  <br>> @@ -461,4 +468,3 @@ class SourceDisplay(gtk.ScrolledWindow):<br>>          return self._file_path<br>>  <br>>      file_path = property(_get_file_path, _set_file_path)<br>> -<br>> -- <br>> 1.7.1<br>> <br>> _______________________________________________<br>> Sugar-devel mailing list<br>> Sugar-devel@lists.sugarlabs.org<br>> http://lists.sugarlabs.org/listinfo/sugar-devel<br>                                         </body>
</html>