[rhythmbox/gobject-introspection: 11/34] update gi'd python plugins for gi namespace rethink



commit 4ddc34fb5b183bd6851e688d2fcd8c9eb33a80fa
Author: Jonathan Matthew <jonathan d14n org>
Date:   Sat Jul 10 22:40:09 2010 +1000

    update gi'd python plugins for gi namespace rethink

 plugins/im-status/im-status/__init__.py   |   15 ++++++++-------
 plugins/pythonconsole/pythonconsole.py    |   10 ++++++----
 plugins/replaygain/replaygain/__init__.py |    6 +++---
 plugins/replaygain/replaygain/config.py   |    2 +-
 plugins/replaygain/replaygain/player.py   |    4 ++--
 plugins/sample-python/sample-python.py    |   10 +++++-----
 plugins/sendto/__init__.py                |    6 +++---
 7 files changed, 28 insertions(+), 25 deletions(-)
---
diff --git a/plugins/im-status/im-status/__init__.py b/plugins/im-status/im-status/__init__.py
index 8408ea8..6890069 100644
--- a/plugins/im-status/im-status/__init__.py
+++ b/plugins/im-status/im-status/__init__.py
@@ -26,7 +26,8 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
 
 import gi.repository
-from gi.repository import Rhythmbox
+from gi.repository import RB
+from gi.repository import RhythmDB
 
 try:
   import dbus
@@ -59,9 +60,9 @@ PURPLE_BUS_NAME = 'im.pidgin.purple.PurpleService'
 PURPLE_OBJ_PATH = '/im/pidgin/purple/PurpleObject'
 PURPLE_IFACE_NAME = 'im.pidgin.purple.PurpleInterface'
 
-class IMStatusPlugin (Rhythmbox.RBPlugin):
+class IMStatusPlugin (RB.Plugin):
   def __init__ (self):
-    Rhythmbox.RBPlugin.__init__ (self)
+    RB.Plugin.__init__ (self)
 
   def activate (self, shell):
     self.shell = shell
@@ -135,11 +136,11 @@ class IMStatusPlugin (Rhythmbox.RBPlugin):
 
   def set_status_from_entry (self):
     db = self.shell.get_property ("db")
-    self.current_artist = db.entry_get (self.current_entry, Rhythmbox.RhythmDBPropType.ARTIST)
-    self.current_title  = db.entry_get (self.current_entry, Rhythmbox.RhythmDBPropType.TITLE)
-    self.current_album  = db.entry_get (self.current_entry, Rhythmbox.RhythmDBPropType.ALBUM)
+    self.current_artist = db.entry_get (self.current_entry, RhythmDB.PropType.ARTIST)
+    self.current_title  = db.entry_get (self.current_entry, RhythmDB.PropType.TITLE)
+    self.current_album  = db.entry_get (self.current_entry, RhythmDB.PropType.ALBUM)
 
-    if self.current_entry.get_entry_type().category == Rhythmbox.RhythmDBEntryCategory.STREAM:
+    if self.current_entry.get_entry_type().category == RhythmDB.EntryCategory.STREAM:
       if not self.current_artist:
         self.current_artist = db.entry_request_extra_metadata (self.current_entry, STREAM_SONG_ARTIST)
       if not self.current_title:
diff --git a/plugins/pythonconsole/pythonconsole.py b/plugins/pythonconsole/pythonconsole.py
index e2c08e9..7bfa613 100644
--- a/plugins/pythonconsole/pythonconsole.py
+++ b/plugins/pythonconsole/pythonconsole.py
@@ -42,7 +42,8 @@ from gi.repository import Gtk
 from gi.repository import Gdk
 from gi.repository import Pango
 from gi.repository import GConf
-from gi.repository import Rhythmbox
+from gi.repository import RB
+from gi.repository import RhythmDB
 
 try:
 	import rpdb2
@@ -63,9 +64,9 @@ ui_str = """
 </ui>
 """
 
-class PythonConsolePlugin(Rhythmbox.RBPlugin):
+class PythonConsolePlugin(RB.Plugin):
 	def __init__(self):
-		Rhythmbox.RBPlugin.__init__(self)
+		RB.Plugin.__init__(self)
 		self.window = None
 			
 	def activate(self, shell):
@@ -112,7 +113,8 @@ class PythonConsolePlugin(Rhythmbox.RBPlugin):
 		print "dang"
 		if not self.window:
 			ns = {'__builtins__' : __builtins__, 
-			      'Rhythmbox' : Rhythmbox,
+			      'RB' : RB,
+			      'RhythmDB' : RhythmDB,
 			      'shell' : shell}
 			console = PythonConsole(namespace = ns, 
 			                        destroy_cb = self.destroy_console)
