diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2001-12-14 14:31:15 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2001-12-14 14:31:15 (GMT) |
commit | 81feb6c201f0be1d08a40e5638d4dd215e0bbe6b (patch) | |
tree | 35ec6f1f8edc8da4aaf3eb51d0ecb555eb09d3f6 | |
parent | e54616cb6fdd9f9fb0d86ddd2cd5c4ffb51771b8 (diff) | |
download | cpython-81feb6c201f0be1d08a40e5638d4dd215e0bbe6b.zip cpython-81feb6c201f0be1d08a40e5638d4dd215e0bbe6b.tar.gz cpython-81feb6c201f0be1d08a40e5638d4dd215e0bbe6b.tar.bz2 |
Add default values for options in the class init routine, not in the convenience wrapper function: distutils uses the class directly. Fixes bug #492665.
-rw-r--r-- | Mac/Lib/mkcwproject/__init__.py | 16 | ||||
-rw-r--r-- | Mac/Lib/mkcwproject/cwxmlgen.py | 15 |
2 files changed, 17 insertions, 14 deletions
diff --git a/Mac/Lib/mkcwproject/__init__.py b/Mac/Lib/mkcwproject/__init__.py index 9c5e21c..69a1f32 100644 --- a/Mac/Lib/mkcwproject/__init__.py +++ b/Mac/Lib/mkcwproject/__init__.py @@ -12,27 +12,15 @@ def mkproject(outputfile, modulename, settings, force=0, templatename=None): for k, v in settings.items(): dictcopy[k] = v # - # Fill in mac-specific values + # Generate the XML for the project # dictcopy['mac_projectxmlname'] = outputfile + '.xml' dictcopy['mac_exportname'] = os.path.split(outputfile)[1] + '.exp' - if not dictcopy.has_key('mac_outputdir'): - dictcopy['mac_outputdir'] = ':lib:' - if not dictcopy.has_key('stdlibraryflags'): - dictcopy['stdlibraryflags'] = 'Debug' - if not dictcopy.has_key('libraryflags'): - dictcopy['libraryflags'] = 'Debug' if not dictcopy.has_key('mac_dllname'): dictcopy['mac_dllname'] = modulename + '.ppc.slb' if not dictcopy.has_key('mac_targetname'): dictcopy['mac_targetname'] = modulename + '.ppc' - if os.path.isabs(dictcopy['sysprefix']): - dictcopy['mac_sysprefixtype'] = 'Absolute' - else: - dictcopy['mac_sysprefixtype'] = 'Project' # XXX not sure this is right... - # - # Generate the XML for the project - # + xmlbuilder = cwxmlgen.ProjectBuilder(dictcopy, templatename=templatename) xmlbuilder.generate() if not force: diff --git a/Mac/Lib/mkcwproject/cwxmlgen.py b/Mac/Lib/mkcwproject/cwxmlgen.py index f2e3eb2..e80cfa7 100644 --- a/Mac/Lib/mkcwproject/cwxmlgen.py +++ b/Mac/Lib/mkcwproject/cwxmlgen.py @@ -20,6 +20,7 @@ TEMPLATELIST= [ class ProjectBuilder: def __init__(self, dict, templatelist=TEMPLATELIST, templatename=None): + self._adddefaults(dict) if templatename == None: if hasattr(MacOS, 'runtimemodel'): templatename = 'template-%s'%MacOS.runtimemodel @@ -43,6 +44,20 @@ class ProjectBuilder: dict['prefixname'] = 'mwerks_plugin_config.h' self.templatelist = templatelist self.templatedir = templatedir + + def _adddefaults(self, dict): + # Set all suitable defaults set for values which were omitted. + if not dict.has_key('mac_outputdir'): + dict['mac_outputdir'] = ':lib:' + if not dict.has_key('stdlibraryflags'): + dict['stdlibraryflags'] = 'Debug' + if not dict.has_key('libraryflags'): + dict['libraryflags'] = 'Debug' + if not dict.has_key('mac_sysprefixtype'): + if os.path.isabs(dict['sysprefix']): + dict['mac_sysprefixtype'] = 'Absolute' + else: + dict['mac_sysprefixtype'] = 'Project' # XXX not sure this is right... def generate(self): for tmpl in self.templatelist: |