[Python-checkins] CVS: python/dist/src/Mac/Lib/mkcwproject cwxmlgen.py,1.6,1.7
Jack Jansen
jackjansen@users.sourceforge.net
Fri, 14 Dec 2001 06:31:17 -0800
Update of /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject
In directory usw-pr-cvs1:/tmp/cvs-serv14492/python/Mac/Lib/mkcwproject
Modified Files:
cwxmlgen.py
Log Message:
Add default values for options in the class init routine, not in the convenience wrapper function: distutils uses the class directly. Fixes bug #492665.
Index: cwxmlgen.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/cwxmlgen.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** cwxmlgen.py 2001/08/11 10:07:23 1.6
--- cwxmlgen.py 2001/12/14 14:31:15 1.7
***************
*** 21,24 ****
--- 21,25 ----
class ProjectBuilder:
def __init__(self, dict, templatelist=TEMPLATELIST, templatename=None):
+ self._adddefaults(dict)
if templatename == None:
if hasattr(MacOS, 'runtimemodel'):
***************
*** 44,47 ****
--- 45,62 ----
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):