[pybliographer/wip/gtk3] Pyblio: Fix old pygtk calls



commit 271a7d9b3bbb9e2815e9b0ecabf758bee10ff71e
Author: Germán Poo-Caamaño <gpoo gnome org>
Date:   Sat Oct 7 00:11:03 2017 -0300

    Pyblio: Fix old pygtk calls

 Pyblio/GnomeUI/Utils.py |    6 +++---
 Pyblio/Resource.py      |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/Pyblio/GnomeUI/Utils.py b/Pyblio/GnomeUI/Utils.py
index 7b22ea6..10662db 100644
--- a/Pyblio/GnomeUI/Utils.py
+++ b/Pyblio/GnomeUI/Utils.py
@@ -47,15 +47,15 @@ class Callback:
                                        Gtk.ButtonsType.YES_NO,
                                        question)
         if cancel_add:
-            self.dialog.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL)
+            self.dialog.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)
 
         return
 
     def answer (self):
         res = self.dialog.run ()
-        if res == Gtk.RESPONSE_YES:
+        if res == Gtk.ResponseType.YES:
             res = True
-        elif res == Gtk.RESPONSE_NO:
+        elif res == Gtk.ResponseType.NO:
             res = False
         else:
             res = 2
diff --git a/Pyblio/Resource.py b/Pyblio/Resource.py
index 918307b..f328875 100644
--- a/Pyblio/Resource.py
+++ b/Pyblio/Resource.py
@@ -37,7 +37,7 @@ import os, sys, urllib, urlparse
 from Pyblio import Config, Fields, userexit
 
 def is_interactive ():
-    return sys.modules.has_key ('gtk')
+    return sys.modules.has_key ('gi.repository.Gtk')
 
 
 class ResourceDirector (object):


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