Fix color button pylint

This commit is contained in:
Simon Schampijer 2009-01-16 23:46:20 +01:00
parent 64d24f3ac5
commit 5250117b81

View File

@ -20,6 +20,7 @@ import gettext
import gtk import gtk
import gobject import gobject
import struct import struct
import logging
from sugar.graphics import style from sugar.graphics import style
from sugar.graphics.icon import Icon from sugar.graphics.icon import Icon
@ -28,7 +29,8 @@ from sugar.graphics.palette import Palette, ToolInvoker, WidgetInvoker
_ = lambda msg: gettext.dgettext('sugar-toolkit', msg) _ = lambda msg: gettext.dgettext('sugar-toolkit', msg)
def get_svg_color_string(color): def get_svg_color_string(color):
return '#%.2X%.2X%.2X' % (color.red / 257, color.green / 257, color.blue / 257) return '#%.2X%.2X%.2X' % (color.red / 257, color.green / 257,
color.blue / 257)
class _ColorButton(gtk.Button): class _ColorButton(gtk.Button):
"""This is a ColorButton for Sugar. It is similar to the gtk.ColorButton, """This is a ColorButton for Sugar. It is similar to the gtk.ColorButton,
@ -187,7 +189,7 @@ class _ColorButton(gtk.Button):
# Drag and Drop # Drag and Drop
def __drag_begin_cb(self, widget, context): def __drag_begin_cb(self, widget, context):
pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, TRUE, 8, pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, True, 8,
style.SMALL_ICON_SIZE, style.SMALL_ICON_SIZE,
style.SMALL_ICON_SIZE) style.SMALL_ICON_SIZE)
@ -207,7 +209,7 @@ class _ColorButton(gtk.Button):
def __drag_data_received_cb(self, widget, context, x, y, selection_data, \ def __drag_data_received_cb(self, widget, context, x, y, selection_data, \
info, time): info, time):
if len(selection_data.data) != 8: if len(selection_data.data) != 8:
return return
dropped = selection_data.data dropped = selection_data.data
red = struct.unpack_from('=H', dropped, 0)[0] red = struct.unpack_from('=H', dropped, 0)[0]