gedit r6356 - in trunk: . plugins/externaltools/tools
- From: jessevdk svn gnome org
- To: svn-commits-list gnome org
- Subject: gedit r6356 - in trunk: . plugins/externaltools/tools
- Date: Wed, 6 Aug 2008 20:32:28 +0000 (UTC)
Author: jessevdk
Date: Wed Aug 6 20:32:27 2008
New Revision: 6356
URL: http://svn.gnome.org/viewvc/gedit?rev=6356&view=rev
Log:
* plugins/externaltools/functions.py:
* plugins/externaltools/manager.py:
Ported to gio
Modified:
trunk/ChangeLog
trunk/plugins/externaltools/tools/functions.py
trunk/plugins/externaltools/tools/manager.py
Modified: trunk/plugins/externaltools/tools/functions.py
==============================================================================
--- trunk/plugins/externaltools/tools/functions.py (original)
+++ trunk/plugins/externaltools/tools/functions.py Wed Aug 6 20:32:27 2008
@@ -19,7 +19,7 @@
import os
import gtk
from gtk import gdk
-import gnomevfs
+import gio
import gedit
#import gtksourceview
from outputpanel import OutputPanel
@@ -55,13 +55,14 @@
document = view.get_buffer()
uri = document.get_uri()
if uri is not None:
- scheme = gnomevfs.get_uri_scheme(uri)
+ gfile = gio.File(uri)
+ scheme = gfile.get_uri_scheme()
name = os.path.basename(uri)
capture.set_env(GEDIT_CURRENT_DOCUMENT_URI = uri,
GEDIT_CURRENT_DOCUMENT_NAME = name,
GEDIT_CURRENT_DOCUMENT_SCHEME = scheme)
- if scheme == 'file':
- path = gnomevfs.get_local_path_from_uri(uri)
+ if gedit.utils.uri_has_file_scheme(uri):
+ path = gfile.get_path()
cwd = os.path.dirname(path)
capture.set_cwd(cwd)
capture.set_env(GEDIT_CURRENT_DOCUMENT_PATH = path,
@@ -70,9 +71,9 @@
documents_uri = [doc.get_uri()
for doc in window.get_documents()
if doc.get_uri() is not None]
- documents_path = [gnomevfs.get_local_path_from_uri(uri)
+ documents_path = [gio.File(uri).get_path()
for uri in documents_uri
- if gnomevfs.get_uri_scheme(uri) == 'file']
+ if gedit.utils.uri_has_file_scheme(uri)]
capture.set_env(GEDIT_DOCUMENTS_URI = ' '.join(documents_uri),
GEDIT_DOCUMENTS_PATH = ' '.join(documents_path))
@@ -175,7 +176,7 @@
end = start.copy()
end.forward_chars(300)
- mtype = gnomevfs.get_mime_type_for_data(doc.get_text(start, end))
+ mtype = gio.content_type_guess(data=doc.get_text(start, end))
lmanager = gedit.get_language_manager()
language = gedit.language_manager_get_language_from_mime_type(lmanager, mtype)
if language is not None:
Modified: trunk/plugins/externaltools/tools/manager.py
==============================================================================
--- trunk/plugins/externaltools/tools/manager.py (original)
+++ trunk/plugins/externaltools/tools/manager.py Wed Aug 6 20:32:27 2008
@@ -208,7 +208,7 @@
script = default(''.join(node.get_script()), '')
buf.set_text(script)
self.script_hash = self.compute_hash(script)
- mimetype = gnomevfs.get_mime_type_for_data(script)
+ mimetype = gio.content_type_guess(data=script)
lmanager = gedit.get_language_manager()
language = gedit.language_manager_get_language_from_mime_type(lmanager, mimetype)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]