diff options
author | Simon Schampijer <simon@schampijer.de> | 2008-09-24 12:04:42 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@schampijer.de> | 2008-09-24 12:04:42 (GMT) |
commit | da68592338889ffd922e1190411b3c7cc007bf1a (patch) | |
tree | 2cf1f5b5e9d86c55cf3bfc77f3cb135f40fa0a24 | |
parent | 22b196f2e740011964edaac837c10a325f156c98 (diff) |
Move the controlpanel extensions to own modules
-rw-r--r-- | configure.ac | 9 | ||||
-rw-r--r-- | src/controlpanel/Makefile.am | 2 | ||||
-rw-r--r-- | src/controlpanel/aboutme/Makefile.am | 6 | ||||
-rw-r--r-- | src/controlpanel/aboutme/__init__.py (copied from src/controlpanel/view/__init__.py) | 14 | ||||
-rw-r--r-- | src/controlpanel/aboutme/model.py (renamed from src/controlpanel/model/aboutme.py) | 0 | ||||
-rw-r--r-- | src/controlpanel/aboutme/view.py (renamed from src/controlpanel/view/aboutme.py) | 0 | ||||
-rw-r--r-- | src/controlpanel/aboutxo/Makefile.am | 6 | ||||
-rw-r--r-- | src/controlpanel/aboutxo/__init__.py (copied from src/controlpanel/view/__init__.py) | 11 | ||||
-rw-r--r-- | src/controlpanel/aboutxo/model.py (renamed from src/controlpanel/model/aboutxo.py) | 0 | ||||
-rw-r--r-- | src/controlpanel/aboutxo/view.py (renamed from src/controlpanel/view/aboutxo.py) | 4 | ||||
-rw-r--r-- | src/controlpanel/cmd.py | 24 | ||||
-rw-r--r-- | src/controlpanel/datetime/Makefile.am | 6 | ||||
-rw-r--r-- | src/controlpanel/datetime/__init__.py (copied from src/controlpanel/view/__init__.py) | 10 | ||||
-rw-r--r-- | src/controlpanel/datetime/model.py (renamed from src/controlpanel/model/datetime.py) | 0 | ||||
-rw-r--r-- | src/controlpanel/datetime/view.py (renamed from src/controlpanel/view/datetime.py) | 4 | ||||
-rw-r--r-- | src/controlpanel/frame/Makefile.am | 6 | ||||
-rw-r--r-- | src/controlpanel/frame/__init__.py (copied from src/controlpanel/view/__init__.py) | 10 | ||||
-rw-r--r-- | src/controlpanel/frame/model.py (renamed from src/controlpanel/model/frame.py) | 0 | ||||
-rw-r--r-- | src/controlpanel/frame/view.py (renamed from src/controlpanel/view/frame.py) | 4 | ||||
-rw-r--r-- | src/controlpanel/gui.py | 81 | ||||
-rw-r--r-- | src/controlpanel/language/Makefile.am | 6 | ||||
-rw-r--r-- | src/controlpanel/language/__init__.py (renamed from src/controlpanel/model/__init__.py) | 11 | ||||
-rw-r--r-- | src/controlpanel/language/model.py (renamed from src/controlpanel/model/language.py) | 0 | ||||
-rw-r--r-- | src/controlpanel/language/view.py (renamed from src/controlpanel/view/language.py) | 4 | ||||
-rw-r--r-- | src/controlpanel/model/Makefile.am | 10 | ||||
-rw-r--r-- | src/controlpanel/network/Makefile.am | 6 | ||||
-rw-r--r-- | src/controlpanel/network/__init__.py (copied from src/controlpanel/view/__init__.py) | 12 | ||||
-rw-r--r-- | src/controlpanel/network/model.py (renamed from src/controlpanel/model/network.py) | 0 | ||||
-rw-r--r-- | src/controlpanel/network/view.py (renamed from src/controlpanel/view/network.py) | 0 | ||||
-rw-r--r-- | src/controlpanel/power/Makefile.am | 6 | ||||
-rw-r--r-- | src/controlpanel/power/__init__.py (renamed from src/controlpanel/view/__init__.py) | 12 | ||||
-rw-r--r-- | src/controlpanel/power/model.py (renamed from src/controlpanel/model/power.py) | 2 | ||||
-rw-r--r-- | src/controlpanel/power/view.py (renamed from src/controlpanel/view/power.py) | 4 | ||||
-rw-r--r-- | src/controlpanel/view/Makefile.am | 16 |
34 files changed, 156 insertions, 130 deletions
diff --git a/configure.ac b/configure.ac index 3af0587..ff8ed2b 100644 --- a/configure.ac +++ b/configure.ac @@ -48,8 +48,13 @@ data/icons/Makefile service/Makefile src/Makefile src/controlpanel/Makefile -src/controlpanel/model/Makefile -src/controlpanel/view/Makefile +src/controlpanel/aboutme/Makefile +src/controlpanel/aboutxo/Makefile +src/controlpanel/datetime/Makefile +src/controlpanel/frame/Makefile +src/controlpanel/language/Makefile +src/controlpanel/network/Makefile +src/controlpanel/power/Makefile src/intro/Makefile src/journal/Makefile src/hardware/Makefile diff --git a/src/controlpanel/Makefile.am b/src/controlpanel/Makefile.am index 5acd9a1..8fa3bbe 100644 --- a/src/controlpanel/Makefile.am +++ b/src/controlpanel/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = model view +SUBDIRS = aboutme aboutxo datetime frame language network power sugardir = $(pkgdatadir)/shell/controlpanel sugar_PYTHON = \ diff --git a/src/controlpanel/aboutme/Makefile.am b/src/controlpanel/aboutme/Makefile.am new file mode 100644 index 0000000..a53cdb9 --- /dev/null +++ b/src/controlpanel/aboutme/Makefile.am @@ -0,0 +1,6 @@ +sugardir = $(pkgdatadir)/shell/controlpanel/aboutme + +sugar_PYTHON = \ + __init__.py \ + model.py \ + view.py diff --git a/src/controlpanel/view/__init__.py b/src/controlpanel/aboutme/__init__.py index 2b0f269..b683e28 100644 --- a/src/controlpanel/view/__init__.py +++ b/src/controlpanel/aboutme/__init__.py @@ -1,4 +1,4 @@ -# Copyright (C) 2008 One Laptop Per Child +# Copyright (C) 2008, OLPC # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -12,6 +12,14 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +from gettext import gettext as _ +from sugar import profile + +CLASS = 'AboutMe' +ICON = 'module-about_me' +TITLE = _('About Me') +COLOR = profile.get_color() + diff --git a/src/controlpanel/model/aboutme.py b/src/controlpanel/aboutme/model.py index 3818792..3818792 100644 --- a/src/controlpanel/model/aboutme.py +++ b/src/controlpanel/aboutme/model.py diff --git a/src/controlpanel/view/aboutme.py b/src/controlpanel/aboutme/view.py index a871871..a871871 100644 --- a/src/controlpanel/view/aboutme.py +++ b/src/controlpanel/aboutme/view.py diff --git a/src/controlpanel/aboutxo/Makefile.am b/src/controlpanel/aboutxo/Makefile.am new file mode 100644 index 0000000..a9463e0 --- /dev/null +++ b/src/controlpanel/aboutxo/Makefile.am @@ -0,0 +1,6 @@ +sugardir = $(pkgdatadir)/shell/controlpanel/aboutxo + +sugar_PYTHON = \ + __init__.py \ + model.py \ + view.py diff --git a/src/controlpanel/view/__init__.py b/src/controlpanel/aboutxo/__init__.py index 2b0f269..4dc2cb2 100644 --- a/src/controlpanel/view/__init__.py +++ b/src/controlpanel/aboutxo/__init__.py @@ -1,4 +1,4 @@ -# Copyright (C) 2008 One Laptop Per Child +# Copyright (C) 2008, OLPC # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -12,6 +12,11 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +from gettext import gettext as _ + +CLASS = 'AboutXO' +ICON = 'module-about_my_xo' +TITLE = _('About my XO') diff --git a/src/controlpanel/model/aboutxo.py b/src/controlpanel/aboutxo/model.py index ebbcca7..ebbcca7 100644 --- a/src/controlpanel/model/aboutxo.py +++ b/src/controlpanel/aboutxo/model.py diff --git a/src/controlpanel/view/aboutxo.py b/src/controlpanel/aboutxo/view.py index 4c1d299..f85e8d2 100644 --- a/src/controlpanel/view/aboutxo.py +++ b/src/controlpanel/aboutxo/view.py @@ -23,10 +23,6 @@ from sugar.graphics import style from controlpanel.sectionview import SectionView -CLASS = 'AboutXO' -ICON = 'module-about_my_xo' -TITLE = _('About my XO') - class AboutXO(SectionView): def __init__(self, model, alerts=None): SectionView.__init__(self) diff --git a/src/controlpanel/cmd.py b/src/controlpanel/cmd.py index fab1f03..8e41af5 100644 --- a/src/controlpanel/cmd.py +++ b/src/controlpanel/cmd.py @@ -49,20 +49,20 @@ def note_restart(): 'Hit ctrl+alt+erase on the keyboard to trigger a restart.') def load_modules(): - '''Build a list of pointers to available modules in the model directory - and load them. + '''Build a list of pointers to available modules and import them. ''' - subpath = ['controlpanel', 'model'] - file_names = os.listdir(os.path.join(config.shell_path, '/'.join(subpath))) - modules = [] - for file_name in file_names: - if file_name.endswith('.py') and file_name != '__init__.py': - module_name = os.path.splitext(file_name)[0] - module = __import__('.'.join(subpath) + '.' + - module_name, globals(), locals(), - [module_name]) + + path = os.path.join(config.shell_path, 'controlpanel') + folder = os.listdir(path) + + for item in folder: + if os.path.isdir(os.path.join(path, item)) and \ + os.path.exists(os.path.join(path, item, 'model.py')): + module = __import__('.'.join(('controlpanel', item, 'model')), + globals(), locals(), ['model']) modules.append(module) + return modules def main(): @@ -94,7 +94,7 @@ def main(): if option in ("-l"): for module in modules: methods = dir(module) - print '%s:' % module.__name__.split('.')[-1] + print '%s:' % module.__name__.split('.')[1] for method in methods: if method.startswith('get_'): print ' %s' % method[4:] diff --git a/src/controlpanel/datetime/Makefile.am b/src/controlpanel/datetime/Makefile.am new file mode 100644 index 0000000..47ec21a --- /dev/null +++ b/src/controlpanel/datetime/Makefile.am @@ -0,0 +1,6 @@ +sugardir = $(pkgdatadir)/shell/controlpanel/datetime + +sugar_PYTHON = \ + __init__.py \ + model.py \ + view.py diff --git a/src/controlpanel/view/__init__.py b/src/controlpanel/datetime/__init__.py index 2b0f269..fc9be45 100644 --- a/src/controlpanel/view/__init__.py +++ b/src/controlpanel/datetime/__init__.py @@ -1,4 +1,4 @@ -# Copyright (C) 2008 One Laptop Per Child +# Copyright (C) 2008, OLPC # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -12,6 +12,10 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +from gettext import gettext as _ +CLASS = 'TimeZone' +ICON = 'module-date_and_time' +TITLE = _('Date & Time') diff --git a/src/controlpanel/model/datetime.py b/src/controlpanel/datetime/model.py index 4a4c560..4a4c560 100644 --- a/src/controlpanel/model/datetime.py +++ b/src/controlpanel/datetime/model.py diff --git a/src/controlpanel/view/datetime.py b/src/controlpanel/datetime/view.py index f178515..ed788f7 100644 --- a/src/controlpanel/view/datetime.py +++ b/src/controlpanel/datetime/view.py @@ -24,10 +24,6 @@ from sugar.graphics import iconentry from controlpanel.sectionview import SectionView from controlpanel.inlinealert import InlineAlert -CLASS = 'TimeZone' -ICON = 'module-date_and_time' -TITLE = _('Date & Time') - class TimeZone(SectionView): def __init__(self, model, alerts): SectionView.__init__(self) diff --git a/src/controlpanel/frame/Makefile.am b/src/controlpanel/frame/Makefile.am new file mode 100644 index 0000000..3fa3847 --- /dev/null +++ b/src/controlpanel/frame/Makefile.am @@ -0,0 +1,6 @@ +sugardir = $(pkgdatadir)/shell/controlpanel/frame + +sugar_PYTHON = \ + __init__.py \ + model.py \ + view.py diff --git a/src/controlpanel/view/__init__.py b/src/controlpanel/frame/__init__.py index 2b0f269..a93f9c7 100644 --- a/src/controlpanel/view/__init__.py +++ b/src/controlpanel/frame/__init__.py @@ -1,4 +1,4 @@ -# Copyright (C) 2008 One Laptop Per Child +# Copyright (C) 2008, OLPC # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -12,6 +12,10 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +from gettext import gettext as _ +CLASS = 'Frame' +ICON = 'module-frame' +TITLE = _('Frame') diff --git a/src/controlpanel/model/frame.py b/src/controlpanel/frame/model.py index 0e19703..0e19703 100644 --- a/src/controlpanel/model/frame.py +++ b/src/controlpanel/frame/model.py diff --git a/src/controlpanel/view/frame.py b/src/controlpanel/frame/view.py index 09b973e..eba8361 100644 --- a/src/controlpanel/view/frame.py +++ b/src/controlpanel/frame/view.py @@ -23,10 +23,6 @@ from sugar.graphics import style from controlpanel.sectionview import SectionView from controlpanel.inlinealert import InlineAlert -CLASS = 'Frame' -ICON = 'module-frame' -TITLE = _('Frame') - _never = _('never') _instantaneous = _('instantaneous') _seconds_label = _('%s seconds') diff --git a/src/controlpanel/gui.py b/src/controlpanel/gui.py index 527f3b7..11f93cd 100644 --- a/src/controlpanel/gui.py +++ b/src/controlpanel/gui.py @@ -194,10 +194,18 @@ class ControlPanel(gtk.Window): self._section_toolbar.show() self._current_option = option - view_class = self._options[option]['view'] - model = self._options[option]['model'] + + mod = __import__('.'.join(('controlpanel', option, 'view')), + globals(), locals(), ['view']) + view_class = getattr(mod, self._options[option]['view'], None) + + mod = __import__('.'.join(('controlpanel', option, 'model')), + globals(), locals(), ['model']) + model = ModelWrapper(mod) + self._section_view = view_class(model, - self._options[option]['alerts']) + self._options[option]['alerts']) + self._set_canvas(self._section_view) self._section_view.show() self._section_view.connect('notify::is-valid', @@ -213,55 +221,34 @@ class ControlPanel(gtk.Window): self._section_view.auto_close = True def _get_options(self): - '''Get the available option information from the subfolders - model and view. + '''Get the available option information from the extensions ''' options = {} - subpath = ['controlpanel', 'view'] - names = os.listdir(os.path.join(config.shell_path, '/'.join(subpath))) - - for name in names: - if name.endswith('.py') and name != '__init__.py': - tmp = os.path.splitext(name)[0] - mod = __import__('.'.join(subpath) + '.' + tmp, globals(), - locals(), [tmp]) - view_class_str = getattr(mod, 'CLASS', None) - if view_class_str: - view_class = getattr(mod, view_class_str, None) - if not view_class: - _logger.error('The CLASS constant \'%s\' does not ' \ - 'match a class name.' % view_class) - else: - options[tmp] = {} - options[tmp]['alerts'] = [] - options[tmp]['view'] = view_class - options[tmp]['icon'] = getattr(mod, 'ICON', tmp) - options[tmp]['title'] = getattr(mod, 'TITLE', - tmp) - options[tmp]['color'] = getattr(mod, 'COLOR', - None) + path = os.path.join(config.shell_path, 'controlpanel') + folder = os.listdir(path) + + for item in folder: + if os.path.isdir(os.path.join(path, item)) and \ + os.path.exists(os.path.join(path, item, '__init__.py')): + mod = __import__('.'.join(('controlpanel', item)), + globals(), locals(), [item]) + view_class = getattr(mod, 'CLASS', None) + if view_class is not None: + options[item] = {} + options[item]['alerts'] = [] + options[item]['view'] = view_class + options[item]['icon'] = getattr(mod, 'ICON', item) + options[item]['title'] = getattr(mod, 'TITLE', item) + options[item]['color'] = getattr(mod, 'COLOR', None) + keywords = getattr(mod, 'KEYWORDS', []) + keywords.append(options[item]['title'].lower()) + if item not in keywords: + keywords.append(item) else: _logger.error('There is no CLASS constant specified in ' \ - 'the view file \'%s\'.' % tmp) - - subpath = ['controlpanel', 'model'] - names = os.listdir(os.path.join(config.shell_path, '/'.join(subpath))) - - for name in names: - if name.endswith('.py') and name != '__init__.py': - tmp = os.path.splitext(name)[0] - if tmp in options: - mod = __import__('.'.join(subpath) + '.' + tmp, - globals(), locals(), [tmp]) - keywords = getattr(mod, 'KEYWORDS', []) - keywords.append(options[tmp]['title'].lower()) - if tmp not in keywords: - keywords.append(tmp) - options[tmp]['model'] = ModelWrapper(mod) - options[tmp]['keywords'] = keywords - - return options + 'the view file \'%s\'.' % item) + return options def __cancel_clicked_cb(self, widget): self._section_view.undo() diff --git a/src/controlpanel/language/Makefile.am b/src/controlpanel/language/Makefile.am new file mode 100644 index 0000000..53bd236 --- /dev/null +++ b/src/controlpanel/language/Makefile.am @@ -0,0 +1,6 @@ +sugardir = $(pkgdatadir)/shell/controlpanel/language + +sugar_PYTHON = \ + __init__.py \ + model.py \ + view.py diff --git a/src/controlpanel/model/__init__.py b/src/controlpanel/language/__init__.py index 2b0f269..a8f9f08 100644 --- a/src/controlpanel/model/__init__.py +++ b/src/controlpanel/language/__init__.py @@ -1,4 +1,4 @@ -# Copyright (C) 2008 One Laptop Per Child +# Copyright (C) 2008, OLPC # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -12,6 +12,11 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +from gettext import gettext as _ + +CLASS = 'Language' +ICON = 'module-language' +TITLE = _('Language') diff --git a/src/controlpanel/model/language.py b/src/controlpanel/language/model.py index 404d9dd..404d9dd 100644 --- a/src/controlpanel/model/language.py +++ b/src/controlpanel/language/model.py diff --git a/src/controlpanel/view/language.py b/src/controlpanel/language/view.py index db2042e..5d423eb 100644 --- a/src/controlpanel/view/language.py +++ b/src/controlpanel/language/view.py @@ -24,10 +24,6 @@ from sugar.graphics import iconentry from controlpanel.sectionview import SectionView from controlpanel.inlinealert import InlineAlert -CLASS = 'Language' -ICON = 'module-language' -TITLE = _('Language') - class Language(SectionView): def __init__(self, model, alerts): SectionView.__init__(self) diff --git a/src/controlpanel/model/Makefile.am b/src/controlpanel/model/Makefile.am deleted file mode 100644 index 20c27a9..0000000 --- a/src/controlpanel/model/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -sugardir = $(pkgdatadir)/shell/controlpanel/model -sugar_PYTHON = \ - __init__.py \ - aboutme.py \ - aboutxo.py \ - datetime.py \ - frame.py \ - language.py \ - network.py \ - power.py diff --git a/src/controlpanel/network/Makefile.am b/src/controlpanel/network/Makefile.am new file mode 100644 index 0000000..b02d5c2 --- /dev/null +++ b/src/controlpanel/network/Makefile.am @@ -0,0 +1,6 @@ +sugardir = $(pkgdatadir)/shell/controlpanel/network + +sugar_PYTHON = \ + __init__.py \ + model.py \ + view.py diff --git a/src/controlpanel/view/__init__.py b/src/controlpanel/network/__init__.py index 2b0f269..8fea274 100644 --- a/src/controlpanel/view/__init__.py +++ b/src/controlpanel/network/__init__.py @@ -1,4 +1,4 @@ -# Copyright (C) 2008 One Laptop Per Child +# Copyright (C) 2006-2007, Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -13,5 +13,13 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# + +from gettext import gettext as _ + +CLASS = 'Network' +ICON = 'module-network' +TITLE = _('Network') +KEYWORDS = ['network', 'jabber', 'radio', 'server'] + + diff --git a/src/controlpanel/model/network.py b/src/controlpanel/network/model.py index cbe0473..cbe0473 100644 --- a/src/controlpanel/model/network.py +++ b/src/controlpanel/network/model.py diff --git a/src/controlpanel/view/network.py b/src/controlpanel/network/view.py index 2b19656..2b19656 100644 --- a/src/controlpanel/view/network.py +++ b/src/controlpanel/network/view.py diff --git a/src/controlpanel/power/Makefile.am b/src/controlpanel/power/Makefile.am new file mode 100644 index 0000000..21cf5ef --- /dev/null +++ b/src/controlpanel/power/Makefile.am @@ -0,0 +1,6 @@ +sugardir = $(pkgdatadir)/shell/controlpanel/power + +sugar_PYTHON = \ + __init__.py \ + model.py \ + view.py diff --git a/src/controlpanel/view/__init__.py b/src/controlpanel/power/__init__.py index 2b0f269..8b2e85f 100644 --- a/src/controlpanel/view/__init__.py +++ b/src/controlpanel/power/__init__.py @@ -1,4 +1,4 @@ -# Copyright (C) 2008 One Laptop Per Child +# Copyright (C) 2008, OLPC # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -12,6 +12,12 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +from gettext import gettext as _ + +CLASS = 'Power' +ICON = 'module-power' +TITLE = _('Power') +KEYWORDS = ['automatic', 'extreme', 'power', 'suspend', 'battery'] diff --git a/src/controlpanel/model/power.py b/src/controlpanel/power/model.py index bcf84f3..47af483 100644 --- a/src/controlpanel/model/power.py +++ b/src/controlpanel/power/model.py @@ -24,8 +24,6 @@ OHM_SERVICE_NAME = 'org.freedesktop.ohm' OHM_SERVICE_PATH = '/org/freedesktop/ohm/Keystore' OHM_SERVICE_IFACE = 'org.freedesktop.ohm.Keystore' -KEYWORDS = ['automatic', 'extreme', 'power', 'suspend', 'battery'] - class ReadError(Exception): def __init__(self, value): self.value = value diff --git a/src/controlpanel/view/power.py b/src/controlpanel/power/view.py index 6837e43..e2efa3b 100644 --- a/src/controlpanel/view/power.py +++ b/src/controlpanel/power/view.py @@ -22,10 +22,6 @@ from sugar.graphics import style from controlpanel.sectionview import SectionView from controlpanel.inlinealert import InlineAlert -CLASS = 'Power' -ICON = 'module-power' -TITLE = _('Power') - class Power(SectionView): def __init__(self, model, alerts): SectionView.__init__(self) diff --git a/src/controlpanel/view/Makefile.am b/src/controlpanel/view/Makefile.am deleted file mode 100644 index a4d2a53..0000000 --- a/src/controlpanel/view/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -sugardir = $(pkgdatadir)/shell/controlpanel/view -sugar_PYTHON = \ - __init__.py \ - aboutme.py \ - aboutxo.py \ - datetime.py \ - frame.py \ - language.py \ - network.py \ - power.py - - - - - - |