I believe the following patch will perform equivalent without the
guess_language dependency

--- diff.py     2009-06-12 14:22:05 +0000
+++ diff.py     2009-06-22 02:07:15 +0000
@@ -66,7 +66,12 @@
         if have_gtksourceview:
             self.buffer = gtksourceview2.Buffer()
             slm = gtksourceview2.LanguageManager()
-            gsl = slm.guess_language(content_type="text/x-patch")
+            gsl = None
+            for lang_id in slm.get_language_ids():
+                lang = slm.get_language(lang_id)
+                if "text/x-patch" in lang.get_mime_types():
+                    gsl = lang
+                    break
             if have_gconf:
                 self.apply_gedit_colors(self.buffer)
             self.apply_colordiff_colors(self.buffer)

-- 
olive-gtk stops with 'gtksourceview2.LanguageManager' object has no attribute 
'guess_language'
https://bugs.launchpad.net/bugs/390286
You received this bug notification because you are a member of Bazaar
GTK maintainers, which is subscribed to Bazaar GTK+ Frontends.

-- 
bzr-gtk mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.canonical.com/mailman/listinfo/bzr-gtk

Reply via email to