diff --git a/plugins/replaygain/replaygain/__init__.py b/plugins/replaygain/replaygain/__init__.py
index e81c2ba..9d0ea46 100644
--- a/plugins/replaygain/replaygain/__init__.py
+++ b/plugins/replaygain/replaygain/__init__.py
@@ -26,15 +26,15 @@
 #
 
 import gi.repository
-from gi.repository import Rhythmbox
+from gi.repository import RB
 
 from config import ReplayGainConfigDialog
 from player import ReplayGainPlayer
 
-class ReplayGainPlugin(Rhythmbox.RBPlugin):
+class ReplayGainPlugin(RB.Plugin):
 
 	def __init__ (self):
-		Rhythmbox.RBPlugin.__init__ (self)
+		RB.Plugin.__init__ (self)
 		self.config_dialog = None
 
 	def activate (self, shell):
diff --git a/plugins/replaygain/replaygain/config.py b/plugins/replaygain/replaygain/config.py
index c591a88..e84c6e7 100644
--- a/plugins/replaygain/replaygain/config.py
+++ b/plugins/replaygain/replaygain/config.py
@@ -29,7 +29,7 @@ import gobject
 import gi.repository
 from gi.repository import Gtk
 from gi.repository import GConf
-from gi.repository import Rhythmbox
+from gi.repository import RB
 
 GCONF_DIR = '/apps/rhythmbox/plugins/replaygain'
 
diff --git a/plugins/replaygain/replaygain/player.py b/plugins/replaygain/replaygain/player.py
index ce0b743..23c97f8 100644
--- a/plugins/replaygain/replaygain/player.py
+++ b/plugins/replaygain/replaygain/player.py
@@ -29,7 +29,7 @@ import gobject
 import gst
 import gi.repository
 from gi.repository import GConf
-from gi.repository import Rhythmbox
+from gi.repository import RB
 
 import config
 
@@ -46,7 +46,7 @@ class ReplayGainPlayer(object):
 
 		if len(missing) > 0:
 			msg = _("The GStreamer elements required for ReplayGain processing are not available. The missing elements are: %s") % ", ".join(missing)
-			Rhythmbox.error_dialog(shell.props.window, _("ReplayGain GStreamer plugins not available"), msg)
+			RB.error_dialog(shell.props.window, _("ReplayGain GStreamer plugins not available"), msg)
 			raise Exception(msg)
 
 		self.shell_player = shell.props.shell_player
diff --git a/plugins/sample-python/sample-python.py b/plugins/sample-python/sample-python.py
index ceaecca..7ee9c5a 100644
--- a/plugins/sample-python/sample-python.py
+++ b/plugins/sample-python/sample-python.py
@@ -1,12 +1,12 @@
 
 import gobject
 import gi.repository
-from gi.repository import Rhythmbox
+from gi.repository import RB
 
-class SamplePython(Rhythmbox.RBPlugin):
+class SamplePython(RB.Plugin):
 
 	def __init__(self):
-		Rhythmbox.RBPlugin.__init__(self)
+		RB.Plugin.__init__(self)
 			
 	def activate(self, shell):
 		print "activating sample python plugin"
@@ -22,8 +22,8 @@ class SamplePython(Rhythmbox.RBPlugin):
 		self.source = None
 
 
-class PythonSource(Rhythmbox.RBSource):
+class PythonSource(RB.Source):
 	def __init__(self):
-		Rhythmbox.RBSource.__init__(self)
+		RB.Source.__init__(self)
 		
 gobject.type_register(PythonSource)
diff --git a/plugins/sendto/__init__.py b/plugins/sendto/__init__.py
index 168881e..3d51545 100644
--- a/plugins/sendto/__init__.py
+++ b/plugins/sendto/__init__.py
@@ -27,7 +27,7 @@
 import glib
 import gi.repository
 from gi.repository import Gtk
-from gi.repository import Rhythmbox
+from gi.repository import RB
 
 ui_definition = """
 <ui>
@@ -44,9 +44,9 @@ ui_definition = """
     </popup>
 </ui>"""
 
-class SendToPlugin (Rhythmbox.RBPlugin):
+class SendToPlugin (RB.Plugin):
     def __init__(self):
-        Rhythmbox.RBPlugin.__init__(self)
+        RB.Plugin.__init__(self)
 
     def activate(self, shell):
         self.__action = Gtk.Action(name='SendTo', label=_('Send to...'),



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