[pygtk] Remove 'ltihooks.py' as using deprecated Python module.
- From: Paul Pogonyshev <paulp src gnome org>
- To: svn-commits-list gnome org
- Subject: [pygtk] Remove 'ltihooks.py' as using deprecated Python module.
- Date: Sat, 2 May 2009 09:16:51 -0400 (EDT)
commit dd2009d4e0e9fa9cd4ee8d76ec0e498e62a568b7
Author: Paul Pogonyshev <pogonyshev gmx net>
Date: Sat May 2 16:11:06 2009 +0300
Remove 'ltihooks.py' as using deprecated Python module.
Remove the script and all related imports. All relevant Makefile's
now create symbolic links for '.so' files from '.libs' to the level
up, so that C helper modules are still importable in built, but not
installed source tree. Same as in PyGObject. (Bug #565593.)
---
.gitignore | 1 +
Makefile.am | 11 ++++++---
gtk/Makefile.am | 8 ++++++-
gtk/__init__.py | 15 -------------
ltihooks.py | 60 -------------------------------------------------------
tests/common.py | 10 ---------
6 files changed, 15 insertions(+), 90 deletions(-)
diff --git a/.gitignore b/.gitignore
index a2ac9c6..426ab64 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,6 +33,7 @@ stamp-h1
*.o
*.pc
*.pyc
+*.so
.deps
.libs
diff --git a/Makefile.am b/Makefile.am
index 1ed5196..2472727 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -44,10 +44,6 @@ pkgconfig_DATA += pygtk-$(PLATFORM_VERSION).pc
defsdir = $(pkgdatadir)/$(PLATFORM_VERSION)/defs
defs_DATA =
-# python
-pyexec_LTLIBRARIES =
-noinst_PYTHON = ltihooks.py
-
# pygtk scripts
pkgpythondir = $(pyexecdir)/gtk-2.0
@@ -141,3 +137,10 @@ doc-dist:
cp -r docs/cursors/* pygtk/cursors
tar cfz $(PACKAGE)-docs.tar.gz pygtk
rm -fr pygtk
+
+
+all: $(pkgpyexec_LTLIBRARIES:.la=.so)
+clean-local:
+ rm -f $(pkgpyexec_LTLIBRARIES:.la=.so)
+.la.so:
+ $(LN_S) .libs/$@ $@ || true
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 2021220..b9ec8f3 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -195,7 +195,7 @@ CLEANFILES += \
gtkunixprint.c \
gtkunixprint.defs \
gtkunixprint-types.defs
-
+
EXTRA_DIST += \
$(GTKUNIXPRINT_DEFS) \
@@ -248,3 +248,9 @@ endif
gtk-types.c:
@:
+
+all: $(pygtkexec_LTLIBRARIES:.la=.so) $(pkgpyexec_LTLIBRARIES:.la=.so)
+clean-local:
+ rm -f $(pygtkexec_LTLIBRARIES:.la=.so) $(pkgpyexec_LTLIBRARIES:.la=.so)
+.la.so:
+ $(LN_S) .libs/$@ $@ || true
diff --git a/gtk/__init__.py b/gtk/__init__.py
index e2733dc..92af869 100644
--- a/gtk/__init__.py
+++ b/gtk/__init__.py
@@ -22,14 +22,6 @@
import sys
-# this can go when things are a little further along
-try:
- import ltihooks
- # pyflakes
- ltihooks
-except ImportError:
- ltihooks = None
-
# For broken embedded programs which forgot to call Sys_SetArgv
if not hasattr(sys, 'argv'):
sys.argv = []
@@ -49,13 +41,6 @@ else:
import gdk
-if ltihooks:
- try:
- ltihooks.uninstall()
- del ltihooks
- except:
- pass
-
from gtk._lazyutils import LazyNamespace, LazyModule
from gtk.deprecation import _Deprecated, _DeprecatedConstant
diff --git a/ltihooks.py b/ltihooks.py
deleted file mode 100644
index bbc25df..0000000
--- a/ltihooks.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# -*- Mode: Python; py-indent-offset: 4 -*-
-# ltihooks.py: python import hooks that understand libtool libraries.
-# Copyright (C) 2000 James Henstridge.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-import os, ihooks
-
-class LibtoolHooks(ihooks.Hooks):
- def get_suffixes(self):
- """Like normal get_suffixes, but adds .la suffixes to list"""
- ret = ihooks.Hooks.get_suffixes(self)
- ret.insert(0, ('module.la', 'rb', 3))
- ret.insert(0, ('.la', 'rb', 3))
- return ret
-
- def load_dynamic(self, name, filename, file=None):
- """Like normal load_dynamic, but treat .la files specially"""
- if len(filename) > 3 and filename[-3:] == '.la':
- fp = open(filename, 'r')
- dlname = ''
- installed = 1
- line = fp.readline()
- while line:
- if len(line) > 7 and line[:7] == 'dlname=':
- dlname = line[8:-2]
- elif len(line) > 10 and line[:10] == 'installed=':
- installed = line[10:-1] == 'yes'
- line = fp.readline()
- fp.close()
- if dlname:
- if installed:
- filename = os.path.join(os.path.dirname(filename),
- dlname)
- else:
- filename = os.path.join(os.path.dirname(filename),
- '.libs', dlname)
- return ihooks.Hooks.load_dynamic(self, name, filename, file)
-
-importer = ihooks.ModuleImporter()
-importer.set_hooks(LibtoolHooks())
-
-def install():
- importer.install()
-def uninstall():
- importer.uninstall()
-
-install()
diff --git a/tests/common.py b/tests/common.py
index dfc3401..33216e1 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -7,29 +7,19 @@ def importModules(buildDir, srcDir):
# Be very careful when you change this code, it's
# fragile and the order is really significant
- # ltihooks
- sys.path.insert(0, srcDir)
# atk, pango
sys.path.insert(0, buildDir)
# _gtk, keysyms, glade
sys.path.insert(0, os.path.join(buildDir, 'gtk'))
sys.argv.append('--g-fatal-warnings')
- import ltihooks
atk = importModule('atk', buildDir)
pango = importModule('pango', buildDir)
gtk = importModule('gtk', buildDir, 'gtk')
gdk = importModule('gtk.gdk', buildDir, '_gdk.la')
- # gtk/__init__.py removes the ltihooks, readd them
- import gtk
-
- ltihooks.install()
glade = importModule('gtk.glade', buildDir)
- ltihooks.uninstall()
- del ltihooks
-
globals().update(locals())
os.environ['PYGTK_USE_GIL_STATE_API'] = ''
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]