Renamer modules can now optionally have a call to main() added by the

generator script


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@23926 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-09-26 03:31:02 +00:00
parent 8cd0be64ff
commit b50c1fd27a
7 changed files with 28 additions and 0 deletions

View File

@@ -28,6 +28,11 @@ del %(suffix)s
del _rename del _rename
""" """
call_main = """
if __name__ == '__main__':
main()
"""
wxPython_dir = "../wxPython" wxPython_dir = "../wxPython"
subpackage_list = ['.', subpackage_list = ['.',
@@ -47,6 +52,9 @@ skip_modules = [ '__init__', '__version__',
] ]
add_call_main = ['py/PyAlaCarte.py', 'py/PyAlaMode.py', 'py/PyCrust.py',
'py/PyFilling.py', 'py/PyShell.py', 'py/PyWrap.py'
]
@@ -101,6 +109,8 @@ for subdir in subpackage_list:
content = wxmodule_template % globals() content = wxmodule_template % globals()
f = open(fname, 'w') f = open(fname, 'w')
f.write(content) f.write(content)
if fname in add_call_main:
f.write(call_main)
f.close() f.close()
print fname + ' created' print fname + ' created'

View File

@@ -6,3 +6,6 @@ from wxPython.py import PyAlaCarte
_rename(globals(), PyAlaCarte.__dict__, modulename='py.PyAlaCarte') _rename(globals(), PyAlaCarte.__dict__, modulename='py.PyAlaCarte')
del PyAlaCarte del PyAlaCarte
del _rename del _rename
if __name__ == '__main__':
main()

View File

@@ -6,3 +6,6 @@ from wxPython.py import PyAlaMode
_rename(globals(), PyAlaMode.__dict__, modulename='py.PyAlaMode') _rename(globals(), PyAlaMode.__dict__, modulename='py.PyAlaMode')
del PyAlaMode del PyAlaMode
del _rename del _rename
if __name__ == '__main__':
main()

View File

@@ -6,3 +6,6 @@ from wxPython.py import PyCrust
_rename(globals(), PyCrust.__dict__, modulename='py.PyCrust') _rename(globals(), PyCrust.__dict__, modulename='py.PyCrust')
del PyCrust del PyCrust
del _rename del _rename
if __name__ == '__main__':
main()

View File

@@ -6,3 +6,6 @@ from wxPython.py import PyFilling
_rename(globals(), PyFilling.__dict__, modulename='py.PyFilling') _rename(globals(), PyFilling.__dict__, modulename='py.PyFilling')
del PyFilling del PyFilling
del _rename del _rename
if __name__ == '__main__':
main()

View File

@@ -6,3 +6,6 @@ from wxPython.py import PyShell
_rename(globals(), PyShell.__dict__, modulename='py.PyShell') _rename(globals(), PyShell.__dict__, modulename='py.PyShell')
del PyShell del PyShell
del _rename del _rename
if __name__ == '__main__':
main()

View File

@@ -6,3 +6,6 @@ from wxPython.py import PyWrap
_rename(globals(), PyWrap.__dict__, modulename='py.PyWrap') _rename(globals(), PyWrap.__dict__, modulename='py.PyWrap')
del PyWrap del PyWrap
del _rename del _rename
if __name__ == '__main__':
main()