[meld] Remove pre-gtksourceview2 support, removing final GnomeVFS usage
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Remove pre-gtksourceview2 support, removing final GnomeVFS usage
- Date: Fri, 22 Oct 2010 20:40:00 +0000 (UTC)
commit f236b50f649b0b55f3bda7ef201d7b76b55ab1d5
Author: Kai Willadsen <kai willadsen gmail com>
Date: Fri Oct 8 18:39:32 2010 +1000
Remove pre-gtksourceview2 support, removing final GnomeVFS usage
GtkSourceView 2.0 was released one year before our current required
Gtk+ version, so keeping back compat with earlier APIs doesn't seem
worthwhile.
meld/util/sourceviewer.py | 35 +----------------------------------
1 files changed, 1 insertions(+), 34 deletions(-)
---
diff --git a/meld/util/sourceviewer.py b/meld/util/sourceviewer.py
index ec97378..d897047 100644
--- a/meld/util/sourceviewer.py
+++ b/meld/util/sourceviewer.py
@@ -71,38 +71,6 @@ class _srcviewer(object):
def set_highlighting_enabled_from_file(self, buf, fname, enabled):
self.set_highlighting_enabled(buf, self.get_language_from_file(os.path.abspath(fname)), enabled)
-class sourceview(_srcviewer):
- srcviewer_module = "sourceview"
-
- def version_check(self):
- # ImportError exceptions are caught, so we
- # won't use 'sourceview' without gnomevfs
- import gnomevfs
- self.gvfs = gnomevfs
-
- def overrides(self):
- self.GtkTextView = self.gsv.SourceView
- self.GtkTextBuffer = self.gsv.SourceBuffer
-
- def GtkLanguageManager(self):
- return self.gsv.SourceLanguagesManager()
-
- def set_tab_width(self, tab, tab_size):
- return tab.set_tabs_width(tab_size)
-
- def set_highlight(self, buf, enabled):
- return buf.set_highlight(enabled)
-
- def get_language_from_mime_type(self, mime_type):
- return self.get_language_manager().get_language_from_mime_type(mime_type)
-
- def get_language_from_file(self, filename):
- mime_type = self.gvfs.get_mime_type(
- self.gvfs.make_uri_from_input(os.path.abspath(filename)))
- return self.get_language_from_mime_type(mime_type)
-
-class gtksourceview(sourceview):
- srcviewer_module = "gtksourceview"
class _gtksourceview2(_srcviewer):
srcviewer_module = "gtksourceview2"
@@ -223,8 +191,7 @@ class nullsourceview(_srcviewer):
pass
def _get_srcviewer():
- for srcv in (gtksourceview210, gtksourceview24, gtksourceview22,
- gtksourceview, sourceview):
+ for srcv in (gtksourceview210, gtksourceview24, gtksourceview22):
try:
return srcv()
except ImportError:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]