[pybliographer/wip/gtk3: 23/42] compat: Port get_mime_type to Gio



commit 37b66e6694f3675913653b9f590c27966140afb3
Author: Germán Poo-Caamaño <gpoo gnome org>
Date:   Fri Jul 26 16:44:48 2013 -0700

    compat: Port get_mime_type to Gio
    
    Remove unused comments.  The compat layer should be moved
    to Utils/

 Pyblio/GnomeUI/Compat.py |   26 ++++++--------------------
 1 files changed, 6 insertions(+), 20 deletions(-)
---
diff --git a/Pyblio/GnomeUI/Compat.py b/Pyblio/GnomeUI/Compat.py
index 5a113a4..7838255 100644
--- a/Pyblio/GnomeUI/Compat.py
+++ b/Pyblio/GnomeUI/Compat.py
@@ -1,7 +1,8 @@
+# -*- coding: utf-8 -*-
 # This file is part of pybliographer
 # 
-# Copyright (C) 2005 Peter Schulte-Stracke
-# Email : mail schulte-stracke de
+# Copyright (C) 2005 Peter Schulte-Stracke <mail schulte-stracke de>
+# Copyright (C) 2013 Germán Poo-Caamaño <gpoo gnome org>
 #         
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -26,16 +27,8 @@ Compatability module
 
 """
 from gettext import gettext as _
-from gi.repository import Gtk
+from gi.repository import Gtk, Gio
 
-# gnome-python (2.x)
-#try:
-#    from gnome.ui import gnome_error_dialog_parented
-#except ImportError:
-#    from gnome.ui import error_dialog_parented as gnome_error_dialog_parented
-#
-#error_dialog_parented = gnome_error_dialog_parented
-# error_dialog_parented = str
 
 class error_dialog_parented(Gtk.Dialog):
     def __init__(self, message, parent):
@@ -47,17 +40,10 @@ class error_dialog_parented(Gtk.Dialog):
         self.show_all()
 
 
-# gnome-python (2.x)
-#try:
-#    import gnomevfs
-#except ImportError:
-#    import gnome.vfs as gnomevfs
-
-#get_mime_type = gnomevfs.get_mime_type
-get_mime_type = str
+get_mime_type = Gio.content_type_get_mime_type
 
 
 # Local Variables:
-# coding: "latin-1"
+# coding: "utf-8"
 # py-master-file: "ut_compat.py"
 # End:


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