pylint icon, a few false positive left

This commit is contained in:
Marco Pesenti Gritti 2008-04-19 00:37:19 +02:00
parent 03e515b463
commit 97d9d21311

View File

@ -15,10 +15,8 @@
# Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA. # Boston, MA 02111-1307, USA.
import os
import re import re
import math import math
import time
import logging import logging
import gobject import gobject
@ -26,9 +24,7 @@ import gtk
import hippo import hippo
import cairo import cairo
from sugar.graphics.style import Color
from sugar.graphics.xocolor import XoColor from sugar.graphics.xocolor import XoColor
from sugar.graphics import style
from sugar.graphics.palette import Palette, CanvasInvoker from sugar.graphics.palette import Palette, CanvasInvoker
from sugar.util import LRU from sugar.util import LRU
@ -79,6 +75,7 @@ class _IconBuffer(object):
def __init__(self): def __init__(self):
self.icon_name = None self.icon_name = None
self.icon_size = None
self.file_name = None self.file_name = None
self.fill_color = None self.fill_color = None
self.stroke_color = None self.stroke_color = None
@ -362,10 +359,11 @@ class Icon(gtk.Image):
if self.get_direction() != gtk.TEXT_DIR_LTR: if self.get_direction() != gtk.TEXT_DIR_LTR:
xalign = 1.0 - xalign xalign = 1.0 - xalign
x = math.floor(self.allocation.x + xpad + allocation = self.get_allocation()
(self.allocation.width - requisition[0]) * xalign) x = math.floor(allocation.x + xpad +
y = math.floor(self.allocation.y + ypad + (allocation.width - requisition[0]) * xalign)
(self.allocation.height - requisition[1]) * yalign) y = math.floor(allocation.y + ypad +
(allocation.height - requisition[1]) * yalign)
cr = self.window.cairo_create() cr = self.window.cairo_create()
cr.set_source_surface(surface, x, y) cr.set_source_surface(surface, x, y)
@ -464,7 +462,8 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem):
self._buffer.height = value self._buffer.height = value
self.emit_request_changed() self.emit_request_changed()
elif pspec.name == 'scale': elif pspec.name == 'scale':
logging.warning('CanvasIcon: the scale parameter is currently unsupported') logging.warning(
'CanvasIcon: the scale parameter is currently unsupported')
if self._buffer.scale != value: if self._buffer.scale != value:
self._buffer.scale = value self._buffer.scale = value
self.emit_request_changed() self.emit_request_changed()