~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Alexander Belchenko
  • Date: 2007-08-14 06:27:51 UTC
  • mto: (2733.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 2734.
  • Revision ID: bialix@ukr.net-20070814062751-tyyn1s5jraunqni9
teach windows python installer to find docs in all subdirectories

Show diffs side-by-side

added added

removed removed

Lines of Context:
207
207
 
208
208
 
209
209
if 'bdist_wininst' in sys.argv:
210
 
    import glob
211
 
    # doc files
212
 
    docs = glob.glob('doc/*.html') + ['doc/default.css']
213
 
    dev_docs = glob.glob('doc/developers/*.html')
 
210
    def find_docs():
 
211
        import fnmatch
 
212
        docs = []
 
213
        for root, dirs, files in os.walk('doc'):
 
214
            r = []
 
215
            for f in files:
 
216
                if (fnmatch.fnmatch(f, '*.html') or
 
217
                    fnmatch.fnmatch(f, '*.css')):
 
218
                    r.append(os.path.join(root, f))
 
219
            if r:
 
220
                relative = root[4:]
 
221
                if relative:
 
222
                    target = os.path.join('Doc\\Bazaar', relative)
 
223
                else:
 
224
                    target = 'Doc\\Bazaar'
 
225
                docs.append((target, r))
 
226
        return docs
 
227
 
214
228
    # python's distutils-based win32 installer
215
229
    ARGS = {'scripts': ['bzr', 'tools/win32/bzr-win32-bdist-postinstall.py'],
216
230
            'ext_modules': ext_modules,
217
231
            # help pages
218
 
            'data_files': [('Doc/Bazaar', docs),
219
 
                           ('Doc/Bazaar/developers', dev_docs),
220
 
                          ],
 
232
            'data_files': find_docs(),
221
233
            # for building pyrex extensions
222
234
            'cmdclass': {'build_ext': build_ext},
223
235
           }