[Sugar-devel] [PATCH sugar v2 09/21] style cleanup: prefer ' for strings
Sascha Silbe
sascha-pgp at silbe.org
Fri Nov 19 16:13:17 EST 2010
Tomeu prefers ' for strings, so let's use it wherever we don't have a good
reason to use ".
Reviewed-by: James Cameron <quozl at laptop.org>
CC: Aleksey Lim <alsroot at member.fsf.org>
Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>
diff --git a/extensions/cpsection/aboutcomputer/model.py b/extensions/cpsection/aboutcomputer/model.py
index b700a6b..e3b9687 100644
--- a/extensions/cpsection/aboutcomputer/model.py
+++ b/extensions/cpsection/aboutcomputer/model.py
@@ -84,7 +84,7 @@ def get_firmware_number():
if firmware_no is None:
firmware_no = _not_available
else:
- firmware_no = re.split(" +", firmware_no)
+ firmware_no = re.split(' +', firmware_no)
if len(firmware_no) == 3:
firmware_no = firmware_no[1]
return firmware_no
@@ -96,7 +96,7 @@ def print_firmware_number():
def get_wireless_firmware():
try:
- info = subprocess.Popen(["/usr/sbin/ethtool", "-i", "eth0"],
+ info = subprocess.Popen(['/usr/sbin/ethtool', '-i', 'eth0'],
stdout=subprocess.PIPE).stdout.readlines()
except OSError:
return _not_available
@@ -130,14 +130,14 @@ def _read_file(path):
def get_license():
license_file = os.path.join(config.data_path, 'GPLv2')
lang = os.environ['LANG']
- if lang.endswith("UTF-8"):
+ if lang.endswith('UTF-8'):
lang = lang[:-6]
- try_file = license_file + "." + lang
+ try_file = license_file + '.' + lang
if os.path.isfile(try_file):
license_file = try_file
else:
- try_file = license_file + "." + lang.split("_")[0]
+ try_file = license_file + '.' + lang.split('_')[0]
if os.path.isfile(try_file):
license_file = try_file
diff --git a/extensions/cpsection/aboutcomputer/view.py b/extensions/cpsection/aboutcomputer/view.py
index 68545fd..7892577 100644
--- a/extensions/cpsection/aboutcomputer/view.py
+++ b/extensions/cpsection/aboutcomputer/view.py
@@ -175,30 +175,30 @@ class AboutComputer(SectionView):
vbox_copyright.set_border_width(style.DEFAULT_SPACING * 2)
vbox_copyright.set_spacing(style.DEFAULT_SPACING)
- label_copyright = gtk.Label("© 2006-2010 One Laptop per Child "
- "Association Inc, Sugar Labs Inc, "
- "Red Hat Inc, Collabora Ltd "
- "and Contributors.")
+ copyright_text = '© 2006-2010 One Laptop per Child Association Inc,' \
+ ' Sugar Labs Inc, Red Hat Inc, Collabora Ltd and' \
+ ' Contributors.'
+ label_copyright = gtk.Label(copyright_text)
label_copyright.set_alignment(0, 0)
label_copyright.set_size_request(gtk.gdk.screen_width() / 2, -1)
label_copyright.set_line_wrap(True)
label_copyright.show()
vbox_copyright.pack_start(label_copyright, expand=False)
- label_info = gtk.Label(_("Sugar is the graphical user interface that "
- "you are looking at. Sugar is free software, "
- "covered by the GNU General Public License, "
- "and you are welcome to change it and/or "
- "distribute copies of it under certain "
- "conditions described therein."))
+ info_text = _('Sugar is the graphical user interface that you are'
+ ' looking at. Sugar is free software, covered by the'
+ ' GNU General Public License, and you are welcome to'
+ ' change it and/or distribute copies of it under'
+ ' certain conditions described therein.')
+ label_info = gtk.Label(info_text)
label_info.set_alignment(0, 0)
label_info.set_line_wrap(True)
label_info.set_size_request(gtk.gdk.screen_width() / 2, -1)
label_info.show()
vbox_copyright.pack_start(label_info, expand=False)
- expander = gtk.Expander(_("Full license:"))
- expander.connect("notify::expanded", self.license_expander_cb)
+ expander = gtk.Expander(_('Full license:'))
+ expander.connect('notify::expanded', self.license_expander_cb)
expander.show()
vbox_copyright.pack_start(expander, expand=True)
diff --git a/extensions/cpsection/aboutme/model.py b/extensions/cpsection/aboutme/model.py
index 3bb96d5..fb4c2f1 100644
--- a/extensions/cpsection/aboutme/model.py
+++ b/extensions/cpsection/aboutme/model.py
@@ -33,7 +33,7 @@ _MODIFIERS = ('dark', 'medium', 'light')
def get_nick():
client = gconf.client_get_default()
- return client.get_string("/desktop/sugar/user/nick")
+ return client.get_string('/desktop/sugar/user/nick')
def print_nick():
@@ -45,17 +45,17 @@ def set_nick(nick):
nick : e.g. 'walter'
"""
if not nick:
- raise ValueError(_("You must enter a name."))
+ raise ValueError(_('You must enter a name.'))
if not isinstance(nick, unicode):
nick = unicode(nick, 'utf-8')
client = gconf.client_get_default()
- client.set_string("/desktop/sugar/user/nick", nick)
+ client.set_string('/desktop/sugar/user/nick', nick)
return 1
def get_color():
client = gconf.client_get_default()
- return client.get_string("/desktop/sugar/user/color")
+ return client.get_string('/desktop/sugar/user/color')
def print_color():
@@ -91,10 +91,10 @@ def set_color(stroke, fill, stroke_modifier='medium', fill_modifier='medium'):
"""
if stroke_modifier not in _MODIFIERS or fill_modifier not in _MODIFIERS:
- print (_("Error in specified color modifiers."))
+ print (_('Error in specified color modifiers.'))
return
if stroke not in _COLORS or fill not in _COLORS:
- print (_("Error in specified colors."))
+ print (_('Error in specified colors.'))
return
if stroke_modifier == fill_modifier:
@@ -107,13 +107,13 @@ def set_color(stroke, fill, stroke_modifier='medium', fill_modifier='medium'):
+ _COLORS[fill][fill_modifier]
client = gconf.client_get_default()
- client.set_string("/desktop/sugar/user/color", color)
+ client.set_string('/desktop/sugar/user/color', color)
return 1
def get_color_xo():
client = gconf.client_get_default()
- return client.get_string("/desktop/sugar/user/color")
+ return client.get_string('/desktop/sugar/user/color')
def set_color_xo(color):
@@ -121,5 +121,5 @@ def set_color_xo(color):
This method is used by the graphical user interface
"""
client = gconf.client_get_default()
- client.set_string("/desktop/sugar/user/color", color)
+ client.set_string('/desktop/sugar/user/color', color)
return 1
diff --git a/extensions/cpsection/aboutme/view.py b/extensions/cpsection/aboutme/view.py
index 69f212a..84daec7 100644
--- a/extensions/cpsection/aboutme/view.py
+++ b/extensions/cpsection/aboutme/view.py
@@ -35,12 +35,12 @@ def _get_next_stroke_color(color):
as color. """
current_index = _get_current_index(color)
if current_index == -1:
- return "%s,%s" % (color.stroke, color.fill)
+ return '%s,%s' % (color.stroke, color.fill)
next_index = _next_index(current_index)
while(colors[next_index][_FILL_COLOR] != \
colors[current_index][_FILL_COLOR]):
next_index = _next_index(next_index)
- return "%s,%s" % (colors[next_index][_STROKE_COLOR],
+ return '%s,%s' % (colors[next_index][_STROKE_COLOR],
colors[next_index][_FILL_COLOR])
@@ -49,12 +49,12 @@ def _get_previous_stroke_color(color):
as color. """
current_index = _get_current_index(color)
if current_index == -1:
- return "%s,%s" % (color.stroke, color.fill)
+ return '%s,%s' % (color.stroke, color.fill)
previous_index = _previous_index(current_index)
while (colors[previous_index][_FILL_COLOR] != \
colors[current_index][_FILL_COLOR]):
previous_index = _previous_index(previous_index)
- return "%s,%s" % (colors[previous_index][_STROKE_COLOR],
+ return '%s,%s' % (colors[previous_index][_STROKE_COLOR],
colors[previous_index][_FILL_COLOR])
@@ -63,12 +63,12 @@ def _get_next_fill_color(color):
as color. """
current_index = _get_current_index(color)
if current_index == -1:
- return "%s,%s" % (color.stroke, color.fill)
+ return '%s,%s' % (color.stroke, color.fill)
next_index = _next_index(current_index)
while (colors[next_index][_STROKE_COLOR] != \
colors[current_index][_STROKE_COLOR]):
next_index = _next_index(next_index)
- return "%s,%s" % (colors[next_index][_STROKE_COLOR],
+ return '%s,%s' % (colors[next_index][_STROKE_COLOR],
colors[next_index][_FILL_COLOR])
@@ -77,12 +77,12 @@ def _get_previous_fill_color(color):
as color. """
current_index = _get_current_index(color)
if current_index == -1:
- return "%s,%s" % (color.stroke, color.fill)
+ return '%s,%s' % (color.stroke, color.fill)
previous_index = _previous_index(current_index)
while (colors[previous_index][_STROKE_COLOR] != \
colors[current_index][_STROKE_COLOR]):
previous_index = _previous_index(previous_index)
- return "%s,%s" % (colors[previous_index][_STROKE_COLOR],
+ return '%s,%s' % (colors[previous_index][_STROKE_COLOR],
colors[previous_index][_FILL_COLOR])
@@ -112,7 +112,7 @@ _PREVIOUS_STROKE_COLOR = 4
class EventIcon(gtk.EventBox):
- __gtype_name__ = "SugarEventIcon"
+ __gtype_name__ = 'SugarEventIcon'
def __init__(self, **kwargs):
gtk.EventBox.__init__(self)
diff --git a/extensions/cpsection/datetime/model.py b/extensions/cpsection/datetime/model.py
index dc17168..84e1259 100644
--- a/extensions/cpsection/datetime/model.py
+++ b/extensions/cpsection/datetime/model.py
@@ -89,7 +89,7 @@ def set_timezone(timezone):
client = gconf.client_get_default()
client.set_string('/desktop/sugar/date/timezone', timezone)
else:
- raise ValueError(_("Error timezone does not exist."))
+ raise ValueError(_('Error timezone does not exist.'))
return 1
# inilialize the docstrings for the timezone
diff --git a/extensions/cpsection/datetime/view.py b/extensions/cpsection/datetime/view.py
index ec82060..1cef78f 100644
--- a/extensions/cpsection/datetime/view.py
+++ b/extensions/cpsection/datetime/view.py
@@ -37,7 +37,7 @@ class TimeZone(SectionView):
self.set_border_width(style.DEFAULT_SPACING * 2)
self.set_spacing(style.DEFAULT_SPACING)
- self.connect("realize", self.__realize_cb)
+ self.connect('realize', self.__realize_cb)
self._entry = iconentry.IconEntry()
self._entry.set_icon_from_name(iconentry.ICON_ENTRY_PRIMARY,
@@ -101,7 +101,7 @@ class TimeZone(SectionView):
self.needs_restart = False
self._cursor_change_handler = self._treeview.connect( \
- "cursor-changed", self.__zone_changed_cd)
+ 'cursor-changed', self.__zone_changed_cd)
def undo(self):
self._treeview.disconnect(self._cursor_change_handler)
diff --git a/extensions/cpsection/frame/model.py b/extensions/cpsection/frame/model.py
index de2da5e..4796062 100644
--- a/extensions/cpsection/frame/model.py
+++ b/extensions/cpsection/frame/model.py
@@ -38,7 +38,7 @@ def set_corner_delay(delay):
try:
int(delay)
except ValueError:
- raise ValueError(_("Value must be an integer."))
+ raise ValueError(_('Value must be an integer.'))
client = gconf.client_get_default()
client.set_int('/desktop/sugar/frame/corner_delay', int(delay))
return 0
@@ -63,7 +63,7 @@ def set_edge_delay(delay):
try:
int(delay)
except ValueError:
- raise ValueError(_("Value must be an integer."))
+ raise ValueError(_('Value must be an integer.'))
client = gconf.client_get_default()
client.set_int('/desktop/sugar/frame/edge_delay', int(delay))
return 0
diff --git a/extensions/cpsection/language/model.py b/extensions/cpsection/language/model.py
index c6f4847..48bb496 100644
--- a/extensions/cpsection/language/model.py
+++ b/extensions/cpsection/language/model.py
@@ -27,7 +27,7 @@ import subprocess
_default_lang = '%s.%s' % locale.getdefaultlocale()
-_standard_msg = _("Could not access ~/.i18n. Create standard settings.")
+_standard_msg = _('Could not access ~/.i18n. Create standard settings.')
def read_all_languages():
@@ -70,7 +70,7 @@ def _initialize():
def _write_i18n(langs):
colon = ':'
langstr = colon.join(langs)
- path = os.path.join(os.environ.get("HOME"), '.i18n')
+ path = os.path.join(os.environ.get('HOME'), '.i18n')
if not os.access(path, os.W_OK):
print _standard_msg
fd = open(path, 'w')
@@ -85,7 +85,7 @@ def _write_i18n(langs):
def get_languages():
- path = os.path.join(os.environ.get("HOME"), '.i18n')
+ path = os.path.join(os.environ.get('HOME', ''), '.i18n')
if not os.access(path, os.R_OK):
print _standard_msg
fd = open(path, 'w')
@@ -94,18 +94,18 @@ def get_languages():
fd.close()
return [_default_lang]
- fd = open(path, "r")
+ fd = open(path, 'r')
lines = fd.readlines()
fd.close()
langlist = None
for line in lines:
- if line.startswith("LANGUAGE="):
+ if line.startswith('LANGUAGE='):
lang = line[9:].replace('"', '')
lang = lang.strip()
langlist = lang.split(':')
- elif line.startswith("LANG="):
+ elif line.startswith('LANG='):
lang = line[5:].replace('"', '')
# There might be cases where .i18n may not contain a LANGUAGE field
@@ -128,7 +128,7 @@ def print_languages():
found_lang = True
break
if not found_lang:
- print (_("Language for code=%s could not be determined.") % code)
+ print (_('Language for code=%s could not be determined.') % code)
def set_languages(languages):
diff --git a/extensions/cpsection/modemconfiguration/view.py b/extensions/cpsection/modemconfiguration/view.py
index 11396d7..c31edba 100644
--- a/extensions/cpsection/modemconfiguration/view.py
+++ b/extensions/cpsection/modemconfiguration/view.py
@@ -30,7 +30,7 @@ APPLY_TIMEOUT = 1000
class EntryWithLabel(gtk.HBox):
- __gtype_name__ = "SugarEntryWithLabel"
+ __gtype_name__ = 'SugarEntryWithLabel'
def __init__(self, label_text):
gtk.HBox.__init__(self, spacing=style.DEFAULT_SPACING)
@@ -172,10 +172,9 @@ class ModemConfiguration(SectionView):
self.set_spacing(style.DEFAULT_SPACING)
self._group = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
- explanation = _("You will need to provide the following " \
- "information to set up a mobile " \
- "broadband connection to a cellular "\
- "(3G) network.")
+ explanation = _('You will need to provide the following information'
+ ' to set up a mobile broadband connection to a'
+ ' cellular (3G) network.')
self._text = gtk.Label(explanation)
self._text.set_width_chars(100)
self._text.set_line_wrap(True)
diff --git a/extensions/cpsection/network/model.py b/extensions/cpsection/network/model.py
index c1e7229..667e476 100644
--- a/extensions/cpsection/network/model.py
+++ b/extensions/cpsection/network/model.py
@@ -93,7 +93,7 @@ def set_radio(state):
raise ReadError('%s service not available' % _NM_SERVICE)
nm_props.Set(_NM_IFACE, 'WirelessEnabled', False)
else:
- raise ValueError(_("Error in specified radio argument use on/off."))
+ raise ValueError(_('Error in specified radio argument use on/off.'))
return 0
@@ -130,7 +130,7 @@ def set_publish_information(value):
try:
value = (False, True)[int(value)]
except:
- raise ValueError(_("Error in specified argument use 0/1."))
+ raise ValueError(_('Error in specified argument use 0/1.'))
client = gconf.client_get_default()
client.set_bool('/desktop/sugar/collaboration/publish_gadget', value)
diff --git a/extensions/cpsection/network/view.py b/extensions/cpsection/network/view.py
index 1c688c6..9ecc8fd 100644
--- a/extensions/cpsection/network/view.py
+++ b/extensions/cpsection/network/view.py
@@ -66,8 +66,8 @@ class Network(SectionView):
box_wireless.set_border_width(style.DEFAULT_SPACING * 2)
box_wireless.set_spacing(style.DEFAULT_SPACING)
- radio_info = gtk.Label(_("Turn off the wireless radio to save "
- "battery life"))
+ radio_info = gtk.Label(_('Turn off the wireless radio to save battery'
+ ' life'))
radio_info.set_alignment(0, 0)
radio_info.set_line_wrap(True)
radio_info.show()
@@ -95,8 +95,8 @@ class Network(SectionView):
self._radio_alert.props.msg = self.restart_msg
self._radio_alert.show()
- history_info = gtk.Label(_("Discard network history if you "
- "have trouble connecting to the network"))
+ history_info = gtk.Label(_('Discard network history if you have'
+ ' trouble connecting to the network'))
history_info.set_alignment(0, 0)
history_info.set_line_wrap(True)
history_info.show()
diff --git a/extensions/cpsection/power/model.py b/extensions/cpsection/power/model.py
index ffbb5a2..041e5cf 100644
--- a/extensions/cpsection/power/model.py
+++ b/extensions/cpsection/power/model.py
@@ -81,13 +81,13 @@ def set_automatic_pm(enabled):
keystore = dbus.Interface(proxy, OHM_SERVICE_IFACE)
if enabled == 'on' or enabled == 1:
- keystore.SetKey("suspend.automatic_pm", 1)
+ keystore.SetKey('suspend.automatic_pm', 1)
enabled = True
elif enabled == 'off' or enabled == 0:
- keystore.SetKey("suspend.automatic_pm", 0)
+ keystore.SetKey('suspend.automatic_pm', 0)
enabled = False
else:
- raise ValueError(_("Error in automatic pm argument, use on/off."))
+ raise ValueError(_('Error in automatic pm argument, use on/off.'))
client = gconf.client_get_default()
client.set_bool('/desktop/sugar/power/automatic', enabled)
@@ -111,13 +111,13 @@ def set_extreme_pm(enabled):
keystore = dbus.Interface(proxy, OHM_SERVICE_IFACE)
if enabled == 'on' or enabled == 1:
- keystore.SetKey("suspend.extreme_pm", 1)
+ keystore.SetKey('suspend.extreme_pm', 1)
enabled = True
elif enabled == 'off' or enabled == 0:
- keystore.SetKey("suspend.extreme_pm", 0)
+ keystore.SetKey('suspend.extreme_pm', 0)
enabled = False
else:
- raise ValueError(_("Error in extreme pm argument, use on/off."))
+ raise ValueError(_('Error in extreme pm argument, use on/off.'))
client = gconf.client_get_default()
client.set_bool('/desktop/sugar/power/extreme', enabled)
diff --git a/extensions/deviceicon/network.py b/extensions/deviceicon/network.py
index 417ac05..33b9eac 100644
--- a/extensions/deviceicon/network.py
+++ b/extensions/deviceicon/network.py
@@ -50,7 +50,7 @@ from jarabe.frame.frameinvoker import FrameWidgetInvoker
from jarabe.view.pulsingicon import PulsingIcon
-IP_ADDRESS_TEXT_TEMPLATE = _("IP address: %s")
+IP_ADDRESS_TEXT_TEMPLATE = _('IP address: %s')
_NM_SERVICE = 'org.freedesktop.NetworkManager'
_NM_IFACE = 'org.freedesktop.NetworkManager'
@@ -143,7 +143,7 @@ class WirelessPalette(Palette):
self._set_channel(channel)
def _set_channel(self, channel):
- self._channel_label.set_text("%s: %d" % (_("Channel"), channel))
+ self._channel_label.set_text('%s: %d' % (_('Channel'), channel))
def _set_ip_address(self, ip_address):
if ip_address is not None:
@@ -191,7 +191,7 @@ class WiredPalette(Palette):
def _inet_ntoa(self, iaddress):
address = ['%s' % ((iaddress >> i) % 256) for i in [0, 8, 16, 24]]
- return ".".join(address)
+ return '.'.join(address)
def _set_ip_address(self, ip_address):
if ip_address is not None:
@@ -349,8 +349,8 @@ class GsmPalette(Palette):
def update_stats(self, in_bytes, out_bytes):
in_KBytes = in_bytes / 1024
out_KBytes = out_bytes / 1024
- self._data_label_up.set_text(_("%d KB") % (out_KBytes))
- self._data_label_down.set_text(_("%d KB") % (in_KBytes))
+ self._data_label_up.set_text(_('%d KB') % (out_KBytes))
+ self._data_label_down.set_text(_('%d KB') % (in_KBytes))
def _get_error_by_nm_reason(self, reason):
if reason in [network.NM_DEVICE_STATE_REASON_NO_SECRETS,
@@ -392,8 +392,8 @@ class WirelessDeviceView(ToolButton):
self._icon = PulsingIcon()
self._icon.props.icon_name = get_icon_state('network-wireless', 0)
- self._inactive_color = xocolor.XoColor( \
- "%s,%s" % (style.COLOR_BUTTON_GREY.get_svg(),
+ self._inactive_color = xocolor.XoColor(
+ '%s,%s' % (style.COLOR_BUTTON_GREY.get_svg(),
style.COLOR_TRANSPARENT.get_svg()))
self._icon.props.pulse_color = self._inactive_color
self._icon.props.base_color = self._inactive_color
@@ -513,7 +513,7 @@ class WirelessDeviceView(ToolButton):
def _update(self):
if self._flags == network.NM_802_11_AP_FLAGS_PRIVACY:
- self._icon.props.badge_name = "emblem-locked"
+ self._icon.props.badge_name = 'emblem-locked'
else:
self._icon.props.badge_name = None
@@ -606,8 +606,8 @@ class OlpcMeshDeviceView(ToolButton):
self._channel = 0
self._icon = PulsingIcon(icon_name=self._ICON_NAME)
- self._inactive_color = xocolor.XoColor( \
- "%s,%s" % (style.COLOR_BUTTON_GREY.get_svg(),
+ self._inactive_color = xocolor.XoColor(
+ '%s,%s' % (style.COLOR_BUTTON_GREY.get_svg(),
style.COLOR_TRANSPARENT.get_svg()))
self._icon.props.pulse_color = profile.get_color()
self._icon.props.base_color = self._inactive_color
@@ -616,7 +616,7 @@ class OlpcMeshDeviceView(ToolButton):
self._icon.show()
self.set_palette_invoker(FrameWidgetInvoker(self))
- self._palette = WirelessPalette(_("Mesh Network"))
+ self._palette = WirelessPalette(_('Mesh Network'))
self._palette.connect('deactivate-connection',
self.__deactivate_connection)
self.set_palette(self._palette)
@@ -659,7 +659,7 @@ class OlpcMeshDeviceView(ToolButton):
def _update_text(self):
channel = str(self._channel)
- text = _("Mesh Network %s") % glib.markup_escape_text(channel)
+ text = _('Mesh Network %s') % glib.markup_escape_text(channel)
self._palette.props.primary_text = text
def _update(self):
diff --git a/extensions/deviceicon/speaker.py b/extensions/deviceicon/speaker.py
index 2eadf1d..b6e33d8 100644
--- a/extensions/deviceicon/speaker.py
+++ b/extensions/deviceicon/speaker.py
@@ -205,15 +205,15 @@ class DeviceModel(gobject.GObject):
return 'speaker'
def do_get_property(self, pspec):
- if pspec.name == "level":
+ if pspec.name == 'level':
return self._get_level()
- elif pspec.name == "muted":
+ elif pspec.name == 'muted':
return self._get_muted()
def do_set_property(self, pspec, value):
- if pspec.name == "level":
+ if pspec.name == 'level':
self._set_level(value)
- elif pspec.name == "muted":
+ elif pspec.name == 'muted':
self._set_muted(value)
diff --git a/extensions/globalkey/screenshot.py b/extensions/globalkey/screenshot.py
index b62806f..b9408d4 100644
--- a/extensions/globalkey/screenshot.py
+++ b/extensions/globalkey/screenshot.py
@@ -46,7 +46,7 @@ def handle_key_press(key):
height=height)
screenshot.get_from_drawable(window, window.get_colormap(), x_orig,
y_orig, 0, 0, width, height)
- screenshot.save(file_path, "png")
+ screenshot.save(file_path, 'png')
client = gconf.client_get_default()
color = client.get_string('/desktop/sugar/user/color')
diff --git a/src/jarabe/controlpanel/cmd.py b/src/jarabe/controlpanel/cmd.py
index e7ad6d0..4e5e8e8 100644
--- a/src/jarabe/controlpanel/cmd.py
+++ b/src/jarabe/controlpanel/cmd.py
@@ -26,10 +26,10 @@ from jarabe import config
_RESTART = 1
-_same_option_warning = _("sugar-control-panel: WARNING, found more than"
- " one option with the same name: %s module: %r")
-_no_option_error = _("sugar-control-panel: key=%s not an available option")
-_general_error = _("sugar-control-panel: %s")
+_same_option_warning = _('sugar-control-panel: WARNING, found more than one'
+ ' option with the same name: %s module: %r')
+_no_option_error = _('sugar-control-panel: key=%s not an available option')
+_general_error = _('sugar-control-panel: %s')
def cmd_help():
@@ -79,7 +79,7 @@ def load_modules():
def main():
try:
- options, args = getopt.getopt(sys.argv[1:], "h:s:g:c:l", [])
+ options, args = getopt.getopt(sys.argv[1:], 'h:s:g:c:l', [])
except getopt.GetoptError:
cmd_help()
sys.exit(2)
@@ -92,7 +92,7 @@ def main():
for option, key in options:
found = 0
- if option in ("-h"):
+ if option in ('-h'):
for module in modules:
method = getattr(module, 'set_' + key, None)
if method:
@@ -103,7 +103,7 @@ def main():
print _(_same_option_warning % (key, module))
if found == 0:
print _(_no_option_error % key)
- if option in ("-l"):
+ if option in ('-l'):
for module in modules:
methods = dir(module)
print '%s:' % module.__name__.split('.')[1]
@@ -111,9 +111,9 @@ def main():
if method.startswith('get_'):
print ' %s' % method[4:]
elif method.startswith('clear_'):
- print " %s (use the -c argument with this option)" \
+ print ' %s (use the -c argument with this option)' \
% method[6:]
- if option in ("-g"):
+ if option in ('-g'):
for module in modules:
method = getattr(module, 'print_' + key, None)
if method:
@@ -127,7 +127,7 @@ def main():
print _(_same_option_warning % (key, module))
if found == 0:
print _(_no_option_error % key)
- if option in ("-s"):
+ if option in ('-s'):
for module in modules:
method = getattr(module, 'set_' + key, None)
if method:
@@ -144,7 +144,7 @@ def main():
print _(_same_option_warning % (key, module))
if found == 0:
print _(_no_option_error % key)
- if option in ("-c"):
+ if option in ('-c'):
for module in modules:
method = getattr(module, 'clear_' + key, None)
if method:
diff --git a/src/jarabe/controlpanel/gui.py b/src/jarabe/controlpanel/gui.py
index d3cf8db..3c99c50 100644
--- a/src/jarabe/controlpanel/gui.py
+++ b/src/jarabe/controlpanel/gui.py
@@ -76,7 +76,7 @@ class ControlPanel(gtk.Window):
self.add(self._vbox)
self._vbox.show()
- self.connect("realize", self.__realize_cb)
+ self.connect('realize', self.__realize_cb)
self._options = self._get_options()
self._current_option = None
@@ -364,7 +364,7 @@ class ModelWrapper(object):
class _SectionIcon(gtk.EventBox):
- __gtype_name__ = "SugarSectionIcon"
+ __gtype_name__ = 'SugarSectionIcon'
__gproperties__ = {
'icon-name': (str, None, None, None, gobject.PARAM_READWRITE),
diff --git a/src/jarabe/desktop/activitieslist.py b/src/jarabe/desktop/activitieslist.py
index 4a92ed6..2494952 100644
--- a/src/jarabe/desktop/activitieslist.py
+++ b/src/jarabe/desktop/activitieslist.py
@@ -438,7 +438,7 @@ class ActivityListPalette(ActivityPalette):
else:
label.set_text(_('Make favorite'))
client = gconf.client_get_default()
- xo_color = XoColor(client.get_string("/desktop/sugar/user/color"))
+ xo_color = XoColor(client.get_string('/desktop/sugar/user/color'))
self._favorite_icon.props.xo_color = xo_color
diff --git a/src/jarabe/desktop/favoritesview.py b/src/jarabe/desktop/favoritesview.py
index 9af43cc..d79c2f4 100644
--- a/src/jarabe/desktop/favoritesview.py
+++ b/src/jarabe/desktop/favoritesview.py
@@ -645,7 +645,7 @@ class OwnerIcon(BuddyIcon):
class FavoritesSetting(object):
- _FAVORITES_KEY = "/desktop/sugar/desktop/favorites_layout"
+ _FAVORITES_KEY = '/desktop/sugar/desktop/favorites_layout'
def __init__(self):
client = gconf.client_get_default()
diff --git a/src/jarabe/desktop/groupbox.py b/src/jarabe/desktop/groupbox.py
index 8172f83..ed8f8ae 100644
--- a/src/jarabe/desktop/groupbox.py
+++ b/src/jarabe/desktop/groupbox.py
@@ -35,7 +35,7 @@ class GroupBox(hippo.Canvas):
__gtype_name__ = 'SugarGroupBox'
def __init__(self):
- logging.debug("STARTUP: Loading the group view")
+ logging.debug('STARTUP: Loading the group view')
gobject.GObject.__init__(self)
@@ -49,7 +49,7 @@ class GroupBox(hippo.Canvas):
self._box.set_layout(self._layout)
client = gconf.client_get_default()
- color = XoColor(client.get_string("/desktop/sugar/user/color"))
+ color = XoColor(client.get_string('/desktop/sugar/user/color'))
self._owner_icon = CanvasIcon(icon_name='computer-xo', cache=True,
xo_color=color)
diff --git a/src/jarabe/desktop/homebox.py b/src/jarabe/desktop/homebox.py
index 00eb250..661326e 100644
--- a/src/jarabe/desktop/homebox.py
+++ b/src/jarabe/desktop/homebox.py
@@ -41,7 +41,7 @@ class HomeBox(gtk.VBox):
__gtype_name__ = 'SugarHomeBox'
def __init__(self):
- logging.debug("STARTUP: Loading the home view")
+ logging.debug('STARTUP: Loading the home view')
gobject.GObject.__init__(self)
diff --git a/src/jarabe/desktop/homewindow.py b/src/jarabe/desktop/homewindow.py
index b0f648a..945a9c1 100644
--- a/src/jarabe/desktop/homewindow.py
+++ b/src/jarabe/desktop/homewindow.py
@@ -79,7 +79,7 @@ class HomeWindow(gtk.Window):
self.__zoom_level_changed_cb)
def _deactivate_view(self, level):
- group = palettegroup.get_group("default")
+ group = palettegroup.get_group('default')
group.popdown()
if level == ShellModel.ZOOM_HOME:
self._home_box.suspend()
diff --git a/src/jarabe/desktop/keydialog.py b/src/jarabe/desktop/keydialog.py
index 35b35e6..6241b9b 100644
--- a/src/jarabe/desktop/keydialog.py
+++ b/src/jarabe/desktop/keydialog.py
@@ -77,7 +77,7 @@ class KeyDialog(gtk.Dialog):
def __init__(self, ssid, flags, wpa_flags, rsn_flags, dev_caps, settings,
response):
gtk.Dialog.__init__(self, flags=gtk.DIALOG_MODAL)
- self.set_title("Wireless Key Required")
+ self.set_title('Wireless Key Required')
self._settings = settings
self._response = response
@@ -128,9 +128,9 @@ class WEPKeyDialog(KeyDialog):
# WEP key type
self.key_store = gtk.ListStore(str, int)
- self.key_store.append(["Passphrase (128-bit)", WEP_PASSPHRASE])
- self.key_store.append(["Hex (40/128-bit)", WEP_HEX])
- self.key_store.append(["ASCII (40/128-bit)", WEP_ASCII])
+ self.key_store.append(['Passphrase (128-bit)', WEP_PASSPHRASE])
+ self.key_store.append(['Hex (40/128-bit)', WEP_HEX])
+ self.key_store.append(['ASCII (40/128-bit)', WEP_ASCII])
self.key_combo = gtk.ComboBox(self.key_store)
cell = gtk.CellRendererText()
@@ -140,7 +140,7 @@ class WEPKeyDialog(KeyDialog):
self.key_combo.connect('changed', self._key_combo_changed_cb)
hbox = gtk.HBox()
- hbox.pack_start(gtk.Label(_("Key Type:")))
+ hbox.pack_start(gtk.Label(_('Key Type:')))
hbox.pack_start(self.key_combo)
hbox.show_all()
self.vbox.pack_start(hbox)
@@ -150,8 +150,8 @@ class WEPKeyDialog(KeyDialog):
# WEP authentication mode
self.auth_store = gtk.ListStore(str, str)
- self.auth_store.append(["Open System", IW_AUTH_ALG_OPEN_SYSTEM])
- self.auth_store.append(["Shared Key", IW_AUTH_ALG_SHARED_KEY])
+ self.auth_store.append(['Open System', IW_AUTH_ALG_OPEN_SYSTEM])
+ self.auth_store.append(['Shared Key', IW_AUTH_ALG_SHARED_KEY])
self.auth_combo = gtk.ComboBox(self.auth_store)
cell = gtk.CellRendererText()
@@ -160,7 +160,7 @@ class WEPKeyDialog(KeyDialog):
self.auth_combo.set_active(0)
hbox = gtk.HBox()
- hbox.pack_start(gtk.Label(_("Authentication Type:")))
+ hbox.pack_start(gtk.Label(_('Authentication Type:')))
hbox.pack_start(self.auth_combo)
hbox.show_all()
@@ -187,8 +187,8 @@ class WEPKeyDialog(KeyDialog):
def print_security(self):
(key, auth_alg) = self._get_security()
- print "Key: %s" % key
- print "Auth: %d" % auth_alg
+ print 'Key: %s' % key
+ print 'Auth: %d' % auth_alg
def create_security(self):
(key, auth_alg) = self._get_security()
@@ -226,7 +226,7 @@ class WPAKeyDialog(KeyDialog):
self.add_key_entry()
self.store = gtk.ListStore(str)
- self.store.append([_("WPA & WPA2 Personal")])
+ self.store.append([_('WPA & WPA2 Personal')])
self.combo = gtk.ComboBox(self.store)
cell = gtk.CellRendererText()
@@ -235,7 +235,7 @@ class WPAKeyDialog(KeyDialog):
self.combo.set_active(0)
self.hbox = gtk.HBox()
- self.hbox.pack_start(gtk.Label(_("Wireless Security:")))
+ self.hbox.pack_start(gtk.Label(_('Wireless Security:')))
self.hbox.pack_start(self.combo)
self.hbox.show_all()
@@ -255,21 +255,21 @@ class WPAKeyDialog(KeyDialog):
from subprocess import Popen, PIPE
p = Popen(['wpa_passphrase', ssid, key], stdout=PIPE)
for line in p.stdout:
- if line.strip().startswith("psk="):
+ if line.strip().startswith('psk='):
real_key = line.strip()[4:]
if p.wait() != 0:
- raise RuntimeError("Error hashing passphrase")
+ raise RuntimeError('Error hashing passphrase')
if real_key and len(real_key) != 64:
real_key = None
if not real_key:
- raise RuntimeError("Invalid key")
+ raise RuntimeError('Invalid key')
return real_key
def print_security(self):
key = self._get_security()
- print "Key: %s" % key
+ print 'Key: %s' % key
def create_security(self):
secrets = Secrets(self._settings)
@@ -300,8 +300,8 @@ def create(ssid, flags, wpa_flags, rsn_flags, dev_caps, settings, response):
key_dialog = WPAKeyDialog(ssid, flags, wpa_flags, rsn_flags,
dev_caps, settings, response)
- key_dialog.connect("response", _key_dialog_response_cb)
- key_dialog.connect("destroy", _key_dialog_destroy_cb)
+ key_dialog.connect('response', _key_dialog_response_cb)
+ key_dialog.connect('destroy', _key_dialog_destroy_cb)
key_dialog.show_all()
@@ -320,9 +320,9 @@ def _key_dialog_response_cb(key_dialog, response_id):
response.set_error(CanceledKeyRequestError())
elif response_id == gtk.RESPONSE_OK:
if not secrets:
- raise RuntimeError("Invalid security arguments.")
+ raise RuntimeError('Invalid security arguments.')
response.set_secrets(secrets)
else:
- raise RuntimeError("Unhandled key dialog response %d" % response_id)
+ raise RuntimeError('Unhandled key dialog response %d' % response_id)
key_dialog.destroy()
diff --git a/src/jarabe/desktop/meshbox.py b/src/jarabe/desktop/meshbox.py
index 50b8a3f..a8180bd 100644
--- a/src/jarabe/desktop/meshbox.py
+++ b/src/jarabe/desktop/meshbox.py
@@ -402,7 +402,7 @@ class MeshBox(gtk.VBox):
__gtype_name__ = 'SugarMeshBox'
def __init__(self):
- logging.debug("STARTUP: Loading the mesh view")
+ logging.debug('STARTUP: Loading the mesh view')
gobject.GObject.__init__(self)
@@ -545,8 +545,8 @@ class MeshBox(gtk.VBox):
# if we have mesh hardware, ignore OLPC mesh networks that appear as
# normal wifi networks
if len(self._mesh) > 0 and ap.mode == network.NM_802_11_MODE_ADHOC \
- and ap.name == "olpc-mesh":
- logging.debug("ignoring OLPC mesh IBSS")
+ and ap.name == 'olpc-mesh':
+ logging.debug('ignoring OLPC mesh IBSS')
ap.disconnect()
return
@@ -640,7 +640,7 @@ class MeshBox(gtk.VBox):
if not net.is_olpc_mesh():
continue
- logging.debug("removing OLPC mesh IBSS")
+ logging.debug('removing OLPC mesh IBSS')
net.remove_all_aps()
net.disconnect()
self._layout.remove(net)
diff --git a/src/jarabe/desktop/networkviews.py b/src/jarabe/desktop/networkviews.py
index 20cb2bd..e1cfc13 100644
--- a/src/jarabe/desktop/networkviews.py
+++ b/src/jarabe/desktop/networkviews.py
@@ -104,11 +104,11 @@ class WirelessNetworkView(CanvasPulsingIcon):
if self._mode != network.NM_802_11_MODE_ADHOC:
if network.find_connection_by_ssid(self._name) is not None:
- self.props.badge_name = "emblem-favorite"
- self._palette_icon.props.badge_name = "emblem-favorite"
+ self.props.badge_name = 'emblem-favorite'
+ self._palette_icon.props.badge_name = 'emblem-favorite'
elif self._flags == network.NM_802_11_AP_FLAGS_PRIVACY:
- self.props.badge_name = "emblem-locked"
- self._palette_icon.props.badge_name = "emblem-locked"
+ self.props.badge_name = 'emblem-locked'
+ self._palette_icon.props.badge_name = 'emblem-locked'
else:
self.props.badge_name = None
self._palette_icon.props.badge_name = None
@@ -269,18 +269,18 @@ class WirelessNetworkView(CanvasPulsingIcon):
ciphers = []
if pairwise:
if flags & network.NM_802_11_AP_SEC_PAIR_TKIP:
- ciphers.append("tkip")
+ ciphers.append('tkip')
if flags & network.NM_802_11_AP_SEC_PAIR_CCMP:
- ciphers.append("ccmp")
+ ciphers.append('ccmp')
else:
if flags & network.NM_802_11_AP_SEC_GROUP_WEP40:
- ciphers.append("wep40")
+ ciphers.append('wep40')
if flags & network.NM_802_11_AP_SEC_GROUP_WEP104:
- ciphers.append("wep104")
+ ciphers.append('wep104')
if flags & network.NM_802_11_AP_SEC_GROUP_TKIP:
- ciphers.append("tkip")
+ ciphers.append('tkip')
if flags & network.NM_802_11_AP_SEC_GROUP_CCMP:
- ciphers.append("ccmp")
+ ciphers.append('ccmp')
return ciphers
def _get_security(self):
@@ -364,7 +364,7 @@ class WirelessNetworkView(CanvasPulsingIcon):
netmgr.ActivateConnection(network.SETTINGS_SERVICE, connection.path,
self._device.object_path,
- "/",
+ '/',
reply_handler=self.__activate_reply_cb,
error_handler=self.__activate_error_cb)
@@ -421,7 +421,7 @@ class WirelessNetworkView(CanvasPulsingIcon):
def is_olpc_mesh(self):
return self._mode == network.NM_802_11_MODE_ADHOC \
- and self.name == "olpc-mesh"
+ and self.name == 'olpc-mesh'
def remove_all_aps(self):
for ap in self._access_points.values():
@@ -486,7 +486,7 @@ class SugarAdhocView(CanvasPulsingIcon):
icon_name=self._ICON_NAME + str(self._channel),
icon_size=style.STANDARD_ICON_SIZE)
- palette_ = palette.Palette(_("Ad-hoc Network %d") % self._channel,
+ palette_ = palette.Palette(_('Ad-hoc Network %d') % self._channel,
icon=self._palette_icon)
self._connect_item = MenuItem(_('Connect'), 'dialog-ok')
@@ -619,7 +619,7 @@ class OlpcMeshView(CanvasPulsingIcon):
self.set_palette(self._palette)
def _create_palette(self):
- _palette = palette.Palette(_("Mesh Network %d") % self._channel)
+ _palette = palette.Palette(_('Mesh Network %d') % self._channel)
self._connect_item = MenuItem(_('Connect'), 'dialog-ok')
self._connect_item.connect('activate', self.__connect_activate_cb)
diff --git a/src/jarabe/frame/activitiestray.py b/src/jarabe/frame/activitiestray.py
index 55ff8f7..6e08fc0 100644
--- a/src/jarabe/frame/activitiestray.py
+++ b/src/jarabe/frame/activitiestray.py
@@ -449,7 +449,7 @@ class OutgoingTransferButton(BaseTransferButton):
break
client = gconf.client_get_default()
- icon_color = XoColor(client.get_string("/desktop/sugar/user/color"))
+ icon_color = XoColor(client.get_string('/desktop/sugar/user/color'))
self.props.icon_widget.props.xo_color = icon_color
self.notif_icon.props.xo_color = icon_color
@@ -471,7 +471,7 @@ class OutgoingTransferButton(BaseTransferButton):
class BaseTransferPalette(Palette):
"""Base palette class for frame or notification icon for file transfers
"""
- __gtype_name__ = "SugarBaseTransferPalette"
+ __gtype_name__ = 'SugarBaseTransferPalette'
__gsignals__ = {
'dismiss-clicked': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ([])),
@@ -533,7 +533,7 @@ class BaseTransferPalette(Palette):
class IncomingTransferPalette(BaseTransferPalette):
"""Palette for frame or notification icon for incoming file transfers
"""
- __gtype_name__ = "SugarIncomingTransferPalette"
+ __gtype_name__ = 'SugarIncomingTransferPalette'
def __init__(self, file_transfer):
BaseTransferPalette.__init__(self, file_transfer)
@@ -661,7 +661,7 @@ class IncomingTransferPalette(BaseTransferPalette):
class OutgoingTransferPalette(BaseTransferPalette):
"""Palette for frame or notification icon for outgoing file transfers
"""
- __gtype_name__ = "SugarOutgoingTransferPalette"
+ __gtype_name__ = 'SugarOutgoingTransferPalette'
def __init__(self, file_transfer):
BaseTransferPalette.__init__(self, file_transfer)
diff --git a/src/jarabe/frame/clipboard.py b/src/jarabe/frame/clipboard.py
index 308ac39..65872ef 100644
--- a/src/jarabe/frame/clipboard.py
+++ b/src/jarabe/frame/clipboard.py
@@ -86,9 +86,9 @@ class Clipboard(gobject.GObject):
def set_object_percent(self, object_id, percent):
cb_object = self._objects[object_id]
if percent < 0 or percent > 100:
- raise ValueError("invalid percentage")
+ raise ValueError('invalid percentage')
if cb_object.get_percent() > percent:
- raise ValueError("invalid percentage; less than current percent")
+ raise ValueError('invalid percentage; less than current percent')
if cb_object.get_percent() == percent:
# ignore setting same percentage
return
diff --git a/src/jarabe/frame/clipboardpanelwindow.py b/src/jarabe/frame/clipboardpanelwindow.py
index f7a28a6..f5d537c 100644
--- a/src/jarabe/frame/clipboardpanelwindow.py
+++ b/src/jarabe/frame/clipboardpanelwindow.py
@@ -36,7 +36,7 @@ class ClipboardPanelWindow(FrameWindow):
# NOTE: we need to keep a reference to gtk.Clipboard in order to keep
# listening to it.
self._clipboard = gtk.Clipboard()
- self._clipboard.connect("owner-change", self._owner_change_cb)
+ self._clipboard.connect('owner-change', self._owner_change_cb)
self._clipboard_tray = ClipboardTray()
canvas_widget = hippo.CanvasWidget(widget=self._clipboard_tray)
@@ -44,14 +44,14 @@ class ClipboardPanelWindow(FrameWindow):
# Receiving dnd drops
self.drag_dest_set(0, [], 0)
- self.connect("drag_motion", self._clipboard_tray.drag_motion_cb)
- self.connect("drag_leave", self._clipboard_tray.drag_leave_cb)
- self.connect("drag_drop", self._clipboard_tray.drag_drop_cb)
- self.connect("drag_data_received",
+ self.connect('drag_motion', self._clipboard_tray.drag_motion_cb)
+ self.connect('drag_leave', self._clipboard_tray.drag_leave_cb)
+ self.connect('drag_drop', self._clipboard_tray.drag_drop_cb)
+ self.connect('drag_data_received',
self._clipboard_tray.drag_data_received_cb)
def _owner_change_cb(self, x_clipboard, event):
- logging.debug("owner_change_cb")
+ logging.debug('owner_change_cb')
if self._clipboard_tray.owns_clipboard():
return
diff --git a/src/jarabe/frame/devicestray.py b/src/jarabe/frame/devicestray.py
index e23d883..cecde8f 100644
--- a/src/jarabe/frame/devicestray.py
+++ b/src/jarabe/frame/devicestray.py
@@ -41,7 +41,7 @@ class DevicesTray(tray.HTray):
def add_device(self, view):
index = 0
- relative_index = getattr(view, "FRAME_POSITION_RELATIVE", -1)
+ relative_index = getattr(view, 'FRAME_POSITION_RELATIVE', -1)
for item in self.get_children():
current_relative_index = getattr(item, 'FRAME_POSITION_RELATIVE',
0)
diff --git a/src/jarabe/frame/frame.py b/src/jarabe/frame/frame.py
index 8d56de1..079eeeb 100644
--- a/src/jarabe/frame/frame.py
+++ b/src/jarabe/frame/frame.py
@@ -101,7 +101,7 @@ class Frame(object):
MODE_NON_INTERACTIVE = 2
def __init__(self):
- logging.debug("STARTUP: Loading the frame")
+ logging.debug('STARTUP: Loading the frame')
self.mode = None
self._palette_group = palettegroup.get_group('frame')
diff --git a/src/jarabe/intro/window.py b/src/jarabe/intro/window.py
index 168fbc5..ad6e9be 100644
--- a/src/jarabe/intro/window.py
+++ b/src/jarabe/intro/window.py
@@ -44,23 +44,23 @@ def create_profile(name, color=None, pixbuf=None):
if not color:
color = XoColor()
- icon_path = os.path.join(env.get_profile_path(), "buddy-icon.jpg")
- pixbuf.save(icon_path, "jpeg", {"quality": "85"})
+ icon_path = os.path.join(env.get_profile_path(), 'buddy-icon.jpg')
+ pixbuf.save(icon_path, 'jpeg', {'quality': '85'})
client = gconf.client_get_default()
- client.set_string("/desktop/sugar/user/nick", name)
- client.set_string("/desktop/sugar/user/color", color.to_string())
+ client.set_string('/desktop/sugar/user/nick', name)
+ client.set_string('/desktop/sugar/user/color', color.to_string())
# Generate keypair
import commands
- keypath = os.path.join(env.get_profile_path(), "owner.key")
+ keypath = os.path.join(env.get_profile_path(), 'owner.key')
if not os.path.isfile(keypath):
cmd = "ssh-keygen -q -t dsa -f %s -C '' -N ''" % keypath
(s, o) = commands.getstatusoutput(cmd)
if s != 0:
- logging.error("Could not generate key pair: %d %s", s, o)
+ logging.error('Could not generate key pair: %d %s', s, o)
else:
- logging.error("Keypair exists, skip generation.")
+ logging.error('Keypair exists, skip generation.')
class _Page(hippo.CanvasBox):
@@ -93,7 +93,7 @@ class _NamePage(_Page):
self._intro = intro
- label = hippo.CanvasText(text=_("Name:"))
+ label = hippo.CanvasText(text=_('Name:'))
self.append(label)
self._entry = CanvasEntry(box_width=style.zoom(300))
@@ -129,7 +129,7 @@ class _ColorPage(_Page):
spacing=style.DEFAULT_SPACING,
yalign=hippo.ALIGNMENT_CENTER, **kwargs)
- self._label = hippo.CanvasText(text=_("Click to change color:"),
+ self._label = hippo.CanvasText(text=_('Click to change color:'),
xalign=hippo.ALIGNMENT_CENTER)
self.append(self._label)
@@ -288,16 +288,16 @@ class IntroWindow(gtk.Window):
return False
def __key_press_cb(self, widget, event):
- if gtk.gdk.keyval_name(event.keyval) == "Return":
+ if gtk.gdk.keyval_name(event.keyval) == 'Return':
self._intro_box.next()
return True
- elif gtk.gdk.keyval_name(event.keyval) == "Escape":
+ elif gtk.gdk.keyval_name(event.keyval) == 'Escape':
self._intro_box.back()
return True
return False
-if __name__ == "__main__":
+if __name__ == '__main__':
w = IntroWindow()
w.show()
w.connect('destroy', gtk.main_quit)
diff --git a/src/jarabe/journal/journalactivity.py b/src/jarabe/journal/journalactivity.py
index 6e061cc..595a8ea 100644
--- a/src/jarabe/journal/journalactivity.py
+++ b/src/jarabe/journal/journalactivity.py
@@ -100,18 +100,18 @@ class JournalActivityDBusService(dbus.service.Object):
return chooser_id
- @dbus.service.signal(J_DBUS_INTERFACE, signature="ss")
+ @dbus.service.signal(J_DBUS_INTERFACE, signature='ss')
def ObjectChooserResponse(self, chooser_id, object_id):
pass
- @dbus.service.signal(J_DBUS_INTERFACE, signature="s")
+ @dbus.service.signal(J_DBUS_INTERFACE, signature='s')
def ObjectChooserCancelled(self, chooser_id):
pass
class JournalActivity(JournalWindow):
def __init__(self):
- logging.debug("STARTUP: Loading the journal")
+ logging.debug('STARTUP: Loading the journal')
JournalWindow.__init__(self)
self.set_title(_('Journal'))
diff --git a/src/jarabe/journal/misc.py b/src/jarabe/journal/misc.py
index f323676..05ed1b6 100644
--- a/src/jarabe/journal/misc.py
+++ b/src/jarabe/journal/misc.py
@@ -94,7 +94,7 @@ def get_date(metadata):
return util.timestamp_to_elapsed_string(timestamp)
if 'mtime' in metadata:
- ti = time.strptime(metadata['mtime'], "%Y-%m-%dT%H:%M:%S")
+ ti = time.strptime(metadata['mtime'], '%Y-%m-%dT%H:%M:%S')
return util.timestamp_to_elapsed_string(time.mktime(ti))
return _('No date')
diff --git a/src/jarabe/journal/modalalert.py b/src/jarabe/journal/modalalert.py
index 877b11a..6880941 100644
--- a/src/jarabe/journal/modalalert.py
+++ b/src/jarabe/journal/modalalert.py
@@ -85,7 +85,7 @@ class ModalAlert(gtk.Window):
self.add(self._main_view)
self._main_view.show()
- self.connect("realize", self.__realize_cb)
+ self.connect('realize', self.__realize_cb)
def __realize_cb(self, widget):
self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG)
diff --git a/src/jarabe/model/adhoc.py b/src/jarabe/model/adhoc.py
index 88e1bbc..62090f7 100644
--- a/src/jarabe/model/adhoc.py
+++ b/src/jarabe/model/adhoc.py
@@ -160,7 +160,7 @@ class AdHocManager(gobject.GObject):
def __idle_check_cb(self):
if self._device_state == network.DEVICE_STATE_DISCONNECTED:
- logging.debug("Connect to Ad-hoc network due to inactivity.")
+ logging.debug('Connect to Ad-hoc network due to inactivity.')
self._autoconnect_adhoc()
return False
@@ -188,7 +188,7 @@ class AdHocManager(gobject.GObject):
self._connect(channel)
def _connect(self, channel):
- name = "Ad-hoc Network %d" % channel
+ name = 'Ad-hoc Network %d' % channel
connection = network.find_connection_by_ssid(name)
if connection is None:
settings = Settings()
diff --git a/src/jarabe/model/friends.py b/src/jarabe/model/friends.py
index f2815bd..f17eb43 100644
--- a/src/jarabe/model/friends.py
+++ b/src/jarabe/model/friends.py
@@ -34,7 +34,7 @@ _model = None
class FriendBuddyModel(BuddyModel):
__gtype_name__ = 'SugarFriendBuddyModel'
- _NOT_PRESENT_COLOR = "#D5D5D5,#FFFFFF"
+ _NOT_PRESENT_COLOR = '#D5D5D5,#FFFFFF'
def __init__(self, nick, key):
self._online_buddy = None
diff --git a/src/jarabe/model/network.py b/src/jarabe/model/network.py
index cfb04a6..4d999da 100644
--- a/src/jarabe/model/network.py
+++ b/src/jarabe/model/network.py
@@ -155,89 +155,89 @@ def get_error_by_reason(reason):
if _nm_device_state_reason_description is None:
_nm_device_state_reason_description = {
NM_DEVICE_STATE_REASON_UNKNOWN:
- _("The reason for the device state change is unknown."),
+ _('The reason for the device state change is unknown.'),
NM_DEVICE_STATE_REASON_NONE:
- _("The state change is normal."),
+ _('The state change is normal.'),
NM_DEVICE_STATE_REASON_NOW_MANAGED:
- _("The device is now managed."),
+ _('The device is now managed.'),
NM_DEVICE_STATE_REASON_NOW_UNMANAGED:
- _("The device is no longer managed."),
+ _('The device is no longer managed.'),
NM_DEVICE_STATE_REASON_CONFIG_FAILED:
- _("The device could not be readied for configuration."),
+ _('The device could not be readied for configuration.'),
NM_DEVICE_STATE_REASON_CONFIG_UNAVAILABLE:
- _("IP configuration could not be reserved "
- "(no available address, timeout, etc)."),
+ _('IP configuration could not be reserved '
+ '(no available address, timeout, etc).'),
NM_DEVICE_STATE_REASON_CONFIG_EXPIRED:
- _("The IP configuration is no longer valid."),
+ _('The IP configuration is no longer valid.'),
NM_DEVICE_STATE_REASON_NO_SECRETS:
- _("Secrets were required, but not provided."),
+ _('Secrets were required, but not provided.'),
NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT:
- _("The 802.1X supplicant disconnected from "
- "the access point or authentication server."),
+ _('The 802.1X supplicant disconnected from '
+ 'the access point or authentication server.'),
NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED:
- _("Configuration of the 802.1X supplicant failed."),
+ _('Configuration of the 802.1X supplicant failed.'),
NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED:
- _("The 802.1X supplicant quit or failed unexpectedly."),
+ _('The 802.1X supplicant quit or failed unexpectedly.'),
NM_DEVICE_STATE_REASON_SUPPLICANT_TIMEOUT:
- _("The 802.1X supplicant took too long to authenticate."),
+ _('The 802.1X supplicant took too long to authenticate.'),
NM_DEVICE_STATE_REASON_PPP_START_FAILED:
- _("The PPP service failed to start within the allowed time."),
+ _('The PPP service failed to start within the allowed time.'),
NM_DEVICE_STATE_REASON_PPP_DISCONNECT:
- _("The PPP service disconnected unexpectedly."),
+ _('The PPP service disconnected unexpectedly.'),
NM_DEVICE_STATE_REASON_PPP_FAILED:
- _("The PPP service quit or failed unexpectedly."),
+ _('The PPP service quit or failed unexpectedly.'),
NM_DEVICE_STATE_REASON_DHCP_START_FAILED:
- _("The DHCP service failed to start within the allowed time."),
+ _('The DHCP service failed to start within the allowed time.'),
NM_DEVICE_STATE_REASON_DHCP_ERROR:
- _("The DHCP service reported an unexpected error."),
+ _('The DHCP service reported an unexpected error.'),
NM_DEVICE_STATE_REASON_DHCP_FAILED:
- _("The DHCP service quit or failed unexpectedly."),
+ _('The DHCP service quit or failed unexpectedly.'),
NM_DEVICE_STATE_REASON_SHARED_START_FAILED:
- _("The shared connection service failed to start."),
+ _('The shared connection service failed to start.'),
NM_DEVICE_STATE_REASON_SHARED_FAILED:
- _("The shared connection service quit or "
- "failed unexpectedly."),
+ _('The shared connection service quit or failed'
+ ' unexpectedly.'),
NM_DEVICE_STATE_REASON_AUTOIP_START_FAILED:
- _("The AutoIP service failed to start."),
+ _('The AutoIP service failed to start.'),
NM_DEVICE_STATE_REASON_AUTOIP_ERROR:
- _("The AutoIP service reported an unexpected error."),
+ _('The AutoIP service reported an unexpected error.'),
NM_DEVICE_STATE_REASON_AUTOIP_FAILED:
- _("The AutoIP service quit or failed unexpectedly."),
+ _('The AutoIP service quit or failed unexpectedly.'),
NM_DEVICE_STATE_REASON_MODEM_BUSY:
- _("Dialing failed because the line was busy."),
+ _('Dialing failed because the line was busy.'),
NM_DEVICE_STATE_REASON_MODEM_NO_DIAL_TONE:
- _("Dialing failed because there was no dial tone."),
+ _('Dialing failed because there was no dial tone.'),
NM_DEVICE_STATE_REASON_MODEM_NO_CARRIER:
- _("Dialing failed because there was no carrier."),
+ _('Dialing failed because there was no carrier.'),
NM_DEVICE_STATE_REASON_MODEM_DIAL_TIMEOUT:
- _("Dialing timed out."),
+ _('Dialing timed out.'),
NM_DEVICE_STATE_REASON_MODEM_DIAL_FAILED:
- _("Dialing failed."),
+ _('Dialing failed.'),
NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED:
- _("Modem initialization failed."),
+ _('Modem initialization failed.'),
NM_DEVICE_STATE_REASON_GSM_APN_FAILED:
- _("Failed to select the specified GSM APN."),
+ _('Failed to select the specified GSM APN'),
NM_DEVICE_STATE_REASON_GSM_REGISTRATION_NOT_SEARCHING:
- _("Not searching for networks."),
+ _('Not searching for networks.'),
NM_DEVICE_STATE_REASON_GSM_REGISTRATION_DENIED:
- _("Network registration was denied."),
+ _('Network registration was denied.'),
NM_DEVICE_STATE_REASON_GSM_REGISTRATION_TIMEOUT:
- _("Network registration timed out."),
+ _('Network registration timed out.'),
NM_DEVICE_STATE_REASON_GSM_REGISTRATION_FAILED:
- _("Failed to register with the requested GSM network."),
+ _('Failed to register with the requested GSM network.'),
NM_DEVICE_STATE_REASON_GSM_PIN_CHECK_FAILED:
- _("PIN check failed."),
+ _('PIN check failed.'),
NM_DEVICE_STATE_REASON_FIRMWARE_MISSING:
- _("Necessary firmware for the device may be missing."),
+ _('Necessary firmware for the device may be missing.'),
NM_DEVICE_STATE_REASON_REMOVED:
- _("The device was removed."),
+ _('The device was removed.'),
NM_DEVICE_STATE_REASON_SLEEPING:
- _("NetworkManager went to sleep."),
+ _('NetworkManager went to sleep.'),
NM_DEVICE_STATE_REASON_CONNECTION_REMOVED:
_("The device's active connection was removed "
"or disappeared."),
NM_DEVICE_STATE_REASON_USER_REQUESTED:
- _("A user or client requested the disconnection."),
+ _('A user or client requested the disconnection.'),
NM_DEVICE_STATE_REASON_CARRIER:
_("The device's carrier/link changed.")}
@@ -259,8 +259,8 @@ def frequency_to_channel(frequency):
2452: 9, 2457: 10, 2462: 11, 2467: 12,
2472: 13}
if frequency not in ftoc:
- logging.warning("The frequency %s can not be mapped to a channel, " \
- "defaulting to channel 1.", frequency)
+ logging.warning('The frequency %s can not be mapped to a channel, '
+ 'defaulting to channel 1.', frequency)
return 1
return ftoc[frequency]
@@ -298,7 +298,7 @@ class WirelessSecurity(object):
class Wireless(object):
- nm_name = "802-11-wireless"
+ nm_name = '802-11-wireless'
def __init__(self):
self.ssid = None
@@ -321,7 +321,7 @@ class Wireless(object):
class OlpcMesh(object):
- nm_name = "802-11-olpc-mesh"
+ nm_name = '802-11-olpc-mesh'
def __init__(self, channel, anycast_addr):
self.channel = channel
@@ -329,12 +329,12 @@ class OlpcMesh(object):
def get_dict(self):
ret = {
- "ssid": dbus.ByteArray("olpc-mesh"),
- "channel": self.channel,
+ 'ssid': dbus.ByteArray('olpc-mesh'),
+ 'channel': self.channel,
}
if self.anycast_addr:
- ret["dhcp-anycast-address"] = dbus.ByteArray(self.anycast_addr)
+ ret['dhcp-anycast-address'] = dbus.ByteArray(self.anycast_addr)
return ret
@@ -737,7 +737,7 @@ class AccessPoint(gobject.GObject):
else:
fl |= 1 << 6
- hashstr = str(fl) + "@" + self.name
+ hashstr = str(fl) + '@' + self.name
return hash(hashstr)
def _update_properties(self, properties):
@@ -915,7 +915,7 @@ def load_gsm_connection():
except Exception:
logging.exception('Error adding gsm connection to NMSettings.')
else:
- logging.exception("No gsm connection was set in GConf.")
+ logging.exception('No gsm connection was set in GConf.')
def load_connections():
diff --git a/src/jarabe/model/notifications.py b/src/jarabe/model/notifications.py
index 0b8cb44..ec14056 100644
--- a/src/jarabe/model/notifications.py
+++ b/src/jarabe/model/notifications.py
@@ -24,9 +24,9 @@ from sugar import dispatch
from jarabe import config
-_DBUS_SERVICE = "org.freedesktop.Notifications"
-_DBUS_IFACE = "org.freedesktop.Notifications"
-_DBUS_PATH = "/org/freedesktop/Notifications"
+_DBUS_SERVICE = 'org.freedesktop.Notifications'
+_DBUS_IFACE = 'org.freedesktop.Notifications'
+_DBUS_PATH = '/org/freedesktop/Notifications'
_instance = None
@@ -78,11 +78,11 @@ class NotificationService(dbus.service.Object):
def GetServerInformation(self, name, vendor, version):
return 'Sugar Shell', 'Sugar', config.version
- @dbus.service.signal(_DBUS_IFACE, signature="uu")
+ @dbus.service.signal(_DBUS_IFACE, signature='uu')
def NotificationClosed(self, notification_id, reason):
pass
- @dbus.service.signal(_DBUS_IFACE, signature="us")
+ @dbus.service.signal(_DBUS_IFACE, signature='us')
def ActionInvoked(self, notification_id, action_key):
pass
diff --git a/src/jarabe/model/olpcmesh.py b/src/jarabe/model/olpcmesh.py
index ceb7e37..4cf837b 100644
--- a/src/jarabe/model/olpcmesh.py
+++ b/src/jarabe/model/olpcmesh.py
@@ -31,7 +31,7 @@ _NM_PATH = '/org/freedesktop/NetworkManager'
_NM_DEVICE_IFACE = 'org.freedesktop.NetworkManager.Device'
_NM_OLPC_MESH_IFACE = 'org.freedesktop.NetworkManager.Device.OlpcMesh'
-_XS_ANYCAST = "\xc0\x27\xc0\x27\xc0\x00"
+_XS_ANYCAST = '\xc0\x27\xc0\x27\xc0\x00'
DEVICE_STATE_UNKNOWN = 0
DEVICE_STATE_UNMANAGED = 1
@@ -149,7 +149,7 @@ class OlpcMeshManager(object):
def _idle_check(self):
if self._mesh_device_state == DEVICE_STATE_DISCONNECTED \
and self._eth_device_state == DEVICE_STATE_DISCONNECTED:
- logging.debug("starting automesh due to inactivity")
+ logging.debug('starting automesh due to inactivity')
self._start_automesh()
return False
@@ -172,7 +172,7 @@ class OlpcMeshManager(object):
logging.error('Failed to activate connection: %s', err)
def _activate_connection(self, channel, anycast_address=None):
- logging.debug("activate channel %d anycast %r",
+ logging.debug('activate channel %d anycast %r',
channel, anycast_address)
proxy = self._bus.get_object(_NM_SERVICE, _NM_PATH)
network_manager = dbus.Interface(proxy, _NM_IFACE)
diff --git a/src/jarabe/model/screen.py b/src/jarabe/model/screen.py
index 965317d..7d34d45 100644
--- a/src/jarabe/model/screen.py
+++ b/src/jarabe/model/screen.py
@@ -40,6 +40,6 @@ def _get_ohm():
def set_dcon_freeze(frozen):
try:
- _get_ohm().SetKey("display.dcon_freeze", frozen)
+ _get_ohm().SetKey('display.dcon_freeze', frozen)
except dbus.DBusException:
logging.error('Cannot unfreeze the DCON')
diff --git a/src/jarabe/model/shell.py b/src/jarabe/model/shell.py
index 3c8b4db..661e370 100644
--- a/src/jarabe/model/shell.py
+++ b/src/jarabe/model/shell.py
@@ -31,9 +31,9 @@ from sugar.graphics.xocolor import XoColor
from jarabe.model.bundleregistry import get_registry
from jarabe.model import neighborhood
-_SERVICE_NAME = "org.laptop.Activity"
-_SERVICE_PATH = "/org/laptop/Activity"
-_SERVICE_INTERFACE = "org.laptop.Activity"
+_SERVICE_NAME = 'org.laptop.Activity'
+_SERVICE_PATH = '/org/laptop/Activity'
+_SERVICE_INTERFACE = 'org.laptop.Activity'
_model = None
@@ -83,8 +83,8 @@ class Activity(gobject.GObject):
bus = dbus.SessionBus()
self._name_owner_changed_handler = bus.add_signal_receiver(
self._name_owner_changed_cb,
- signal_name="NameOwnerChanged",
- dbus_interface="org.freedesktop.DBus")
+ signal_name='NameOwnerChanged',
+ dbus_interface='org.freedesktop.DBus')
self._launch_completed_hid = get_model().connect('launch-completed',
self.__launch_completed_cb)
@@ -103,7 +103,7 @@ class Activity(gobject.GObject):
can replace the launcher once we get its real window.
"""
if not window:
- raise ValueError("window must be valid")
+ raise ValueError('window must be valid')
self._window = window
def get_service(self):
@@ -159,7 +159,7 @@ class Activity(gobject.GObject):
return activity.props.color
else:
client = gconf.client_get_default()
- return XoColor(client.get_string("/desktop/sugar/user/color"))
+ return XoColor(client.get_string('/desktop/sugar/user/color'))
def get_activity_id(self):
"""Retrieve the "activity_id" passed in to our constructor
@@ -247,7 +247,7 @@ class Activity(gobject.GObject):
try:
bus = dbus.SessionBus()
proxy = bus.get_object(self._get_service_name(),
- _SERVICE_PATH + "/" + self._activity_id)
+ _SERVICE_PATH + '/' + self._activity_id)
self._service = dbus.Interface(proxy, _SERVICE_INTERFACE)
except dbus.DBusException:
self._service = None
@@ -277,7 +277,7 @@ class Activity(gobject.GObject):
pass
def _set_active_error(self, err):
- logging.error("set_active() failed: %s", err)
+ logging.error('set_active() failed: %s', err)
def _set_launch_status(self, value):
get_model().disconnect(self._launch_completed_hid)
@@ -457,7 +457,7 @@ class ShellModel(gobject.GObject):
def set_tabbing_activity(self, activity):
"""Sets the activity that is currently highlighted during tabbing"""
self._tabbing_activity = activity
- self.emit("tabbing-activity-changed", self._tabbing_activity)
+ self.emit('tabbing-activity-changed', self._tabbing_activity)
def _set_active_activity(self, home_activity):
if self._active_activity == home_activity:
@@ -603,7 +603,7 @@ class ShellModel(gobject.GObject):
def notify_launch_failed(self, activity_id):
home_activity = self.get_activity_by_id(activity_id)
if home_activity:
- logging.debug("Activity %s (%s) launch failed", activity_id,
+ logging.debug('Activity %s (%s) launch failed', activity_id,
home_activity.get_type())
if self.get_launcher(activity_id) is not None:
self.emit('launch-failed', home_activity)
diff --git a/src/jarabe/util/emulator.py b/src/jarabe/util/emulator.py
index 4c9ca8e..5ea348c 100644
--- a/src/jarabe/util/emulator.py
+++ b/src/jarabe/util/emulator.py
@@ -78,8 +78,8 @@ def _run_xephyr(display, dpi, dimensions, fullscreen):
def _check_server(display):
result = subprocess.call(['xdpyinfo', '-display', ':%d' % display],
- stdout=open(os.devnull, "w"),
- stderr=open(os.devnull, "w"))
+ stdout=open(os.devnull, 'w'),
+ stderr=open(os.devnull, 'w'))
return result == 0
@@ -129,7 +129,7 @@ def _setup_env(display, scaling, emulator_pid):
env.get_profile_path(), 'logs', 'mission-control.log')
os.environ['STREAM_ENGINE_LOGFILE'] = os.path.join(
env.get_profile_path(), 'logs', 'telepathy-stream-engine.log')
- os.environ['DISPLAY'] = ":%d" % (display)
+ os.environ['DISPLAY'] = ':%d' % (display)
os.environ['SUGAR_EMULATOR_PID'] = emulator_pid
os.environ['MC_ACCOUNT_DIR'] = os.path.join(
env.get_profile_path(), 'accounts')
@@ -142,7 +142,7 @@ def main():
"""Script-level operations"""
parser = OptionParser()
- parser.add_option('-d', '--dpi', dest='dpi', type="int",
+ parser.add_option('-d', '--dpi', dest='dpi', type='int',
help='Emulator dpi')
parser.add_option('-s', '--scaling', dest='scaling',
help='Sugar scaling in %')
diff --git a/src/jarabe/util/telepathy/connection_watcher.py b/src/jarabe/util/telepathy/connection_watcher.py
index 685ef2c..96af1cf 100644
--- a/src/jarabe/util/telepathy/connection_watcher.py
+++ b/src/jarabe/util/telepathy/connection_watcher.py
@@ -109,10 +109,10 @@ if __name__ == '__main__':
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
def connection_added_cb(conn_watcher, conn):
- print "new connection", conn.service_name
+ print 'new connection', conn.service_name
def connection_removed_cb(conn_watcher, conn):
- print "removed connection", conn.service_name
+ print 'removed connection', conn.service_name
watcher = ConnectionWatcher()
watcher.connect('connection-added', connection_added_cb)
diff --git a/src/jarabe/view/keyhandler.py b/src/jarabe/view/keyhandler.py
index 7caa9ec..b2d96d3 100644
--- a/src/jarabe/view/keyhandler.py
+++ b/src/jarabe/view/keyhandler.py
@@ -135,7 +135,7 @@ class KeyHandler(object):
error_handler=self._on_speech_err)
def handle_say_text(self, event_time):
- clipboard = gtk.clipboard_get(selection="PRIMARY")
+ clipboard = gtk.clipboard_get(selection='PRIMARY')
clipboard.request_text(self._primary_selection_cb)
def handle_previous_window(self, event_time):
@@ -202,7 +202,7 @@ class KeyHandler(object):
if self._tabbing_handler.is_tabbing():
# Only accept window tabbing events, everything else
# cancels the tabbing operation.
- if not action in ["next_window", "previous_window"]:
+ if not action in ['next_window', 'previous_window']:
self._tabbing_handler.stop(event_time)
return True
diff --git a/src/jarabe/view/palettes.py b/src/jarabe/view/palettes.py
index 6104538..db86465 100644
--- a/src/jarabe/view/palettes.py
+++ b/src/jarabe/view/palettes.py
@@ -125,7 +125,7 @@ class ActivityPalette(Palette):
self._activity_info = activity_info
client = gconf.client_get_default()
- color = XoColor(client.get_string("/desktop/sugar/user/color"))
+ color = XoColor(client.get_string('/desktop/sugar/user/color'))
activity_icon = Icon(file=activity_info.get_icon(),
xo_color=color,
icon_size=gtk.ICON_SIZE_LARGE_TOOLBAR)
diff --git a/src/jarabe/view/service.py b/src/jarabe/view/service.py
index 631f1c3..29e46b2 100644
--- a/src/jarabe/view/service.py
+++ b/src/jarabe/view/service.py
@@ -24,9 +24,9 @@ from jarabe.model import shell
from jarabe.model import bundleregistry
-_DBUS_SERVICE = "org.laptop.Shell"
-_DBUS_SHELL_IFACE = "org.laptop.Shell"
-_DBUS_PATH = "/org/laptop/Shell"
+_DBUS_SERVICE = 'org.laptop.Shell'
+_DBUS_SHELL_IFACE = 'org.laptop.Shell'
+_DBUS_PATH = '/org/laptop/Shell'
class UIService(dbus.service.Object):
@@ -56,7 +56,7 @@ class UIService(dbus.service.Object):
self._shell_model = shell.get_model()
@dbus.service.method(_DBUS_SHELL_IFACE,
- in_signature="s", out_signature="s")
+ in_signature='s', out_signature='s')
def GetBundlePath(self, bundle_id):
bundle = bundleregistry.get_registry().get_bundle(bundle_id)
if bundle:
@@ -65,7 +65,7 @@ class UIService(dbus.service.Object):
return ''
@dbus.service.method(_DBUS_SHELL_IFACE,
- in_signature="s", out_signature="b")
+ in_signature='s', out_signature='b')
def ActivateActivity(self, activity_id):
"""Switch to the window related to this activity_id and return a
boolean indicating if there is a real (ie. not a launcher window)
@@ -80,11 +80,11 @@ class UIService(dbus.service.Object):
return False
@dbus.service.method(_DBUS_SHELL_IFACE,
- in_signature="ss", out_signature="")
+ in_signature='ss', out_signature='')
def NotifyLaunch(self, bundle_id, activity_id):
shell.get_model().notify_launch(activity_id, bundle_id)
@dbus.service.method(_DBUS_SHELL_IFACE,
- in_signature="s", out_signature="")
+ in_signature='s', out_signature='')
def NotifyLaunchFailure(self, activity_id):
shell.get_model().notify_launch_failed(activity_id)
diff --git a/src/jarabe/view/viewsource.py b/src/jarabe/view/viewsource.py
index 7b2a24f..32446e6 100644
--- a/src/jarabe/view/viewsource.py
+++ b/src/jarabe/view/viewsource.py
@@ -248,7 +248,7 @@ class DocumentButton(RadioToolButton):
error_handler=self.__internal_save_error_cb)
def __internal_save_cb(self):
- logging.debug("Saved Source object to datastore.")
+ logging.debug('Saved Source object to datastore.')
self._jobject.destroy()
def __internal_save_error_cb(self, err):
--
1.7.2.3
More information about the Sugar-devel
mailing list