[pybliographer] ui: Remove compatibility module
- From: Germán Poo-Caamaño <gpoo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pybliographer] ui: Remove compatibility module
- Date: Sun, 25 Mar 2018 22:56:18 +0000 (UTC)
commit 16a1d6226b28f5224e38377ed12c20a9b2f78be8
Author: Germán Poo-Caamaño <gpoo gnome org>
Date: Sun Mar 25 00:18:15 2018 -0300
ui: Remove compatibility module
It depended on old and deprecated modules (gnomevfs and gnome)
Pyblio/GnomeUI/Compat.py | 51 -------------------------------------------
Pyblio/GnomeUI/Makefile.am | 1 -
Pyblio/GnomeUI/ut_compat.py | 35 -----------------------------
Pyblio/Resource.py | 7 +++--
4 files changed, 4 insertions(+), 90 deletions(-)
---
diff --git a/Pyblio/GnomeUI/Makefile.am b/Pyblio/GnomeUI/Makefile.am
index 0f904f6..86f26a3 100644
--- a/Pyblio/GnomeUI/Makefile.am
+++ b/Pyblio/GnomeUI/Makefile.am
@@ -26,7 +26,6 @@ SUBDIRS = glade
EXTRA_DIST = \
Medline.py \
Common.py \
- Compat.py \
Config.py \
Format.py \
Document.py \
diff --git a/Pyblio/Resource.py b/Pyblio/Resource.py
index 88203ad..236df58 100644
--- a/Pyblio/Resource.py
+++ b/Pyblio/Resource.py
@@ -34,6 +34,7 @@ CHOOSER_ACTIONS = ('enter/edit', 'select', 'select-directory',
'download', 'move/copy' )
import os, sys, urllib, urlparse
+import gio
from Pyblio import Config, Fields, userexit
@@ -66,7 +67,7 @@ def StartViewer (entry, key, stringuri, parent=None, document=None):
if not is_interactive (): return
- from Pyblio.GnomeUI import Compat, Utils
+ from Pyblio.GnomeUI import Utils
uri = Fields.URL (stringuri)
@@ -82,7 +83,7 @@ def StartViewer (entry, key, stringuri, parent=None, document=None):
document.statusbar.set_status (_("Determining Mime Type… "))
try:
- mimetype = Compat.get_mime_type (fileuri)
+ mimetype = gio.content_type_guess(fileuri)
except RuntimeError, mesg:
Utils.error_dialog(_("Cannot determine mime type for item %s ") % entry.key.key,
_("URL in question is: %s\n"
@@ -112,7 +113,7 @@ def StartViewer (entry, key, stringuri, parent=None, document=None):
tempname = os.tmpnam ()
os.system ("gzip -d < %s >%s" %(filename, tempname))
filename = tempname
- mimetype = Compat.get_mime_type (filename)
+ mimetype = gio.content_type_guess(filename)
except RuntimeError, mesg:
Utils.error_dialog (_("IOError for item %s: cannot uncompress resource.")
% entry.key.key, _("URL: %s\nDetails: %s")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]