Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorSascha Silbe <sascha-pgp@silbe.org>2010-10-16 16:20:03 (GMT)
committer Sascha Silbe <sascha-pgp@silbe.org>2010-11-24 19:22:02 (GMT)
commit80d7a68f08646ae8c05b1685502b0815d6196bf3 (patch)
tree386646dd555c2d74bd2ad9016b05f6fb559e09d2 /extensions
parent54dc55baad526a5b80273585cf414d401219df6a (diff)
PEP8 cleanup: fix spaces around operators and parentheses
Reviewed-by: James Cameron <quozl@laptop.org> Reviewed-by: Simon Schampijer <simon@laptop.org> CC: Aleksey Lim <alsroot@member.fsf.org>
Diffstat (limited to 'extensions')
-rw-r--r--extensions/cpsection/aboutme/model.py15
-rw-r--r--extensions/cpsection/aboutme/view.py16
-rw-r--r--extensions/cpsection/datetime/model.py2
-rw-r--r--extensions/cpsection/frame/view.py2
-rw-r--r--extensions/cpsection/keyboard/view.py33
-rw-r--r--extensions/cpsection/language/view.py8
-rw-r--r--extensions/deviceicon/battery.py12
-rw-r--r--extensions/deviceicon/network.py10
-rw-r--r--extensions/deviceicon/speaker.py4
9 files changed, 48 insertions, 54 deletions
diff --git a/extensions/cpsection/aboutme/model.py b/extensions/cpsection/aboutme/model.py
index fd7261c..3bb96d5 100644
--- a/extensions/cpsection/aboutme/model.py
+++ b/extensions/cpsection/aboutme/model.py
@@ -19,13 +19,14 @@ from gettext import gettext as _
import gconf
-_COLORS = {'red': {'dark':'#b20008', 'medium':'#e6000a', 'light':'#ffadce'},
- 'orange': {'dark':'#9a5200', 'medium':'#c97e00', 'light':'#ffc169'},
- 'yellow': {'dark':'#807500', 'medium':'#be9e00', 'light':'#fffa00'},
- 'green': {'dark':'#008009', 'medium':'#00b20d', 'light':'#8bff7a'},
- 'blue': {'dark':'#00588c', 'medium':'#005fe4', 'light':'#bccdff'},
- 'purple': {'dark':'#5e008c', 'medium':'#7f00bf', 'light':'#d1a3ff'}
- }
+_COLORS = {
+ 'red': {'dark': '#b20008', 'medium': '#e6000a', 'light': '#ffadce'},
+ 'orange': {'dark': '#9a5200', 'medium': '#c97e00', 'light': '#ffc169'},
+ 'yellow': {'dark': '#807500', 'medium': '#be9e00', 'light': '#fffa00'},
+ 'green': {'dark': '#008009', 'medium': '#00b20d', 'light': '#8bff7a'},
+ 'blue': {'dark': '#00588c', 'medium': '#005fe4', 'light': '#bccdff'},
+ 'purple': {'dark': '#5e008c', 'medium': '#7f00bf', 'light': '#d1a3ff'},
+}
_MODIFIERS = ('dark', 'medium', 'light')
diff --git a/extensions/cpsection/aboutme/view.py b/extensions/cpsection/aboutme/view.py
index 95314a1..69f212a 100644
--- a/extensions/cpsection/aboutme/view.py
+++ b/extensions/cpsection/aboutme/view.py
@@ -96,7 +96,7 @@ def _next_index(current_index):
def _previous_index(current_index):
previous_index = current_index - 1
if previous_index < 0:
- previous_index = len(colors)-1
+ previous_index = len(colors) - 1
return previous_index
@@ -131,7 +131,7 @@ class ColorPicker(EventIcon):
__gsignals__ = {
'color-changed': (gobject.SIGNAL_RUN_FIRST,
gobject.TYPE_NONE,
- ([object]))
+ ([object])),
}
def __init__(self, picker):
@@ -184,12 +184,12 @@ class AboutMe(SectionView):
self._color_alert = None
self._pickers = {
- _PREVIOUS_FILL_COLOR: ColorPicker(_PREVIOUS_FILL_COLOR),
- _NEXT_FILL_COLOR: ColorPicker(_NEXT_FILL_COLOR),
- _CURRENT_COLOR: ColorPicker(_CURRENT_COLOR),
- _NEXT_STROKE_COLOR: ColorPicker(_NEXT_STROKE_COLOR),
- _PREVIOUS_STROKE_COLOR: ColorPicker(_PREVIOUS_STROKE_COLOR)
- }
+ _PREVIOUS_FILL_COLOR: ColorPicker(_PREVIOUS_FILL_COLOR),
+ _NEXT_FILL_COLOR: ColorPicker(_NEXT_FILL_COLOR),
+ _CURRENT_COLOR: ColorPicker(_CURRENT_COLOR),
+ _NEXT_STROKE_COLOR: ColorPicker(_NEXT_STROKE_COLOR),
+ _PREVIOUS_STROKE_COLOR: ColorPicker(_PREVIOUS_STROKE_COLOR),
+ }
self._setup_color()
initial_color = XoColor(self._model.get_color_xo())
diff --git a/extensions/cpsection/datetime/model.py b/extensions/cpsection/datetime/model.py
index 39d5e5e..0a68fd7 100644
--- a/extensions/cpsection/datetime/model.py
+++ b/extensions/cpsection/datetime/model.py
@@ -39,7 +39,7 @@ def _initialize():
def read_all_timezones(fn=_zone_tab):
- fd = open (fn, 'r')
+ fd = open(fn, 'r')
lines = fd.readlines()
fd.close()
timezones = []
diff --git a/extensions/cpsection/frame/view.py b/extensions/cpsection/frame/view.py
index fb2b6b7..5c9d473 100644
--- a/extensions/cpsection/frame/view.py
+++ b/extensions/cpsection/frame/view.py
@@ -24,7 +24,7 @@ from jarabe.controlpanel.sectionview import SectionView
from jarabe.controlpanel.inlinealert import InlineAlert
-_never = _('never')
+_never = _('never')
_instantaneous = _('instantaneous')
_seconds_label = _('%s seconds')
_MAX_DELAY = 1000
diff --git a/extensions/cpsection/keyboard/view.py b/extensions/cpsection/keyboard/view.py
index 51062fd..fe3ca15 100644
--- a/extensions/cpsection/keyboard/view.py
+++ b/extensions/cpsection/keyboard/view.py
@@ -47,8 +47,8 @@ class LayoutCombo(gtk.HBox):
"""
__gsignals__ = {
- 'selection-changed' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE,
- (gobject.TYPE_STRING, gobject.TYPE_INT))
+ 'selection-changed': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE,
+ (gobject.TYPE_STRING, gobject.TYPE_INT)),
}
def __init__(self, keyboard_manager, n):
@@ -59,7 +59,7 @@ class LayoutCombo(gtk.HBox):
self.set_border_width(style.DEFAULT_SPACING)
self.set_spacing(style.DEFAULT_SPACING)
- label = gtk.Label(' <b>%s</b> ' % str(n+1))
+ label = gtk.Label(' <b>%s</b> ' % str(n + 1))
label.set_use_markup(True)
label.modify_fg(gtk.STATE_NORMAL,
style.COLOR_SELECTION_GREY.get_gdk_color())
@@ -71,7 +71,7 @@ class LayoutCombo(gtk.HBox):
for description, name in self._keyboard_manager.get_languages():
self._klang_store.append([name, description])
- self._klang_combo = gtk.ComboBox(model = self._klang_store)
+ self._klang_combo = gtk.ComboBox(model=self._klang_store)
self._klang_combo_changed_id = \
self._klang_combo.connect('changed', self._klang_combo_changed_cb)
cell = gtk.CellRendererText()
@@ -79,10 +79,10 @@ class LayoutCombo(gtk.HBox):
cell.props.ellipsize_set = True
self._klang_combo.pack_start(cell)
self._klang_combo.add_attribute(cell, 'text', 1)
- self.pack_start(self._klang_combo, expand=True, fill = True)
+ self.pack_start(self._klang_combo, expand=True, fill=True)
self._kvariant_store = None
- self._kvariant_combo = gtk.ComboBox(model = None)
+ self._kvariant_combo = gtk.ComboBox(model=None)
self._kvariant_combo_changed_id = \
self._kvariant_combo.connect('changed', \
self._kvariant_combo_changed_cb)
@@ -91,7 +91,7 @@ class LayoutCombo(gtk.HBox):
cell.props.ellipsize_set = True
self._kvariant_combo.pack_start(cell)
self._kvariant_combo.add_attribute(cell, 'text', 1)
- self.pack_start(self._kvariant_combo, expand=True, fill = True)
+ self.pack_start(self._kvariant_combo, expand=True, fill=True)
self._klang_combo.set_active(self._index)
@@ -157,8 +157,7 @@ class Keyboard(SectionView):
self.set_border_width(style.DEFAULT_SPACING * 2)
self.set_spacing(style.DEFAULT_SPACING)
- self._layout_table = gtk.Table(rows = 4, columns = 2, \
- homogeneous = False)
+ self._layout_table = gtk.Table(rows=4, columns=2, homogeneous=False)
self._keyboard_manager = model.KeyboardManager(self.get_display())
self._layout_combo_list = []
@@ -202,7 +201,7 @@ class Keyboard(SectionView):
for description, name in self._keyboard_manager.get_models():
kmodel_store.append([name, description])
- kmodel_combo = gtk.ComboBox(model = kmodel_store)
+ kmodel_combo = gtk.ComboBox(model=kmodel_store)
cell = gtk.CellRendererText()
cell.props.ellipsize = pango.ELLIPSIZE_MIDDLE
cell.props.ellipsize_set = True
@@ -216,7 +215,7 @@ class Keyboard(SectionView):
kmodel_combo.set_active_iter(row.iter)
break
- box_kmodel.pack_start(kmodel_combo, expand = False)
+ box_kmodel.pack_start(kmodel_combo, expand=False)
self._vbox.pack_start(box_kmodel, expand=False)
box_kmodel.show_all()
@@ -261,7 +260,7 @@ class Keyboard(SectionView):
for description, name in self._keyboard_manager.get_options_group():
group_option_store.append([name, description])
- group_option_combo = gtk.ComboBox(model = group_option_store)
+ group_option_combo = gtk.ComboBox(model=group_option_store)
cell = gtk.CellRendererText()
cell.props.ellipsize = pango.ELLIPSIZE_MIDDLE
cell.props.ellipsize_set = True
@@ -282,7 +281,7 @@ class Keyboard(SectionView):
if not found:
group_option_combo.set_active(0)
- box_group_option.pack_start(group_option_combo, expand = False)
+ box_group_option.pack_start(group_option_combo, expand=False)
self._vbox.pack_start(box_group_option, expand=False)
box_group_option.show_all()
@@ -325,13 +324,13 @@ class Keyboard(SectionView):
for i in range(0, self._keyboard_manager.get_max_layouts()):
add_remove_box = self.__create_add_remove_box()
self._layout_addremovebox_list.append(add_remove_box)
- self._layout_table.attach(add_remove_box, 1, 2, i, i+1)
+ self._layout_table.attach(add_remove_box, 1, 2, i, i + 1)
layout_combo = LayoutCombo(self._keyboard_manager, i)
layout_combo.connect('selection-changed', \
self.__layout_combo_selection_changed_cb)
self._layout_combo_list.append(layout_combo)
- self._layout_table.attach(layout_combo, 0, 1, i, i+1)
+ self._layout_table.attach(layout_combo, 0, 1, i, i + 1)
if i < len(self._klayouts):
layout_combo.show_all()
@@ -361,14 +360,14 @@ class Keyboard(SectionView):
def __create_add_remove_box(self):
'''Creates gtk.Hbox with add/remove buttons'''
- add_icon = Icon(icon_name='list-add')
+ add_icon = Icon(icon_name='list-add')
add_button = gtk.Button()
add_button.set_image(add_icon)
add_button.connect('clicked',
self.__add_button_clicked_cb)
- remove_icon = Icon(icon_name='list-remove')
+ remove_icon = Icon(icon_name='list-remove')
remove_button = gtk.Button()
remove_button.set_image(remove_icon)
remove_button.connect('clicked',
diff --git a/extensions/cpsection/language/view.py b/extensions/cpsection/language/view.py
index 3a1f1a5..1bd77f8 100644
--- a/extensions/cpsection/language/view.py
+++ b/extensions/cpsection/language/view.py
@@ -181,14 +181,14 @@ class Language(SectionView):
def _create_add_remove_box(self):
'''Creates gtk.Hbox with add/remove buttons'''
- add_icon = Icon(icon_name='list-add')
+ add_icon = Icon(icon_name='list-add')
add_button = gtk.Button()
add_button.set_image(add_icon)
add_button.connect('clicked',
self.__add_button_clicked_cb)
- remove_icon = Icon(icon_name='list-remove')
+ remove_icon = Icon(icon_name='list-remove')
remove_button = gtk.Button()
remove_button.set_image(remove_icon)
remove_button.connect('clicked',
@@ -217,7 +217,7 @@ class Language(SectionView):
selected_langs = self._get_selected_langs()
last_lang = selected_langs[-1]
- self._determine_add_remove_visibility(last_lang = last_lang)
+ self._determine_add_remove_visibility(last_lang=last_lang)
self._changed = (selected_langs != self._selected_locales)
@@ -248,7 +248,7 @@ class Language(SectionView):
return new_codes
- def _determine_add_remove_visibility(self, last_lang = None):
+ def _determine_add_remove_visibility(self, last_lang=None):
# We should not let users add fallback languages for English (USA)
# This is because the software is not usually _translated_ into English
# which means that the fallback gets selected automatically
diff --git a/extensions/deviceicon/battery.py b/extensions/deviceicon/battery.py
index c1c920b..e947ccc 100644
--- a/extensions/deviceicon/battery.py
+++ b/extensions/deviceicon/battery.py
@@ -161,14 +161,10 @@ class BatteryPalette(Palette):
class DeviceModel(gobject.GObject):
__gproperties__ = {
- 'level' : (int, None, None, 0, 100, 0,
- gobject.PARAM_READABLE),
- 'charging' : (bool, None, None, False,
- gobject.PARAM_READABLE),
- 'discharging' : (bool, None, None, False,
- gobject.PARAM_READABLE),
- 'present' : (bool, None, None, False,
- gobject.PARAM_READABLE)
+ 'level': (int, None, None, 0, 100, 0, gobject.PARAM_READABLE),
+ 'charging': (bool, None, None, False, gobject.PARAM_READABLE),
+ 'discharging': (bool, None, None, False, gobject.PARAM_READABLE),
+ 'present': (bool, None, None, False, gobject.PARAM_READABLE),
}
def __init__(self, udi):
diff --git a/extensions/deviceicon/network.py b/extensions/deviceicon/network.py
index 55e334f..d5333af 100644
--- a/extensions/deviceicon/network.py
+++ b/extensions/deviceicon/network.py
@@ -74,8 +74,8 @@ class WirelessPalette(Palette):
__gtype_name__ = 'SugarWirelessPalette'
__gsignals__ = {
- 'deactivate-connection' : (gobject.SIGNAL_RUN_FIRST,
- gobject.TYPE_NONE, ([]))
+ 'deactivate-connection': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
+ ([])),
}
def __init__(self, primary_text):
@@ -205,10 +205,8 @@ class GsmPalette(Palette):
__gtype_name__ = 'SugarGsmPalette'
__gsignals__ = {
- 'gsm-connect' : (gobject.SIGNAL_RUN_FIRST,
- gobject.TYPE_NONE, ([])),
- 'gsm-disconnect' : (gobject.SIGNAL_RUN_FIRST,
- gobject.TYPE_NONE, ([])),
+ 'gsm-connect': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ([])),
+ 'gsm-disconnect': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ([])),
}
def __init__(self):
diff --git a/extensions/deviceicon/speaker.py b/extensions/deviceicon/speaker.py
index ae84036..cb01629 100644
--- a/extensions/deviceicon/speaker.py
+++ b/extensions/deviceicon/speaker.py
@@ -172,8 +172,8 @@ class SpeakerPalette(Palette):
class DeviceModel(gobject.GObject):
__gproperties__ = {
- 'level' : (int, None, None, 0, 100, 0, gobject.PARAM_READWRITE),
- 'muted' : (bool, None, None, False, gobject.PARAM_READWRITE),
+ 'level': (int, None, None, 0, 100, 0, gobject.PARAM_READWRITE),
+ 'muted': (bool, None, None, False, gobject.PARAM_READWRITE),
}
def __init__(self):