Fix pylint/pep8 warnings
This commit is contained in:
parent
68fa6bf093
commit
f5f8c807d3
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
import gobject
|
import gobject
|
||||||
import logging
|
|
||||||
import gettext
|
import gettext
|
||||||
import gconf
|
import gconf
|
||||||
|
|
||||||
|
@ -16,9 +16,6 @@
|
|||||||
# Boston, MA 02111-1307, USA.
|
# Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
import gobject
|
|
||||||
import logging
|
|
||||||
from gobject import SIGNAL_RUN_FIRST, TYPE_NONE, TYPE_PYOBJECT
|
|
||||||
|
|
||||||
from sugar.graphics import style
|
from sugar.graphics import style
|
||||||
from sugar.graphics.toolbutton import ToolButton
|
from sugar.graphics.toolbutton import ToolButton
|
||||||
|
@ -28,7 +28,7 @@ import logging
|
|||||||
import gtk
|
import gtk
|
||||||
import pango
|
import pango
|
||||||
|
|
||||||
_FOCUS_LINE_WIDTH = 2
|
FOCUS_LINE_WIDTH = 2
|
||||||
_TAB_CURVATURE = 1
|
_TAB_CURVATURE = 1
|
||||||
|
|
||||||
def _compute_zoom_factor():
|
def _compute_zoom_factor():
|
||||||
@ -115,8 +115,8 @@ FONT_BOLD_H = zoom(24)
|
|||||||
|
|
||||||
TOOLBOX_SEPARATOR_HEIGHT = zoom(9)
|
TOOLBOX_SEPARATOR_HEIGHT = zoom(9)
|
||||||
TOOLBOX_HORIZONTAL_PADDING = zoom(75)
|
TOOLBOX_HORIZONTAL_PADDING = zoom(75)
|
||||||
TOOLBOX_TAB_VBORDER = int((zoom(36) - FONT_NORMAL_H - _FOCUS_LINE_WIDTH) / 2)
|
TOOLBOX_TAB_VBORDER = int((zoom(36) - FONT_NORMAL_H - FOCUS_LINE_WIDTH) / 2)
|
||||||
TOOLBOX_TAB_HBORDER = zoom(15) - _FOCUS_LINE_WIDTH - _TAB_CURVATURE
|
TOOLBOX_TAB_HBORDER = zoom(15) - FOCUS_LINE_WIDTH - _TAB_CURVATURE
|
||||||
TOOLBOX_TAB_LABEL_WIDTH = zoom(150 - 15 * 2)
|
TOOLBOX_TAB_LABEL_WIDTH = zoom(150 - 15 * 2)
|
||||||
|
|
||||||
COLOR_BLACK = Color('#000000')
|
COLOR_BLACK = Color('#000000')
|
||||||
|
@ -15,11 +15,9 @@
|
|||||||
# 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 logging
|
|
||||||
|
|
||||||
import gobject
|
|
||||||
from gobject import SIGNAL_RUN_FIRST, TYPE_NONE
|
|
||||||
import gtk
|
import gtk
|
||||||
|
import gobject
|
||||||
|
import logging
|
||||||
|
|
||||||
from sugar.graphics import style
|
from sugar.graphics import style
|
||||||
from sugar.graphics.palette import PaletteWindow, ToolInvoker
|
from sugar.graphics.palette import PaletteWindow, ToolInvoker
|
||||||
@ -120,13 +118,13 @@ class ToolbarButton(ToolButton):
|
|||||||
self.get_style().paint_box(event.window,
|
self.get_style().paint_box(event.window,
|
||||||
gtk.STATE_NORMAL, gtk.SHADOW_IN, event.area, self,
|
gtk.STATE_NORMAL, gtk.SHADOW_IN, event.area, self,
|
||||||
'palette-invoker', alloc.x, 0,
|
'palette-invoker', alloc.x, 0,
|
||||||
alloc.width, alloc.height + style._FOCUS_LINE_WIDTH)
|
alloc.width, alloc.height + style.FOCUS_LINE_WIDTH)
|
||||||
|
|
||||||
if self.child.state != gtk.STATE_PRELIGHT:
|
if self.child.state != gtk.STATE_PRELIGHT:
|
||||||
self.get_style().paint_box(event.window,
|
self.get_style().paint_box(event.window,
|
||||||
gtk.STATE_NORMAL, gtk.SHADOW_NONE, event.area, self, None,
|
gtk.STATE_NORMAL, gtk.SHADOW_NONE, event.area, self, None,
|
||||||
alloc.x + style._FOCUS_LINE_WIDTH, style._FOCUS_LINE_WIDTH,
|
alloc.x + style.FOCUS_LINE_WIDTH, style.FOCUS_LINE_WIDTH,
|
||||||
alloc.width - style._FOCUS_LINE_WIDTH*2, alloc.height)
|
alloc.width - style.FOCUS_LINE_WIDTH*2, alloc.height)
|
||||||
|
|
||||||
gtk.ToolButton.do_expose_event(self, event)
|
gtk.ToolButton.do_expose_event(self, event)
|
||||||
_paint_arrow(self, event, gtk.ARROW_UP)
|
_paint_arrow(self, event, gtk.ARROW_UP)
|
||||||
@ -135,6 +133,7 @@ class ToolbarBox(gtk.VBox):
|
|||||||
def __init__(self, padding=style.TOOLBOX_HORIZONTAL_PADDING):
|
def __init__(self, padding=style.TOOLBOX_HORIZONTAL_PADDING):
|
||||||
gtk.VBox.__init__(self)
|
gtk.VBox.__init__(self)
|
||||||
self.expanded_button = None
|
self.expanded_button = None
|
||||||
|
self.background = None
|
||||||
|
|
||||||
self._toolbar = gtk.Toolbar()
|
self._toolbar = gtk.Toolbar()
|
||||||
self._toolbar.owner = self
|
self._toolbar.owner = self
|
||||||
@ -155,7 +154,10 @@ class ToolbarBox(gtk.VBox):
|
|||||||
self.remove(button.page_widget)
|
self.remove(button.page_widget)
|
||||||
self.expanded_button = None
|
self.expanded_button = None
|
||||||
|
|
||||||
toolbar = property(lambda self: self._toolbar)
|
def get_toolbar(self):
|
||||||
|
return self._toolbar
|
||||||
|
|
||||||
|
toolbar = property(get_toolbar)
|
||||||
|
|
||||||
def get_padding(self):
|
def get_padding(self):
|
||||||
return self.toolbar.parent.props.left_padding
|
return self.toolbar.parent.props.left_padding
|
||||||
@ -270,12 +272,12 @@ def _embody_page(box_class, widget):
|
|||||||
box.show()
|
box.show()
|
||||||
return box
|
return box
|
||||||
|
|
||||||
def _paint_arrow(widget, event, type):
|
def _paint_arrow(widget, event, arrow_type):
|
||||||
alloc = widget.allocation
|
alloc = widget.allocation
|
||||||
x = alloc.x + alloc.width / 2 - style.TOOLBAR_ARROW_SIZE / 2
|
x = alloc.x + alloc.width / 2 - style.TOOLBAR_ARROW_SIZE / 2
|
||||||
y = alloc.y + alloc.height - int(style.TOOLBAR_ARROW_SIZE * .85)
|
y = alloc.y + alloc.height - int(style.TOOLBAR_ARROW_SIZE * .85)
|
||||||
|
|
||||||
widget.get_style().paint_arrow(event.window,
|
widget.get_style().paint_arrow(event.window,
|
||||||
gtk.STATE_NORMAL, gtk.SHADOW_NONE, event.area, widget,
|
gtk.STATE_NORMAL, gtk.SHADOW_NONE, event.area, widget,
|
||||||
None, type, True,
|
None, arrow_type, True,
|
||||||
x, y, style.TOOLBAR_ARROW_SIZE, style.TOOLBAR_ARROW_SIZE)
|
x, y, style.TOOLBAR_ARROW_SIZE, style.TOOLBAR_ARROW_SIZE)
|
||||||
|
Loading…
Reference in New Issue
Block a user