pygtksourceview r88 - in trunk: . test
- From: gianmt svn gnome org
- To: svn-commits-list gnome org
- Subject: pygtksourceview r88 - in trunk: . test
- Date: Sun, 10 Aug 2008 19:27:14 +0000 (UTC)
Author: gianmt
Date: Sun Aug 10 19:27:13 2008
New Revision: 88
URL: http://svn.gnome.org/viewvc/pygtksourceview?rev=88&view=rev
Log:
bump pygobject required version 2.15.2, remove gnomevfs dependency, use gio instead.
Modified:
trunk/ChangeLog
trunk/configure.ac
trunk/test/test-widget.py
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Sun Aug 10 19:27:13 2008
@@ -7,7 +7,7 @@
m4_define(pygtksourceview_version, pygtksourceview_major_version.pygtksourceview_minor_version.pygtksourceview_micro_version)
dnl versions of packages we require ...
-m4_define(pygobject_required_version, 2.8.0)
+m4_define(pygobject_required_version, 2.15.2)
m4_define(pygtk_required_version, 2.8.0)
m4_define(gtksourceview_required_version, 2.3.0)
Modified: trunk/test/test-widget.py
==============================================================================
--- trunk/test/test-widget.py (original)
+++ trunk/test/test-widget.py Sun Aug 10 19:27:13 2008
@@ -26,7 +26,7 @@
import sys
import gtk
import gtksourceview2 as gtksourceview
-import gnomevfs
+import gio
import pango
@@ -59,15 +59,15 @@
######################################################################
##### load file
-def load_file(buffer, uri):
+def load_file(buffer, path):
buffer.begin_not_undoable_action()
# TODO: use g_io_channel when pygtk supports it
try:
- txt = open(uri.path).read()
+ txt = open(path).read()
except:
return False
buffer.set_text(txt)
- buffer.set_data('filename', uri.path)
+ buffer.set_data('filename', path)
buffer.end_not_undoable_action()
buffer.set_modified(False)
@@ -97,9 +97,13 @@
path = filename
else:
path = os.path.abspath(filename)
- uri = gnomevfs.URI(path)
+ f = gio.File(path)
- mime_type = gnomevfs.get_mime_type(path) # needs ASCII filename, not URI
+ path = f.get_path()
+
+ info = f.query_info("*")
+
+ mime_type = info.get_content_type()
language = None
if mime_type:
@@ -112,7 +116,7 @@
buffer.set_language(language)
buffer.set_highlight_syntax(True)
remove_all_marks(buffer)
- load_file(buffer, uri) # TODO: check return
+ load_file(buffer, path) # TODO: check return
return True
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]