Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSascha Silbe <sascha-pgp@silbe.org>2010-10-16 18:12:40 (GMT)
committer Sascha Silbe <sascha-pgp@silbe.org>2010-11-24 19:22:02 (GMT)
commit526d0e1c5607605b83b09741d55a79c57a5e2437 (patch)
treeb4d7906336bd5815e1b4a0174c12a0167d54b6df /src
parent90a84c3a6d754e1531af1493d55ed928d4c37202 (diff)
style cleanup: prefer ' for strings
Tomeu prefers ' for strings, so let's use it wherever we don't have a good reason to use ". Reviewed-by: James Cameron <quozl@laptop.org> Reviewed-by: Simon Schampijer <simon@laptop.org> CC: Aleksey Lim <alsroot@member.fsf.org>
Diffstat (limited to 'src')
-rw-r--r--src/jarabe/controlpanel/cmd.py22
-rw-r--r--src/jarabe/controlpanel/gui.py4
-rw-r--r--src/jarabe/desktop/activitieslist.py2
-rw-r--r--src/jarabe/desktop/favoritesview.py2
-rw-r--r--src/jarabe/desktop/groupbox.py4
-rw-r--r--src/jarabe/desktop/homebox.py2
-rw-r--r--src/jarabe/desktop/homewindow.py2
-rw-r--r--src/jarabe/desktop/keydialog.py40
-rw-r--r--src/jarabe/desktop/meshbox.py8
-rw-r--r--src/jarabe/desktop/networkviews.py28
-rw-r--r--src/jarabe/frame/activitiestray.py8
-rw-r--r--src/jarabe/frame/clipboard.py4
-rw-r--r--src/jarabe/frame/clipboardpanelwindow.py12
-rw-r--r--src/jarabe/frame/devicestray.py2
-rw-r--r--src/jarabe/frame/frame.py2
-rw-r--r--src/jarabe/intro/window.py24
-rw-r--r--src/jarabe/journal/journalactivity.py6
-rw-r--r--src/jarabe/journal/misc.py2
-rw-r--r--src/jarabe/journal/modalalert.py2
-rw-r--r--src/jarabe/model/adhoc.py4
-rw-r--r--src/jarabe/model/friends.py2
-rw-r--r--src/jarabe/model/network.py102
-rw-r--r--src/jarabe/model/notifications.py10
-rw-r--r--src/jarabe/model/olpcmesh.py6
-rw-r--r--src/jarabe/model/screen.py2
-rw-r--r--src/jarabe/model/shell.py22
-rw-r--r--src/jarabe/util/emulator.py8
-rw-r--r--src/jarabe/util/telepathy/connection_watcher.py4
-rw-r--r--src/jarabe/view/keyhandler.py4
-rw-r--r--src/jarabe/view/palettes.py2
-rw-r--r--src/jarabe/view/service.py14
-rw-r--r--src/jarabe/view/viewsource.py2
32 files changed, 179 insertions, 179 deletions
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 6f815f0..b3385bd 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 9075280..e289d4e 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):