[pygobject] Remove 'ltihooks.py' as using deprecated Python module.
- From: Paul Pogonyshev <paulp src gnome org>
- To: svn-commits-list gnome org
- Subject: [pygobject] Remove 'ltihooks.py' as using deprecated Python module.
- Date: Sat, 18 Apr 2009 16:47:54 -0400 (EDT)
commit d6a62d095cfa42c5ab4ac67017d995ce45ee158c
Author: Paul Pogonyshev <pogonyshev gmx net>
Date: Sat Apr 18 23:42:08 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.
---
Makefile.am | 1 -
gio/Makefile.am | 9 +++++++
gio/__init__.py | 8 ------
glib/Makefile.am | 7 ++++++
glib/__init__.py | 8 ------
gobject/Makefile.am | 7 ++++++
gobject/__init__.py | 7 ------
ltihooks.py | 60 ---------------------------------------------------
tests/Makefile.am | 7 ++++++
tests/common.py | 5 ----
10 files changed, 30 insertions(+), 89 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index fccc321..5ed6fa7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -33,7 +33,6 @@ pkgpyexec_LTLIBRARIES =
# python
pyexec_PYTHON = pygtk.py
pyexec_LTLIBRARIES =
-noinst_PYTHON = ltihooks.py
# linker flags
common_ldflags = -module -avoid-version
diff --git a/gio/Makefile.am b/gio/Makefile.am
index d47dda9..a0f356d 100644
--- a/gio/Makefile.am
+++ b/gio/Makefile.am
@@ -93,3 +93,12 @@ endif
--prefix py$(*F) $*.defs) > $(*D)/gen-$(*F).c \
&& cp $(*D)/gen-$(*F).c $(*D)/$(*F).c \
&& rm -f $(*D)/gen-$(*F).c
+
+
+if BUILD_GIO
+all: $(pkgpyexec_LTLIBRARIES:.la=.so)
+clean-local:
+ rm -f $(pkgpyexec_LTLIBRARIES:.la=.so)
+.la.so:
+ $(LN_S) .libs/$@ $@
+endif
diff --git a/gio/__init__.py b/gio/__init__.py
index 9f9fe2c..c4b02bb 100644
--- a/gio/__init__.py
+++ b/gio/__init__.py
@@ -19,14 +19,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
# USA
-# this can go when things are a little further along
-try:
- import ltihooks
- ltihooks # pyflakes
- del ltihooks
-except ImportError:
- pass
-
from gobject import GObjectMeta
from _gio import *
from _gio import \
diff --git a/glib/Makefile.am b/glib/Makefile.am
index 2877b5f..8b178a4 100644
--- a/glib/Makefile.am
+++ b/glib/Makefile.am
@@ -50,3 +50,10 @@ _glib_la_SOURCES = \
if PLATFORM_WIN32
_glib_la_CFLAGS += -DPLATFORM_WIN32
endif
+
+
+all: $(pyglib_LTLIBRARIES:.la=.so)
+clean-local:
+ rm -f $(pyglib_LTLIBRARIES:.la=.so)
+.la.so:
+ $(LN_S) .libs/$@ $@
diff --git a/glib/__init__.py b/glib/__init__.py
index 446cc30..b114cb9 100644
--- a/glib/__init__.py
+++ b/glib/__init__.py
@@ -19,14 +19,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
# USA
-# this can go when things are a little further along
-try:
- import ltihooks
- ltihooks # pyflakes
- del ltihooks
-except ImportError:
- pass
-
from glib._glib import *
_PyGLib_API = _glib._PyGLib_API
diff --git a/gobject/Makefile.am b/gobject/Makefile.am
index a8f0f6f..9d0c824 100644
--- a/gobject/Makefile.am
+++ b/gobject/Makefile.am
@@ -71,3 +71,10 @@ endif
if PLATFORM_WIN32
_gobject_la_CFLAGS += -DPLATFORM_WIN32
endif
+
+
+all: $(pygobject_LTLIBRARIES:.la=.so)
+clean-local:
+ rm -f $(pygobject_LTLIBRARIES:.la=.so)
+.la.so:
+ $(LN_S) .libs/$@ $@
diff --git a/gobject/__init__.py b/gobject/__init__.py
index 41eaaf8..d5aec45 100644
--- a/gobject/__init__.py
+++ b/gobject/__init__.py
@@ -21,13 +21,6 @@
# this can go when things are a little further along
-try:
- import ltihooks
- ltihooks # pyflakes
- del ltihooks
-except ImportError:
- pass
-
import sys
from glib import spawn_async, idle_add, timeout_add, timeout_add_seconds, \
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/Makefile.am b/tests/Makefile.am
index f9e9fed..493fe9f 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -56,3 +56,10 @@ check-local: $(top_srcdir)/glib/__init__.py $(top_srcdir)/gobject/__init__.py $(
@rm -fr $(top_builddir)/glib/*.pyc
@rm -fr $(top_builddir)/gobject/*.pyc
@rm -fr $(top_builddir)/gio/*.pyc
+
+
+all: $(LTLIBRARIES:.la=.so)
+clean-local:
+ rm -f $(LTLIBRARIES:.la=.so)
+.la.so:
+ $(LN_S) .libs/$@ $@
diff --git a/tests/common.py b/tests/common.py
index d41b9f2..a6fa73d 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -5,13 +5,11 @@ 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)
sys.path.insert(0, buildDir)
sys.path.insert(0, os.path.join(buildDir, 'glib'))
sys.path.insert(0, os.path.join(buildDir, 'gobject'))
sys.path.insert(0, os.path.join(buildDir, 'gio'))
- import ltihooks
# testhelper
sys.path.insert(0, os.path.join(buildDir, 'tests'))
@@ -22,9 +20,6 @@ def importModules(buildDir, srcDir):
gobject = importModule('gobject', buildDir, 'gobject')
gio = importModule('gio', buildDir, 'gio')
- 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]