ยปCore Development>Code coverage>Lib/plat-mac/bgenlocations.py

Python code coverage for Lib/plat-mac/bgenlocations.py

#countcontent
1n/a#
2n/a# Local customizations for generating the Carbon interface modules.
3n/a# Edit this file to reflect where things should be on your system.
4n/a# Note that pathnames are unix-style for OSX MachoPython/unix-Python,
5n/a# but mac-style for MacPython, whether running on OS9 or OSX.
6n/a#
7n/a
8n/aimport os
9n/a
10n/afrom warnings import warnpy3k
11n/awarnpy3k("In 3.x, the bgenlocations module is removed.", stacklevel=2)
12n/a
13n/aError = "bgenlocations.Error"
14n/a#
15n/a# Where bgen is. For unix-Python bgen isn't installed, so you have to refer to
16n/a# the source tree here.
17n/aBGENDIR="/Users/jack/src/python/Tools/bgen/bgen"
18n/a
19n/a#
20n/a# Where to find the Universal Header include files. If you have CodeWarrior
21n/a# installed you can use the Universal Headers from there, otherwise you can
22n/a# download them from the Apple website. Bgen can handle both unix- and mac-style
23n/a# end of lines, so don't worry about that.
24n/a#
25n/aINCLUDEDIR="/Users/jack/src/Universal/Interfaces/CIncludes"
26n/a
27n/a#
28n/a# Where to put the python definitions files. Note that, on unix-Python,
29n/a# if you want to commit your changes to the CVS repository this should refer to
30n/a# your source directory, not your installed directory.
31n/a#
32n/aTOOLBOXDIR="/Users/jack/src/python/Lib/plat-mac/Carbon"
33n/a
34n/a# Creator for C files:
35n/aCREATOR="CWIE"
36n/a
37n/a# The previous definitions can be overriden by creating a module
38n/a# bgenlocationscustomize.py and putting it in site-packages (or anywere else
39n/a# on sys.path, actually)
40n/atry:
41n/a from bgenlocationscustomize import *
42n/aexcept ImportError:
43n/a pass
44n/a
45n/aif not os.path.exists(BGENDIR):
46n/a raise Error, "Please fix bgenlocations.py, BGENDIR does not exist: %s" % BGENDIR
47n/aif not os.path.exists(INCLUDEDIR):
48n/a raise Error, "Please fix bgenlocations.py, INCLUDEDIR does not exist: %s" % INCLUDEDIR
49n/aif not os.path.exists(TOOLBOXDIR):
50n/a raise Error, "Please fix bgenlocations.py, TOOLBOXDIR does not exist: %s" % TOOLBOXDIR
51n/a
52n/a# Sigh, due to the way these are used make sure they end with : or /.
53n/aif BGENDIR[-1] != os.sep:
54n/a BGENDIR = BGENDIR + os.sep
55n/aif INCLUDEDIR[-1] != os.sep:
56n/a INCLUDEDIR = INCLUDEDIR + os.sep
57n/aif TOOLBOXDIR[-1] != os.sep:
58n/a TOOLBOXDIR = TOOLBOXDIR + os.sep