Patchwork [bitbake-devel,5/5] ui/crumbs/persistenttooltip: fix whitespace

login
register
mail settings
Submitter Joshua Lock
Date March 21, 2012, 12:15 a.m.
Message ID <f7d9682327566ed5ad589ef450ef9bfdbe876bdd.1332288516.git.josh@linux.intel.com>
Download mbox | patch
Permalink /patch/23931/
State Accepted
Commit 7658cd6d8e0e558f60df72b294019a40c27bc703
Headers show

Comments

Joshua Lock - March 21, 2012, 12:15 a.m.
We use 4 spaces, not a tab, in BitBake

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 lib/bb/ui/crumbs/persistenttooltip.py |  264 ++++++++++++++++----------------
 1 files changed, 132 insertions(+), 132 deletions(-)
Shane Wang - March 21, 2012, 3:49 a.m.
Joshua Lock wrote onĀ 2012-03-21:

> We use 4 spaces, not a tab, in BitBake
> 
> Signed-off-by: Joshua Lock <josh@linux.intel.com>

What's wrong with persistenttooltip.py?

--
Shane
Joshua Lock - March 21, 2012, 4:04 p.m.
On 20/03/12 20:49, Wang, Shane wrote:
> Joshua Lock wrote on 2012-03-21:
>
>> We use 4 spaces, not a tab, in BitBake
>>
>> Signed-off-by: Joshua Lock<josh@linux.intel.com>
>
> What's wrong with persistenttooltip.py?

Nothing that we aren't already tracking in Bugzilla - this change just 
sets the indentation to match the rest of BitBake.

Cheers,
Joshua

Patch

diff --git a/lib/bb/ui/crumbs/persistenttooltip.py b/lib/bb/ui/crumbs/persistenttooltip.py
index d065ab2..8ba0043 100644
--- a/lib/bb/ui/crumbs/persistenttooltip.py
+++ b/lib/bb/ui/crumbs/persistenttooltip.py
@@ -26,135 +26,135 @@  except:
     pass
 
 class PersistentTooltip(gtk.Window):
