pylint fixes

This commit is contained in:
Simon Schampijer 2009-08-24 14:51:00 +02:00
parent 496090fe62
commit e1e8647de9
6 changed files with 12 additions and 14 deletions

View File

@ -260,7 +260,8 @@ class ActivityBundle(Bundle):
return os.path.join(self._path, icon_path)
else:
icon_data = self.get_file(icon_path).read()
temp_file, temp_file_path = tempfile.mkstemp(prefix=self._icon, suffix='.svg')
temp_file, temp_file_path = tempfile.mkstemp(prefix=self._icon,
suffix='.svg')
os.write(temp_file, icon_data)
os.close(temp_file)
return util.TempFilePath(temp_file_path)

View File

@ -1019,7 +1019,8 @@ class CellRendererIcon(gtk.GenericCellRenderer):
if self._buffer.background_color != value:
self._buffer.background_color = value
background_color = gobject.property(type=object, setter=set_background_color)
background_color = gobject.property(type=object,
setter=set_background_color)
def set_size(self, value):
if self._buffer.width != value:
@ -1061,7 +1062,7 @@ class CellRendererIcon(gtk.GenericCellRenderer):
if pos is None:
return False
path, column, x, y = pos
path_, column, x, y = pos
for cell_renderer in column.get_cell_renderers():
if cell_renderer == self:

View File

@ -26,13 +26,10 @@ import logging
import gtk
import gobject
import hippo
import pango
from sugar.graphics import palettegroup
from sugar.graphics import animator
from sugar.graphics import style
from sugar.graphics.icon import Icon
from sugar import _sugarext
# Helper function to find the gap position and size of widget a
def _calculate_gap(a, b):
@ -906,8 +903,8 @@ class CellRendererInvoker(Invoker):
def _redraw_path(self, path):
model = self._tree_view.get_model()
iter = model.get_iter(path)
model.row_changed(path, iter)
iterator = model.get_iter(path)
model.row_changed(path, iterator)
def __leave_notify_event_cb(self, widget, event):
self.notify_mouse_leave()
@ -931,7 +928,7 @@ class CellRendererInvoker(Invoker):
if pos is None:
return False
path, column, x, y = pos
path_, column, x, y_ = pos
for cell_renderer in column.get_cell_renderers():
if cell_renderer == self._cell_renderer:

View File

@ -17,7 +17,6 @@
import gtk
from sugar.graphics import style
from sugar.graphics.toolbutton import ToolButton
from sugar.graphics.palette import Palette

View File

@ -22,7 +22,6 @@ STABLE.
import gobject
import gtk
import logging
import warnings
from sugar.graphics.icon import Icon
@ -101,7 +100,8 @@ class Window(gtk.Window):
self._event_box = gtk.EventBox()
self._hbox.pack_start(self._event_box)
self._event_box.show()
self._event_box.add_events(gtk.gdk.POINTER_MOTION_HINT_MASK | gtk.gdk.POINTER_MOTION_MASK)
self._event_box.add_events(gtk.gdk.POINTER_MOTION_HINT_MASK
| gtk.gdk.POINTER_MOTION_MASK)
self._event_box.connect('motion-notify-event', self.__motion_notify_cb)
self.add(self._vbox)

View File

@ -153,9 +153,9 @@ class Buddy(gobject.GObject):
"""Retrieve our dbus object path"""
return self._object_path
def _emit_icon_changed_signal(self, bytes):
def _emit_icon_changed_signal(self, icon_data):
"""Emit GObject signal when icon has changed"""
self._icon = str(bytes)
self._icon = str(icon_data)
self.emit('icon-changed')
return False