From 83f76f115a89b9430f00c93d7a11b2d61e1001b1 Mon Sep 17 00:00:00 2001 From: Simon Schampijer Date: Thu, 24 Apr 2008 16:55:19 +0200 Subject: [PATCH] Use new style for unused variables --- sugar/activity/activityfactory.py | 2 +- sugar/graphics/palette.py | 5 +++-- sugar/graphics/toolbox.py | 2 +- sugar/network.py | 10 +++++----- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/sugar/activity/activityfactory.py b/sugar/activity/activityfactory.py index 7bf36c43..42b8c409 100644 --- a/sugar/activity/activityfactory.py +++ b/sugar/activity/activityfactory.py @@ -58,7 +58,7 @@ _children_pid = [] def _sigchild_handler(signum, frame): for child_pid in _children_pid: - pid = os.waitpid(child_pid, os.WNOHANG)[0] + pid, status_ = os.waitpid(child_pid, os.WNOHANG) if pid > 0: _children_pid.remove(pid) diff --git a/sugar/graphics/palette.py b/sugar/graphics/palette.py index e2dfd213..19a72493 100644 --- a/sugar/graphics/palette.py +++ b/sugar/graphics/palette.py @@ -98,7 +98,8 @@ class MouseSpeedDetector(gobject.GObject): def _get_mouse_position(self): display = gtk.gdk.display_get_default() - return display.get_pointer()[1:3] + screen_, x, y, mask_ = display.get_pointer() + return (x, y) def _detect_motion(self): oldx, oldy = self._mouse_pos @@ -737,7 +738,7 @@ class Invoker(gobject.GObject): if self._cursor_x == -1 or self._cursor_y == -1: display = gtk.gdk.display_get_default() - x, y = display.get_pointer()[1:3] + screen_, x, y, mask_ = display.get_pointer() self._cursor_x = x self._cursor_y = y diff --git a/sugar/graphics/toolbox.py b/sugar/graphics/toolbox.py index 4897add9..f0889be5 100644 --- a/sugar/graphics/toolbox.py +++ b/sugar/graphics/toolbox.py @@ -59,7 +59,7 @@ class Toolbox(gtk.VBox): def add_toolbar(self, name, toolbar): label = gtk.Label(name) - width = label.size_request()[0] + width, height_ = label.size_request() label.set_size_request(max(width, style.TOOLBOX_TAB_LABEL_WIDTH), -1) label.set_alignment(0.0, 0.5) diff --git a/sugar/network.py b/sugar/network.py index db8a562d..66327619 100644 --- a/sugar/network.py +++ b/sugar/network.py @@ -222,10 +222,10 @@ class GlibURLDownloader(gobject.GObject): else: fname = self._get_filename_from_headers(self._info.headers) self._suggested_fname = fname - path = urllib.splittype(self._url)[1] - path = urllib.splithost(path or "")[1] - path = urllib.splitquery(path or "")[0] - path = urllib.splitattr(path or "")[0] + garbage_, path = urllib.splittype(self._url) + garbage_, path = urllib.splithost(path or "") + path, garbage_ = urllib.splitquery(path or "") + path, garbage_ = urllib.splitattr(path or "") suffix = os.path.splitext(path)[1] (self._outf, self._fname) = tempfile.mkstemp(suffix=suffix, dir=self._destdir) @@ -399,7 +399,7 @@ class GlibXMLRPCTransport(xmlrpclib.Transport): def make_connection(self, host): """Use our own connection object so we can get its socket.""" # create a HTTP connection object from a host descriptor - host = self.get_host_info(host)[0] + host, extra_headers_, x509_ = self.get_host_info(host) return GlibHTTP(host) ##