[pybliographer/wip/gtk3] Remove Pyblio/GnomeUI/Compat module



commit d8a43f698154a506f6059f5230716d518a4df569
Author: Germán Poo-Caamaño <gpoo gnome org>
Date:   Tue Oct 10 10:47:42 2017 -0300

    Remove Pyblio/GnomeUI/Compat module
    
    Use directly Gio.get_mime_type instead.

 Pyblio/GnomeUI/Compat.py    |   39 ---------------------------------------
 Pyblio/GnomeUI/Makefile.am  |    1 -
 Pyblio/GnomeUI/ut_compat.py |   35 -----------------------------------
 Pyblio/Resource.py          |    7 ++++---
 po/POTFILES.in              |    1 -
 5 files changed, 4 insertions(+), 79 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 f328875..ea38344 100644
--- a/Pyblio/Resource.py
+++ b/Pyblio/Resource.py
@@ -33,6 +33,7 @@ CHOOSER_ACTIONS = ('enter/edit', 'select', 'select-directory',
                'download', 'move/copy' )
 
 import os, sys, urllib, urlparse
+from gi.repository import Gio
 
 from Pyblio import Config, Fields, userexit
 
@@ -65,7 +66,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)
@@ -81,7 +82,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_get_mime_type(fileuri)
     except RuntimeError, mesg:
        Utils.error_dialog(_("Cannot determine mime type for item %s ") % entry.key.key, 
                           _("URL in question is: %s\n"
@@ -111,7 +112,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_get_mime_type(filename)
        except RuntimeError, mesg:
            Utils.error_dialog (_("IOError for item %s: cannot uncompress resource.")
                                % entry.key.key, _("URL: %s\nDetails: %s")
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 1bb3e08..c434cc7 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -23,7 +23,6 @@ Pyblio/Format/Refer.py
 Pyblio/Format/__init__.py
 Pyblio/Format/isifile.py
 Pyblio/Formatter.py
-Pyblio/GnomeUI/Compat.py
 Pyblio/GnomeUI/Config.py
 Pyblio/GnomeUI/Document.py
 Pyblio/GnomeUI/Editor.py


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]