[PATCH] glib -> gobject patch



As per my recent postings to meld-list here's a patch that gets meld working on my system (Ubuntu 8.04). In r1260, the 'glib' module is used to get the function 'markup_escape_text()'. However, in my environment this module doesn't exist and the function actually belongs to the 'gobject' module (python-gobject package). Assuming r1260 works for most of the people on current trunk this seems to indicate some sort of inconsistency in how this function is packaged up. It might require a detection mechanism.

Just a note, this patch is only a local fix and probably needs expanding to work for others.

--
Edwin V
Index: tree.py
===================================================================
--- tree.py	(revision 1269)
+++ tree.py	(working copy)
@@ -15,7 +15,7 @@
 ### Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 import os
-import glib
+import gobject
 import gtk
 import misc
 import gnomeglade
@@ -85,7 +85,7 @@
         for i in range(self.ntree):
             self.set_value(child, self.column_index(COL_STATE,i), STATE_EMPTY)
             self.set_value(child, self.column_index(COL_PATH,i), self.pixstyle[STATE_EMPTY])
-            self.set_value(child, self.column_index(COL_TEXT, i), self.textstyle[STATE_EMPTY] % glib.markup_escape_text(text))
+            self.set_value(child, self.column_index(COL_TEXT, i), self.textstyle[STATE_EMPTY] % gobject.markup_escape_text(text))
         return child
 
     def add_error(self, parent, msg, pane):
@@ -93,7 +93,7 @@
         for i in range(self.ntree):
             self.set_value(err, self.column_index(COL_STATE,i), STATE_ERROR)
         self.set_value(err, self.column_index(COL_ICON, pane), self.pixstyle[STATE_ERROR][0] )
-        self.set_value(err, self.column_index(COL_TEXT, pane), self.textstyle[STATE_ERROR] % glib.markup_escape_text(msg))
+        self.set_value(err, self.column_index(COL_TEXT, pane), self.textstyle[STATE_ERROR] % gobject.markup_escape_text(msg))
 
     def value_paths(self, iter):
         return [ self.value_path(iter, i) for i in range(self.ntree) ]
@@ -104,7 +104,7 @@
 
     def set_state(self, iter, pane, state, isdir=0):
         fullname = self.get_value(iter, self.column_index(COL_PATH,pane))
-        name = glib.markup_escape_text(os.path.basename(fullname))
+        name = gobject.markup_escape_text(os.path.basename(fullname))
         STATE = self.column_index(COL_STATE, pane)
         TEXT  = self.column_index(COL_TEXT,  pane)
         ICON  = self.column_index(COL_ICON,  pane)


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