Author: johannes
Date: 2007-12-07 08:46:25 -0600 (Fri, 07 Dec 2007)
New Revision: 9842
Removed:
trunk/gnue-common/setupext/
Modified:
trunk/gnue-common/setup.py
Log:
Removed setupext since we do not have any recursive directories anymore
Modified: trunk/gnue-common/setup.py
===================================================================
--- trunk/gnue-common/setup.py 2007-12-07 13:13:32 UTC (rev 9841)
+++ trunk/gnue-common/setup.py 2007-12-07 14:46:25 UTC (rev 9842)
@@ -35,6 +35,32 @@
# Please keep these routines up to date
# =============================================================================
+def allfiles(directory, ext=None):
+ """
+ Get a list of files in a given directory, excluding some specials like
+ Makefile, .svn, CSV and so on
+ """
+
+ directory = os.path.normpath(directory)
+ exclude = [".svn", "CVS", "README.cvs", ".cvsignore", "Makefile"]
+
+ result = []
+
+ for fname in os.listdir(directory):
+ item = directory + "/" + fname
+ full = os.path.join(directory, fname)
+
+ if (fname in exclude) or os.path.isdir(full):
+ continue
+
+ if ext is not None and not item.endswith(ext):
+ continue
+
+ result.append(item)
+
+ return result
+
+
# -----------------------------------------------------------------------------
# Definition of basic parameters for distribution and installation.
# Please add new files/directories that should be installed here.
@@ -60,31 +86,13 @@
"gnue.common": "src"}
params["scripts"] = ["scripts/gnue-schema"]
- # The Data
- # TODO: get rid of setupext!
- params["data_files"] = \
- [Data_Files(base_dir = 'install_data',
- copy_to = 'share/gnue',
- template = ['recursive-include images *.png',
- 'recursive-include images *.bmp'],
- preserve_path = 1),
- Data_Files(base_dir = 'install_config',
- copy_to = '',
- template = ['recursive-include etc *',
- 'prune etc/.svn'],
- preserve_path = 0),
- Data_Files(base_dir = 'install_data',
- copy_to = 'share/man/man1',
- template = ['recursive-include doc/man *.1'],
- preserve_path = 0),
- Data_Files(base_dir = 'install_data',
- copy_to = 'share/doc/gnue-common',
- template = ['recursive-include doc *',
- 'prune doc/.svn',
- 'prune doc/man',
- 'prune doc/technotes'],
- strip_dirs = 1, # This is a number, not true/false
- preserve_path = 1)]
+ params["data_files"] = [ \
+ ("etc", allfiles('etc')),
+ ("share/gnue/images", allfiles('images', '.png')),
+ ("share/gnue/images", allfiles('images', '.bmp')),
+ ("share/man/man1", allfiles('doc/man', '.1')),
+ ("share/doc/gnue-common", allfiles('doc'))
+ ]
# -----------------------------------------------------------------------------
@@ -117,17 +125,19 @@
# No changes should be required below this line
# =============================================================================
+import time
+
+import distutils.command.sdist
+import distutils.command.build
+import distutils.command.install
+
from distutils import log
from distutils.core import setup
from distutils.filelist import FileList
from distutils.util import change_root
from distutils.sysconfig import get_python_lib
-import distutils.command.sdist
-import distutils.command.build
-import distutils.command.install
-import time
-from setupext import Data_Files, install_Data_Files
+
# -----------------------------------------------------------------------------
# Check Python version
# -----------------------------------------------------------------------------
@@ -486,7 +496,7 @@
cmdclass = {"sdist": sdist,
"build": build,
"install": install,
- "install_data": install_Data_Files})
+ })
# -----------------------------------------------------------------------------
# Clean up
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.