Home | Trees | Indices | Help |
---|
|
1 ######################################################################## 2 # 3 # File: setup.py 4 # Author: Mark Mitchell 5 # Date: 01/02/2002 6 # 7 # Contents: 8 # QM Distutils setup script. 9 # 10 # Copyright (c) 2002 by CodeSourcery, LLC. All rights reserved. 11 # 12 ######################################################################## 13 14 ######################################################################## 15 # Imports 16 ######################################################################## 17 18 from distutils.core import setup 19 import os 20 import os.path 21 import string 22 23 ######################################################################## 24 # Functions 25 ######################################################################## 2628 """If 'dirname' is a QM package, add it to 'packages'. 29 30 'packages' -- A mutable sequence of package names. 31 32 'dirname' -- The (relative) path from the base of the QM package 33 to the directory. 34 35 'names' -- A mutable sequence of file names indicating files (and 36 directories) contained in the directory given by 'dirname'.""" 37 38 # If the directory contains a file called __init__.py, it is a 39 # package. Directories named "classes" contain extension classes. 40 if "__init__.py" in names or os.path.basename(dirname) == "classes": 41 # Replace a leading "." with "qm". 42 d = "qm" + dirname[1:] 43 # Replace path separators with periods. 44 d = string.replace(d, os.sep, ".") 45 if os.altsep: 46 d = string.replace(d, os.altsep, ".") 47 packages.append(d) 48 # Exclude directories named "build"; they are created by Distutils. 49 if "build" in names: 50 names.remove("build")51 52 ######################################################################## 53 # Main Program 54 ######################################################################## 55 56 # Find all of the packages that make up QM. 57 packages = [] 58 os.path.walk(".", find_packages_r, packages) 59 60 setup(name="qm", 61 version="1.1", 62 packages=packages, 63 package_dir={ 'qm' : '.' }) 64
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Fri Dec 23 12:30:46 2011 | http://epydoc.sourceforge.net |