diff options
author | Simon Schampijer <simon@schampijer.de> | 2008-04-21 22:45:59 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@schampijer.de> | 2008-04-21 22:45:59 (GMT) |
commit | 7db9f0e3affb67b642302cb60de9d9d202986499 (patch) | |
tree | 631307e6f7427ba2211eab516e6293ceae5437e6 /src | |
parent | ec0d0c0c0d1b37b2b1967bdfd29f7b63927d5f4a (diff) |
pylint controlpanel
Diffstat (limited to 'src')
-rw-r--r-- | src/controlpanel/cmd.py | 14 | ||||
-rw-r--r-- | src/controlpanel/control.py | 9 |
2 files changed, 11 insertions, 12 deletions
diff --git a/src/controlpanel/cmd.py b/src/controlpanel/cmd.py index ee1fcd7..24653b2 100644 --- a/src/controlpanel/cmd.py +++ b/src/controlpanel/cmd.py @@ -18,8 +18,6 @@ import sys import getopt from gettext import gettext as _ -from sugar import env - from controlpanel import control def cmd_help(): @@ -40,9 +38,6 @@ def main(): cmd_help() sys.exit(2) - output = None - verbose = False - if not opts: cmd_help() sys.exit() @@ -51,7 +46,8 @@ def main(): if opt in ("-h"): method = getattr(control, 'set_' + key, None) if method is None: - print _("sugar-control-panel: key=%s not an available option"% key) + print _("sugar-control-panel: key=%s not an available option" + % key) sys.exit() else: print method.__doc__ @@ -63,14 +59,16 @@ def main(): if opt in ("-g"): method = getattr(control, 'print_' + key, None) if method is None: - print _("sugar-control-panel: key=%s not an available option"% key) + print _("sugar-control-panel: key=%s not an available option" + % key) sys.exit() else: method() if opt in ("-s"): method = getattr(control, 'set_' + key, None) if method is None: - print _("sugar-control-panel: key=%s not an available option"% key) + print _("sugar-control-panel: key=%s not an available option" + % key) sys.exit() else: try: diff --git a/src/controlpanel/control.py b/src/controlpanel/control.py index faac689..bf3e681 100644 --- a/src/controlpanel/control.py +++ b/src/controlpanel/control.py @@ -395,13 +395,14 @@ def set_timezone(timezone): fromfile = os.path.join("/usr/share/zoneinfo/", timezone) try: shutil.copyfile(fromfile, "/etc/localtime") - except OSError, (errno, msg): - print (_("Error copying timezone (from %s): %s") % (fromfile, msg)) + except OSError, detail: + print (_("Error copying timezone (from %s): %s") % + (fromfile, detail)) return try: os.chmod("/etc/localtime", 0644) - except OSError, (errno, msg): - print (_("Changing permission of timezone: %s") % (msg)) + except OSError, detail: + print (_("Changing permission of timezone: %s") % detail) return # Write info to the /etc/sysconfig/clock file |