Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/jarabe/controlpanel
diff options
context:
space:
mode:
authorSascha Silbe <sascha@silbe.org>2009-08-25 17:48:46 (GMT)
committer Sascha Silbe <sascha@silbe.org>2009-08-25 17:48:46 (GMT)
commit22944c030111816850d2c3915a5733bbe2214adf (patch)
tree20e5336bf8c421b571baee7e8bd934ba397bca5c /src/jarabe/controlpanel
parent6343b1e7eb28c68d048c3191ead9bddf103b3dca (diff)
trim EOL (end-of-line) spaces on source files
Diffstat (limited to 'src/jarabe/controlpanel')
-rw-r--r--src/jarabe/controlpanel/Makefile.am2
-rw-r--r--src/jarabe/controlpanel/cmd.py34
-rw-r--r--src/jarabe/controlpanel/gui.py108
-rw-r--r--src/jarabe/controlpanel/inlinealert.py12
-rw-r--r--src/jarabe/controlpanel/sectionview.py2
-rw-r--r--src/jarabe/controlpanel/toolbar.py6
6 files changed, 82 insertions, 82 deletions
diff --git a/src/jarabe/controlpanel/Makefile.am b/src/jarabe/controlpanel/Makefile.am
index fb796d7..1de2961 100644
--- a/src/jarabe/controlpanel/Makefile.am
+++ b/src/jarabe/controlpanel/Makefile.am
@@ -5,6 +5,6 @@ sugar_PYTHON = \
gui.py \
inlinealert.py \
sectionview.py \
- toolbar.py
+ toolbar.py
diff --git a/src/jarabe/controlpanel/cmd.py b/src/jarabe/controlpanel/cmd.py
index 5f2de68..7144b33 100644
--- a/src/jarabe/controlpanel/cmd.py
+++ b/src/jarabe/controlpanel/cmd.py
@@ -25,14 +25,14 @@ 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")
+_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():
'''Print the help to the screen'''
- # TRANS: Translators, there's a empty line at the end of this string,
+ # TRANS: Translators, there's a empty line at the end of this string,
# which must appear in the translated string (msgstr) as well.
print _('Usage: sugar-control-panel [ option ] key [ args ... ] \n\
Control for the sugar environment. \n\
@@ -50,7 +50,7 @@ def note_restart():
print _('To apply your changes you have to restart sugar.\n' +
'Hit ctrl+alt+erase on the keyboard to trigger a restart.')
-def load_modules():
+def load_modules():
'''Build a list of pointers to available modules and import them.
'''
modules = []
@@ -62,15 +62,15 @@ def load_modules():
if os.path.isdir(os.path.join(path, item)) and \
os.path.exists(os.path.join(path, item, 'model.py')):
try:
- module = __import__('.'.join(('cpsection', item, 'model')),
+ module = __import__('.'.join(('cpsection', item, 'model')),
globals(), locals(), ['model'])
except Exception:
logging.error('Exception while loading extension:\n' + \
''.join(traceback.format_exception(*sys.exc_info())))
else:
modules.append(module)
-
- return modules
+
+ return modules
def main():
try:
@@ -93,12 +93,12 @@ def main():
if method:
found += 1
if found == 1:
- print method.__doc__
+ print method.__doc__
else:
print _(_same_option_warning % (key, module))
- if found == 0:
- print _(_no_option_error % key)
- if option in ("-l"):
+ if found == 0:
+ print _(_no_option_error % key)
+ if option in ("-l"):
for module in modules:
methods = dir(module)
print '%s:' % module.__name__.split('.')[1]
@@ -120,8 +120,8 @@ def main():
print _(_general_error % detail)
else:
print _(_same_option_warning % (key, module))
- if found == 0:
- print _(_no_option_error % key)
+ if found == 0:
+ print _(_no_option_error % key)
if option in ("-s"):
for module in modules:
method = getattr(module, 'set_' + key, None)
@@ -137,8 +137,8 @@ def main():
note_restart()
else:
print _(_same_option_warning % (key, module))
- if found == 0:
- print _(_no_option_error % key)
+ if found == 0:
+ print _(_no_option_error % key)
if option in ("-c"):
for module in modules:
method = getattr(module, 'clear_' + key, None)
@@ -154,5 +154,5 @@ def main():
note_restart()
else:
print _(_same_option_warning % (key, module))
- if found == 0:
- print _(_no_option_error % key)
+ if found == 0:
+ print _(_no_option_error % key)
diff --git a/src/jarabe/controlpanel/gui.py b/src/jarabe/controlpanel/gui.py
index 39f9c4a..e25a5af 100644
--- a/src/jarabe/controlpanel/gui.py
+++ b/src/jarabe/controlpanel/gui.py
@@ -46,7 +46,7 @@ class ControlPanel(gtk.Window):
width = gtk.gdk.screen_width() - offset * 2
height = gtk.gdk.screen_height() - offset * 2
self.set_size_request(width, height)
- self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
+ self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
self.set_decorated(False)
self.set_resizable(False)
self.set_modal(True)
@@ -59,7 +59,7 @@ class ControlPanel(gtk.Window):
self._section_view = None
self._section_toolbar = None
self._main_toolbar = None
-
+
self._vbox = gtk.VBox()
self._hbox = gtk.HBox()
self._vbox.pack_start(self._hbox)
@@ -67,7 +67,7 @@ class ControlPanel(gtk.Window):
self._main_view = gtk.EventBox()
self._hbox.pack_start(self._main_view)
- self._main_view.modify_bg(gtk.STATE_NORMAL,
+ self._main_view.modify_bg(gtk.STATE_NORMAL,
style.COLOR_BLACK.get_gdk_color())
self._main_view.show()
@@ -90,16 +90,16 @@ class ControlPanel(gtk.Window):
if self._canvas:
self._main_view.remove(self._canvas)
if canvas:
- self._main_view.add(canvas)
+ self._main_view.add(canvas)
self._canvas = canvas
def _set_toolbar(self, toolbar):
if self._toolbar:
- self._vbox.remove(self._toolbar)
+ self._vbox.remove(self._toolbar)
self._vbox.pack_start(toolbar, False)
- self._vbox.reorder_child(toolbar, 0)
+ self._vbox.reorder_child(toolbar, 0)
self._toolbar = toolbar
- if not self._separator:
+ if not self._separator:
self._separator = gtk.HSeparator()
self._vbox.pack_start(self._separator, False)
self._vbox.reorder_child(self._separator, 1)
@@ -120,9 +120,9 @@ class ControlPanel(gtk.Window):
child.modify_bg(gtk.STATE_NORMAL, style.COLOR_BLACK.get_gdk_color())
self._setup_options()
- self._main_toolbar.connect('stop-clicked',
+ self._main_toolbar.connect('stop-clicked',
self.__stop_clicked_cb)
- self._main_toolbar.connect('search-changed',
+ self._main_toolbar.connect('search-changed',
self.__search_changed_cb)
def _setup_options(self):
@@ -144,7 +144,7 @@ class ControlPanel(gtk.Window):
title=self._options[option]['title'],
xo_color=self._options[option]['color'],
pixel_size=style.GRID_CELL_SIZE)
- sectionicon.connect('button_press_event',
+ sectionicon.connect('button_press_event',
self.__select_option_cb, option)
sectionicon.show()
@@ -167,7 +167,7 @@ class ControlPanel(gtk.Window):
self._set_toolbar(self._main_toolbar)
self._main_toolbar.show()
self._set_canvas(self._scrolledwindow)
- self._main_view.modify_bg(gtk.STATE_NORMAL,
+ self._main_view.modify_bg(gtk.STATE_NORMAL,
style.COLOR_BLACK.get_gdk_color())
self._table.show()
self._scrolledwindow.show()
@@ -176,7 +176,7 @@ class ControlPanel(gtk.Window):
entry.set_text('')
def _update(self, query):
- for option in self._options:
+ for option in self._options:
found = False
for key in self._options[option]['keywords']:
if query.lower() in key.lower():
@@ -188,16 +188,16 @@ class ControlPanel(gtk.Window):
def _setup_section(self):
self._section_toolbar = SectionToolbar()
- self._section_toolbar.connect('cancel-clicked',
+ self._section_toolbar.connect('cancel-clicked',
self.__cancel_clicked_cb)
- self._section_toolbar.connect('accept-clicked',
+ self._section_toolbar.connect('accept-clicked',
self.__accept_clicked_cb)
def show_section_view(self, option):
self._set_toolbar(self._section_toolbar)
icon = self._section_toolbar.get_icon()
- icon.set_from_icon_name(self._options[option]['icon'],
+ icon.set_from_icon_name(self._options[option]['icon'],
gtk.ICON_SIZE_LARGE_TOOLBAR)
icon.props.xo_color = self._options[option]['color']
title = self._section_toolbar.get_title()
@@ -206,32 +206,32 @@ class ControlPanel(gtk.Window):
self._current_option = option
- mod = __import__('.'.join(('cpsection', option, 'view')),
- globals(), locals(), ['view'])
+ mod = __import__('.'.join(('cpsection', option, 'view')),
+ globals(), locals(), ['view'])
view_class = getattr(mod, self._options[option]['view'], None)
- mod = __import__('.'.join(('cpsection', option, 'model')),
+ mod = __import__('.'.join(('cpsection', option, 'model')),
globals(), locals(), ['model'])
- model = ModelWrapper(mod)
+ model = ModelWrapper(mod)
- self._section_view = view_class(model,
+ self._section_view = view_class(model,
self._options[option]['alerts'])
- self._set_canvas(self._section_view)
+ self._set_canvas(self._section_view)
self._section_view.show()
- self._section_view.connect('notify::is-valid',
+ self._section_view.connect('notify::is-valid',
self.__valid_section_cb)
self._section_view.connect('request-close',
self.__close_request_cb)
- self._main_view.modify_bg(gtk.STATE_NORMAL,
+ self._main_view.modify_bg(gtk.STATE_NORMAL,
style.COLOR_WHITE.get_gdk_color())
def set_section_view_auto_close(self):
'''Automatically close the control panel if there is "nothing to do"
'''
self._section_view.auto_close = True
-
- def _get_options(self):
+
+ def _get_options(self):
'''Get the available option information from the extensions
'''
options = {}
@@ -243,10 +243,10 @@ class ControlPanel(gtk.Window):
if os.path.isdir(os.path.join(path, item)) and \
os.path.exists(os.path.join(path, item, '__init__.py')):
try:
- mod = __import__('.'.join(('cpsection', item)),
+ mod = __import__('.'.join(('cpsection', item)),
globals(), locals(), [item])
view_class = getattr(mod, 'CLASS', None)
- if view_class is not None:
+ if view_class is not None:
options[item] = {}
options[item]['alerts'] = []
options[item]['view'] = view_class
@@ -257,18 +257,18 @@ class ControlPanel(gtk.Window):
keywords.append(options[item]['title'].lower())
if item not in keywords:
keywords.append(item)
- else:
+ else:
_logger.error('There is no CLASS constant specifieds ' \
'in the view file \'%s\'.' % item)
except Exception:
logging.error('Exception while loading extension:\n' + \
''.join(traceback.format_exception(*sys.exc_info())))
- return options
+ return options
def __cancel_clicked_cb(self, widget):
self._section_view.undo()
- self._options[self._current_option]['alerts'] = []
+ self._options[self._current_option]['alerts'] = []
self._section_toolbar.accept_button.set_sensitive(True)
self._show_main_view()
@@ -277,24 +277,24 @@ class ControlPanel(gtk.Window):
self._section_toolbar.accept_button.set_sensitive(False)
self._section_toolbar.cancel_button.set_sensitive(False)
alert = Alert()
- alert.props.title = _('Warning')
- alert.props.msg = _('Changes require restart')
-
+ alert.props.title = _('Warning')
+ alert.props.msg = _('Changes require restart')
+
icon = Icon(icon_name='dialog-cancel')
- alert.add_button(gtk.RESPONSE_CANCEL, _('Cancel changes'), icon)
- icon.show()
+ alert.add_button(gtk.RESPONSE_CANCEL, _('Cancel changes'), icon)
+ icon.show()
if self._current_option != 'aboutme':
- icon = Icon(icon_name='dialog-ok')
- alert.add_button(gtk.RESPONSE_ACCEPT, _('Later'), icon)
+ icon = Icon(icon_name='dialog-ok')
+ alert.add_button(gtk.RESPONSE_ACCEPT, _('Later'), icon)
icon.show()
- icon = Icon(icon_name='system-restart')
- alert.add_button(gtk.RESPONSE_APPLY, _('Restart now'), icon)
- icon.show()
+ icon = Icon(icon_name='system-restart')
+ alert.add_button(gtk.RESPONSE_APPLY, _('Restart now'), icon)
+ icon.show()
self._vbox.pack_start(alert, False)
- self._vbox.reorder_child(alert, 2)
+ self._vbox.reorder_child(alert, 2)
alert.connect('response', self.__response_cb)
alert.show()
else:
@@ -304,15 +304,15 @@ class ControlPanel(gtk.Window):
self._vbox.remove(alert)
self._section_toolbar.accept_button.set_sensitive(True)
self._section_toolbar.cancel_button.set_sensitive(True)
- if response_id is gtk.RESPONSE_CANCEL:
+ if response_id is gtk.RESPONSE_CANCEL:
self._section_view.undo()
self._section_view.setup()
self._options[self._current_option]['alerts'] = []
- elif response_id is gtk.RESPONSE_ACCEPT:
+ elif response_id is gtk.RESPONSE_ACCEPT:
self._options[self._current_option]['alerts'] = \
self._section_view.restart_alerts
self._show_main_view()
- elif response_id is gtk.RESPONSE_APPLY:
+ elif response_id is gtk.RESPONSE_APPLY:
session_manager = get_session_manager()
session_manager.logout()
@@ -320,18 +320,18 @@ class ControlPanel(gtk.Window):
self.show_section_view(option)
def __search_changed_cb(self, maintoolbar, query):
- self._update(query)
+ self._update(query)
def __stop_clicked_cb(self, widget):
self.destroy()
def __close_request_cb(self, widget, event=None):
self.destroy()
-
+
def __valid_section_cb(self, section_view, pspec):
section_is_valid = section_view.props.is_valid
self._section_toolbar.accept_button.set_sensitive(section_is_valid)
-
+
class ModelWrapper(object):
def __init__(self, module):
self._module = module
@@ -342,7 +342,7 @@ class ModelWrapper(object):
methods = dir(self._module)
for method in methods:
if method.startswith('get_') and method[4:] != 'color':
- try:
+ try:
self._options[method[4:]] = getattr(self._module, method)()
except Exception:
self._options[method[4:]] = None
@@ -352,7 +352,7 @@ class ModelWrapper(object):
def undo(self):
for key in self._options.keys():
- method = getattr(self._module, 'set_' + key, None)
+ method = getattr(self._module, 'set_' + key, None)
if method and self._options[key] is not None:
try:
method(self._options[key])
@@ -373,7 +373,7 @@ class _SectionIcon(gtk.EventBox):
gobject.PARAM_READWRITE)
}
- def __init__(self, **kwargs):
+ def __init__(self, **kwargs):
self._icon_name = None
self._pixel_size = style.GRID_CELL_SIZE
self._xo_color = None
@@ -382,16 +382,16 @@ class _SectionIcon(gtk.EventBox):
gobject.GObject.__init__(self, **kwargs)
self._vbox = gtk.VBox()
- self._icon = Icon(icon_name=self._icon_name,
- pixel_size=self._pixel_size,
+ self._icon = Icon(icon_name=self._icon_name,
+ pixel_size=self._pixel_size,
xo_color=self._xo_color)
self._vbox.pack_start(self._icon, expand=False, fill=False)
self._label = gtk.Label(self._title)
- self._label.modify_fg(gtk.STATE_NORMAL,
+ self._label.modify_fg(gtk.STATE_NORMAL,
style.COLOR_WHITE.get_gdk_color())
self._vbox.pack_start(self._label, expand=False, fill=False)
-
+
self._vbox.set_spacing(style.DEFAULT_SPACING)
self.set_visible_window(False)
self.set_app_paintable(True)
diff --git a/src/jarabe/controlpanel/inlinealert.py b/src/jarabe/controlpanel/inlinealert.py
index 619a379..b1880da 100644
--- a/src/jarabe/controlpanel/inlinealert.py
+++ b/src/jarabe/controlpanel/inlinealert.py
@@ -24,7 +24,7 @@ from sugar.graphics.icon import Icon
class InlineAlert(gtk.HBox):
"""UI interface for Inline alerts
- Inline alerts are different from the other alerts beause they are
+ Inline alerts are different from the other alerts beause they are
no dialogs, they only inform about a current event.
Properties:
@@ -54,21 +54,21 @@ class InlineAlert(gtk.HBox):
self._msg_label.set_max_width_chars(50)
self._msg_label.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
self._msg_label.set_alignment(0, 0.5)
- self._msg_label.modify_fg(gtk.STATE_NORMAL,
+ self._msg_label.modify_fg(gtk.STATE_NORMAL,
style.COLOR_SELECTION_GREY.get_gdk_color())
gobject.GObject.__init__(self, **kwargs)
self.set_spacing(style.DEFAULT_SPACING)
- self.modify_bg(gtk.STATE_NORMAL,
+ self.modify_bg(gtk.STATE_NORMAL,
style.COLOR_WHITE.get_gdk_color())
-
+
self.pack_start(self._icon, False)
self.pack_start(self._msg_label, False)
self._msg_label.show()
self._icon.show()
-
- def do_set_property(self, pspec, value):
+
+ def do_set_property(self, pspec, value):
if pspec.name == 'msg':
if self._msg != value:
self._msg = value
diff --git a/src/jarabe/controlpanel/sectionview.py b/src/jarabe/controlpanel/sectionview.py
index 7b76aa1..4de27a2 100644
--- a/src/jarabe/controlpanel/sectionview.py
+++ b/src/jarabe/controlpanel/sectionview.py
@@ -30,7 +30,7 @@ class SectionView(gtk.VBox):
'is_valid' : (bool, None, None, True,
gobject.PARAM_READWRITE)
}
-
+
_APPLY_TIMEOUT = 1000
def __init__(self):
diff --git a/src/jarabe/controlpanel/toolbar.py b/src/jarabe/controlpanel/toolbar.py
index 6bb8328..320a8eb 100644
--- a/src/jarabe/controlpanel/toolbar.py
+++ b/src/jarabe/controlpanel/toolbar.py
@@ -66,7 +66,7 @@ class MainToolbar(gtk.Toolbar):
def get_entry(self):
return self._search_entry
-
+
def _add_separator(self, expand=False):
separator = gtk.SeparatorToolItem()
separator.props.draw = False
@@ -103,12 +103,12 @@ class SectionToolbar(gtk.Toolbar):
self._icon = Icon()
self._add_widget(self._icon)
-
+
self._add_separator()
self._title = gtk.Label()
self._add_widget(self._title)
-
+
self._add_separator(True)
self.cancel_button = ToolButton('dialog-cancel')