From dfc2efb779561ace735ec52b0c1f31638b0f4669 Mon Sep 17 00:00:00 2001 From: David Cournapeau Date: Sun, 6 Jan 2008 10:31:05 +0000 Subject: Use a custom NumpyDistribution instead of distutils Distribution, to handle scons scripts. --- numpy/distutils/numpy_distribution.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 numpy/distutils/numpy_distribution.py (limited to 'numpy/distutils/numpy_distribution.py') diff --git a/numpy/distutils/numpy_distribution.py b/numpy/distutils/numpy_distribution.py new file mode 100644 index 000000000..681b8b316 --- /dev/null +++ b/numpy/distutils/numpy_distribution.py @@ -0,0 +1,28 @@ +# XXX: Handle setuptools ? +from distutils.core import Distribution + +# This class is used because we add new files (sconscripts, and so on) with the +# scons command +class NumpyDistribution(Distribution): + def __init__(self, attrs = None): + # A list of (sconscripts, pre_hook, post_hook, src, parent_names) + self.scons_data = [] + Distribution.__init__(self, attrs) + + def has_scons_scripts(self): + return bool(self.scons_data) + + def get_scons_scripts(self): + return [i[0] for i in self.scons_data] + + def get_scons_pre_hooks(self): + return [i[1] for i in self.scons_data] + + def get_scons_post_hooks(self): + return [i[2] for i in self.scons_data] + + def get_scons_sources(self): + return [i[3] for i in self.scons_data] + + def get_scons_parent_names(self): + return [i[4] for i in self.scons_data] -- cgit v1.2.1