Install all files/subdirectories below templates.
authorThomas Arendsen Hein <thomas@intevation.de>
Tue, 03 Oct 2006 11:53:35 +0200
changeset 3239 7a3edd3f7c3e
parent 3238 3dba9ec89164
child 3240 e0069e7fe419
Install all files/subdirectories below templates. This is needed because styles are now in their own subdirectory.
MANIFEST.in
setup.py
--- a/MANIFEST.in	Tue Oct 03 11:30:59 2006 +0200
+++ b/MANIFEST.in	Tue Oct 03 11:53:35 2006 +0200
@@ -5,10 +5,8 @@
 include tests/README tests/*.py tests/test-*[a-z0-9] tests/*.out
 prune tests/*.err
 include *.txt
-include templates/map templates/map-*[a-z0-9]
-include templates/*.tmpl
-include templates/static/*
 include doc/README doc/Makefile doc/gendoc.py doc/*.txt doc/*.html doc/*.[0-9]
+recursive-include templates *
 recursive-include contrib *
 recursive-include hgext *
 include README
--- a/setup.py	Tue Oct 03 11:30:59 2006 +0200
+++ b/setup.py	Tue Oct 03 11:53:35 2006 +0200
@@ -9,7 +9,7 @@
 if not hasattr(sys, 'version_info') or sys.version_info < (2, 3):
     raise SystemExit, "Mercurial requires python 2.3 or later."
 
-import glob
+import os
 from distutils.core import setup, Extension
 from distutils.command.install_data import install_data
 
@@ -90,13 +90,9 @@
       packages=['mercurial', 'mercurial.hgweb', 'hgext'],
       ext_modules=[Extension('mercurial.mpatch', ['mercurial/mpatch.c']),
                    Extension('mercurial.bdiff', ['mercurial/bdiff.c'])],
-      data_files=[
-          ('mercurial/templates',
-           ['templates/map'] +
-           glob.glob('templates/map-*') +
-           glob.glob('templates/*.tmpl')),
-          ('mercurial/templates/static', glob.glob('templates/static/*')),
-      ],
+      data_files=[(os.path.join('mercurial', root),
+                   [os.path.join(root, file_) for file_ in files])
+                  for root, dirs, files in os.walk('templates')],
       cmdclass=cmdclass,
       scripts=['hg', 'hgmerge'],
       options=dict(bdist_mpkg=dict(zipdist=True,