[pybliographer] ui: Drop dependency on libglade2
- From: Germán Poo-Caamaño <gpoo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pybliographer] ui: Drop dependency on libglade2
- Date: Wed, 28 Mar 2018 02:57:28 +0000 (UTC)
commit 1c3041f8bc4960adb81600a527bc8279578b0789
Author: Germán Poo-Caamaño <gpoo gnome org>
Date: Tue Mar 27 23:53:49 2018 -0300
ui: Drop dependency on libglade2
Pyblio/GnomeUI/Utils.py | 74 ++---------------------------------
Pyblio/GnomeUI/glade/config1.gladep | 7 ---
Pyblio/GnomeUI/glade/fields1.gladep | 7 ---
Pyblio/GnomeUI/glade/format.gladep | 12 ------
Pyblio/GnomeUI/glade/medline.gladep | 12 ------
Pyblio/GnomeUI/glade/openurl.gladep | 7 ---
Pyblio/GnomeUI/glade/pyblio.gladep | 12 ------
Pyblio/GnomeUI/glade/search.gladep | 7 ---
Pyblio/GnomeUI/glade/sort.gladep | 12 ------
pybliographer.spec | 2 -
setup-check.py | 1 -
11 files changed, 4 insertions(+), 149 deletions(-)
---
diff --git a/Pyblio/GnomeUI/Utils.py b/Pyblio/GnomeUI/Utils.py
index cdeef7b..32163fa 100644
--- a/Pyblio/GnomeUI/Utils.py
+++ b/Pyblio/GnomeUI/Utils.py
@@ -1,7 +1,8 @@
+# -*- coding: utf-8 -*-
# This file is part of pybliographer
#
-# Copyright (C) 1998-2004 Frederic GOBRY
-# Email : gobry pybliographer org
+# Copyright (C) 2018 Germán Poo-Caamaño <gpoo gnome org>
+# Copyright (C) 1998-2004 Frederic GOBRY <gobry pybliographer org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -22,13 +23,11 @@
''' Utility functions for Gnome Interface management. '''
import os
-
import gtk, pango
-import gtk.glade
+import gconf
from Pyblio import Config, version
-import gconf
class Callback:
@@ -63,71 +62,6 @@ class Callback:
glade_root = os.path.join(os.path.dirname(__file__), 'glade')
-class GladeWindow:
-
- ''' A Helper class that builds a graphical interface provided by a
- Glade XML file. This class binds the methods with
- signal_autoconnect, and imports widgets whose name starts with _w_
- as instance attributes. Therefore, after init, the instance can refer to:
-
- self._w_main
-
- if the glade file defined a _w_main widget.
-
- This class must be derived and the following class variables must
- be given some sensible value:
-
- glade_file : name of the glade file (with no directory info)
- root_widget : name of the root widget
-
- '''
-
-
- # This is a class variable that contains the file name to load for
- # each instance of a subclass.
-
- gladeinfo = { 'file': None,
- 'root': None,
- 'name': None
- }
-
- def __init__ (self, parent = None, window = None):
-
- gp = os.path.join(glade_root, self.gladeinfo ['file'])
- self.xml = gtk.glade.XML (gp, window, domain = "pybliographer")
- self.xml.signal_autoconnect (self)
-
- for w in self.xml.get_widget_prefix ('_w_'):
- setattr (self, w.name, w)
-
- # Set the parent window. The root widget is not necessarily
- # exported as an instance attribute.
- root = self.xml.get_widget (self.gladeinfo ['root'])
- cfg = '/apps/pybliographic/%s/' % self.gladeinfo ['name']
-
- w = config.get_int (cfg + 'width') or -1
- h = config.get_int (cfg + 'height') or -1
-
- if w != -1 and h != -1:
- root.set_default_size (w, h)
- root.resize (w, h)
-
- if parent:
- root.set_transient_for (parent)
-
- return
-
- def size_save (self):
- root = self.xml.get_widget (self.gladeinfo ['root'])
- cfg = '/apps/pybliographic/%s/' % self.gladeinfo ['name']
-
- w, h = root.get_size ()
-
- config.set_int (cfg + 'width', w)
- config.set_int (cfg + 'height', h)
-
- return
-
class Builder:
''' A Helper class that builds a graphical interface provided by a
diff --git a/pybliographer.spec b/pybliographer.spec
index 42b121f..e8e912b 100644
--- a/pybliographer.spec
+++ b/pybliographer.spec
@@ -11,7 +11,6 @@ BuildArch: noarch
BuildRequires: python >= 2.2
BuildRequires: pygtk2 >= 2.24.0
-BuildRequires: pygtk2-libglade >= 2.4.0
BuildRequires: gnome-python2-gconf >= 2.0.3
BuildRequires: python-bibtex >= 1.2.2
BuildRequires: gettext
@@ -19,7 +18,6 @@ BuildRequires: scrollkeeper
Requires: python >= 2.2
Requires: pygtk2 >= 2.24.0
-Requires: pygtk2-libglade >= 2.4.0
Requires: gnome-python2-gconf >= 2.0.3
Requires: python-bibtex >= 1.2.2
Requires: recode >= 3.6-11
diff --git a/setup-check.py b/setup-check.py
index 07d109d..a9683f0 100644
--- a/setup-check.py
+++ b/setup-check.py
@@ -50,7 +50,6 @@ try:
pygtk.require ('2.0')
import gtk
- import gtk.glade
import gconf
v = string.join (map (str, gtk.pygtk_version), '.')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]