1616# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818#
19- # $Id: setup.py,v 1.71 2004-09-25 16:14:32 a1s Exp $
19+ # $Id: setup.py,v 1.72 2004-10-18 07:51:46 a1s Exp $
2020
2121from distutils .core import setup , Extension
2222from distutils .util import get_platform
2323from distutils .command .build_scripts import build_scripts
2424from distutils .command .build import build
25+ from distutils .command .build_py import build_py
2526
2627import sys , os , string
2728from glob import glob
@@ -223,6 +224,22 @@ def check_manifest():
223224 sys .exit (1 )
224225
225226
227+ class build_py_roundup (build_py ):
228+
229+ def find_modules (self ):
230+ # Files listed in py_modules are in the toplevel directory
231+ # of the source distribution.
232+ modules = []
233+ for module in self .py_modules :
234+ path = string .split (module , '.' )
235+ package = string .join (path [0 :- 1 ], '.' )
236+ module_base = path [- 1 ]
237+ module_file = module_base + '.py'
238+ if self .check_module (module , module_file ):
239+ modules .append ((package , module_base , module_file ))
240+ return modules
241+
242+
226243class build_roundup (build ):
227244
228245 def build_message_files (self ):
@@ -253,11 +270,12 @@ def main():
253270 'roundup.cgi.TAL' ,
254271 'roundup.cgi.ZTUtils' ,
255272 'roundup.backends' ,
256- 'roundup.scripts'
273+ 'roundup.scripts' ,
257274 ]
258275 installdatafiles = [
259276 ('share/roundup/cgi-bin' , ['cgi-bin/roundup.cgi' ]),
260277 ]
278+ py_modules = ['roundup.demo' ,]
261279
262280 # install man pages on POSIX platforms
263281 if os .name == 'posix' :
@@ -271,6 +289,8 @@ def main():
271289 # scan for data files
272290 for idir in '. detectors extensions html' .split ():
273291 idir = os .path .join (tdir , idir )
292+ if not os .path .isdir (idir ):
293+ continue
274294 tfiles = []
275295 for f in os .listdir (idir ):
276296 if f .startswith ('.' ):
@@ -324,6 +344,7 @@ def main():
324344 url = 'http://roundup.sourceforge.net/' ,
325345 download_url = 'http://sourceforge.net/project/showfiles.php?group_id=31577' ,
326346 packages = packagelist ,
347+ py_modules = py_modules ,
327348 classifiers = [
328349 'Development Status :: 4 - Beta' ,
329350 'Environment :: Console' ,
@@ -344,6 +365,7 @@ def main():
344365 # Override certain command classes with our own ones
345366 cmdclass = {
346367 'build_scripts' : build_scripts_roundup ,
368+ 'build_py' : build_py_roundup ,
347369 'build' : build_roundup ,
348370 },
349371 scripts = roundup_scripts ,
0 commit comments