-	"""
-	A tooltip which persists once shown until the user dismisses it with the Esc
-	key or by clicking the close button.
-
-	# FIXME: the PersistentTooltip should be disabled when the user clicks anywhere off
-	# it. We can't do this with focus-out-event becuase modal ensures we have focus?
-
-	markup: some Pango text markup to display in the tooltip
-	"""
-	def __init__(self, markup):
-		gtk.Window.__init__(self, gtk.WINDOW_POPUP)
-
-		# Inherit the system theme for a tooltip
-		style = gtk.rc_get_style_by_paths(gtk.settings_get_default(),
-						'gtk-tooltip', 'gtk-tooltip', gobject.TYPE_NONE)
-		self.set_style(style)
-
-		# The placement of the close button on the tip should reflect how the
-		# window manager of the users system places close buttons. Try to read
-		# the metacity gconf key to determine whether the close button is on the
-		# left or the right.
-		# In the case that we can't determine the users configuration we default
-		# to close buttons being on the right.
-		__button_right = True
-		try:
-		    client = gconf.client_get_default()
-		    order = client.get_string("/apps/metacity/general/button_layout")
-		    if order and order.endswith(":"):
-		        __button_right = False
-		except NameError:
-			pass
-
-		# We need to ensure we're only shown once
-		self.shown = False
-
-		# We don't want any WM decorations
-		self.set_decorated(False)
-		# We don't want to show in the taskbar or window switcher
-		self.set_skip_pager_hint(True)
-		self.set_skip_taskbar_hint(True)
-		# We must be modal to ensure we grab focus when presented from a gtk.Dialog
-		self.set_modal(True)
-
-		self.set_border_width(0)
-		self.set_position(gtk.WIN_POS_MOUSE)
-		self.set_opacity(0.95)
-
-		# Draw our label and close buttons
-		hbox = gtk.HBox(False, 0)
-		hbox.show()
-		vbox = gtk.VBox(False, 0)
-		vbox.show()
-		vbox.pack_start(hbox, True, True, 0)
-
-		img = gtk.Image()
-		img.set_from_stock(gtk.STOCK_CLOSE, gtk.ICON_SIZE_BUTTON)
-
-		self.button = gtk.Button()
-		self.button.set_image(img)
-		self.button.connect("clicked", self._dismiss_cb)
-		self.button.set_can_default(True)
-		self.button.grab_focus()
-		self.button.show()
-		if __button_right:
-		    hbox.pack_end(self.button, False, False, 0)
-		else:
-		    hbox.pack_start(self.button, False, False, 0)
-
-		self.set_default(self.button)
-
-		hbox = gtk.HBox(True, 6)
-		hbox.set_border_width(6)
-		hbox.show()
-		vbox.pack_end(hbox, True, True, 6)
-		self.label = gtk.Label()
-		# We want to match the colours of the normal tooltips, as dictated by
-		# the users gtk+-2.0 theme, wherever possible - on some systems this
-		# requires explicitly setting a fg_color for the label which matches the
-		# tooltip_fg_color
-		settings = gtk.settings_get_default()
-		colours = settings.get_property('gtk-color-scheme').split('\n')
-		# remove any empty lines, there's likely to be a trailing one after
-		# calling split on a dictionary-like string
-		colours = filter(None, colours)
-		for col in colours:
-			item, val = col.split(': ')
-			if item == 'tooltip_fg_color':
-				style = self.label.get_style()
-				style.fg[gtk.STATE_NORMAL] = gtk.gdk.color_parse(val)
-				self.label.set_style(style)
-				break # we only care for the tooltip_fg_color
-		self.label.set_markup(markup)
-		self.label.show()
-		hbox.pack_end(self.label, True, True, 6)
-
-		self.connect("key-press-event", self._catch_esc_cb)
-
-		self.add(vbox)
-
-	"""
-	Callback when the PersistentTooltip's close button is clicked.
-	Hides the PersistentTooltip.
-	"""
-	def _dismiss_cb(self, button):
-		self.hide()
-		return True
-
-	"""
-	Callback when the Esc key is detected. Hides the PersistentTooltip.
-	"""
-	def _catch_esc_cb(self, widget, event):
-		keyname = gtk.gdk.keyval_name(event.keyval)
-		if keyname == "Escape":
-			self.hide()
-		return True
-
-	"""
-	Called to present the PersistentTooltip.
-	Overrides the superclasses show() method to include state tracking.
-	"""
-	def show(self):
-		if not self.shown:
-			self.shown = True
-			gtk.Window.show(self)
-
-	"""
-	Called to hide the PersistentTooltip.
-	Overrides the superclasses hide() method to include state tracking.
-	"""
-	def hide(self):
-		self.shown = False
-		gtk.Window.hide(self)
+    """
+    A tooltip which persists once shown until the user dismisses it with the Esc
+    key or by clicking the close button.
+
+    # FIXME: the PersistentTooltip should be disabled when the user clicks anywhere off
+    # it. We can't do this with focus-out-event becuase modal ensures we have focus?
+
+    markup: some Pango text markup to display in the tooltip
+    """
+    def __init__(self, markup):
+        gtk.Window.__init__(self, gtk.WINDOW_POPUP)
+
+        # Inherit the system theme for a tooltip
+        style = gtk.rc_get_style_by_paths(gtk.settings_get_default(),
+                        'gtk-tooltip', 'gtk-tooltip', gobject.TYPE_NONE)
+        self.set_style(style)
+
+        # The placement of the close button on the tip should reflect how the
+        # window manager of the users system places close buttons. Try to read
+        # the metacity gconf key to determine whether the close button is on the
+        # left or the right.
+        # In the case that we can't determine the users configuration we default
+        # to close buttons being on the right.
+        __button_right = True
+        try:
+            client = gconf.client_get_default()
+            order = client.get_string("/apps/metacity/general/button_layout")
+            if order and order.endswith(":"):
+                __button_right = False
+        except NameError:
+            pass
+
+        # We need to ensure we're only shown once
+        self.shown = False
+
+        # We don't want any WM decorations
+        self.set_decorated(False)
+        # We don't want to show in the taskbar or window switcher
+        self.set_skip_pager_hint(True)
+        self.set_skip_taskbar_hint(True)
+        # We must be modal to ensure we grab focus when presented from a gtk.Dialog
+        self.set_modal(True)
+
+        self.set_border_width(0)
+        self.set_position(gtk.WIN_POS_MOUSE)
+        self.set_opacity(0.95)
+
+        # Draw our label and close buttons
+        hbox = gtk.HBox(False, 0)
+        hbox.show()
+        vbox = gtk.VBox(False, 0)
+        vbox.show()
+        vbox.pack_start(hbox, True, True, 0)
+
+        img = gtk.Image()
+        img.set_from_stock(gtk.STOCK_CLOSE, gtk.ICON_SIZE_BUTTON)
+
+        self.button = gtk.Button()
+        self.button.set_image(img)
+        self.button.connect("clicked", self._dismiss_cb)
+        self.button.set_can_default(True)
+        self.button.grab_focus()
+        self.button.show()
+        if __button_right:
+            hbox.pack_end(self.button, False, False, 0)
+        else:
+            hbox.pack_start(self.button, False, False, 0)
+
+        self.set_default(self.button)
+
+        hbox = gtk.HBox(True, 6)
+        hbox.set_border_width(6)
+        hbox.show()
+        vbox.pack_end(hbox, True, True, 6)
+        self.label = gtk.Label()
+        # We want to match the colours of the normal tooltips, as dictated by
+        # the users gtk+-2.0 theme, wherever possible - on some systems this
+        # requires explicitly setting a fg_color for the label which matches the
+        # tooltip_fg_color
+        settings = gtk.settings_get_default()
+        colours = settings.get_property('gtk-color-scheme').split('\n')
+        # remove any empty lines, there's likely to be a trailing one after
+        # calling split on a dictionary-like string
+        colours = filter(None, colours)
+        for col in colours:
+            item, val = col.split(': ')
+            if item == 'tooltip_fg_color':
+                style = self.label.get_style()
+                style.fg[gtk.STATE_NORMAL] = gtk.gdk.color_parse(val)
+                self.label.set_style(style)
+                break # we only care for the tooltip_fg_color
+        self.label.set_markup(markup)
+        self.label.show()
+        hbox.pack_end(self.label, True, True, 6)
+
+        self.connect("key-press-event", self._catch_esc_cb)
+
+        self.add(vbox)
+
+    """
+    Callback when the PersistentTooltip's close button is clicked.
+    Hides the PersistentTooltip.
+    """
+    def _dismiss_cb(self, button):
+        self.hide()
+        return True
+
+    """
+    Callback when the Esc key is detected. Hides the PersistentTooltip.
+    """
+    def _catch_esc_cb(self, widget, event):
+        keyname = gtk.gdk.keyval_name(event.keyval)
+        if keyname == "Escape":
+            self.hide()
+        return True
+
+    """
+    Called to present the PersistentTooltip.
+    Overrides the superclasses show() method to include state tracking.
+    """
+    def show(self):
+        if not self.shown:
+            self.shown = True
+            gtk.Window.show(self)
+
+    """
+    Called to hide the PersistentTooltip.
+    Overrides the superclasses hide() method to include state tracking.
+    """
+    def hide(self):
+        self.shown = False
+        gtk.Window.hide(self)