[rhythmbox/gobject-introspection: 7/34] port rb module to use gi



commit 87a0eb103e1d320ea41f5d7ff693898fd70d0cb1
Author: Jonathan Matthew <jonathan d14n org>
Date:   Thu Jul 8 14:15:13 2010 +1000

    port rb module to use gi

 plugins/rb/Loader.py   |   15 ++++++++-------
 plugins/rb/__init__.py |    2 --
 2 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/plugins/rb/Loader.py b/plugins/rb/Loader.py
index 0ed46b3..08b7027 100644
--- a/plugins/rb/Loader.py
+++ b/plugins/rb/Loader.py
@@ -25,20 +25,21 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
 
 import gobject
-import gtk
+import gi
+from gi.repository import Gdk
 import sys
 import gio
 
 def callback_with_gdk_lock(callback, data, args):
-	gtk.gdk.threads_enter()
+	Gdk.threads_enter()
 	try:
 		v = callback(data, *args)
-		gtk.gdk.threads_leave()
+		Gdk.threads_leave()
 		return v
 	except Exception, e:
 		print "Exception caught in loader callback: %s" % str(e)
 		sys.excepthook(*sys.exc_info())
-		gtk.gdk.threads_leave()
+		Gdk.threads_leave()
 
 
 class Loader(object):
@@ -76,13 +77,13 @@ class ChunkLoader(object):
 		return self.callback(result, self.total, *self.args)
 
 	def _callback_gdk(self, result):
-		gtk.gdk.threads_enter()
+		Gdk.threads_enter()
 		try:
 			v = self._callback(result)
-			gtk.gdk.threads_leave()
+			Gdk.threads_leave()
 			return v
 		except Exception, e:
-			gtk.gdk.threads_leave()
+			Gdk.threads_leave()
 			raise e
 
 	def _error_idle_cb(self, error):
diff --git a/plugins/rb/__init__.py b/plugins/rb/__init__.py
index 5f616c6..de7b6ab 100644
--- a/plugins/rb/__init__.py
+++ b/plugins/rb/__init__.py
@@ -30,8 +30,6 @@ import sys
 import os.path
 import os
 
-import gtk
-
 # rb classes
 from Loader import Loader
 from Loader import ChunkLoader



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]