1999-12-31 03:29:02 -05:00
|
|
|
|
|
|
|
|
|
|
|
import sys, os, string, time
|
|
|
|
from ftplib import FTP
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
cwd = os.getcwd()
|
1999-12-31 03:29:02 -05:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
logfile = 'c:\\temp\\autobuild.log'
|
1999-12-31 03:29:02 -05:00
|
|
|
WXDIR = os.environ['WXWIN']
|
2000-12-10 23:00:06 -05:00
|
|
|
dllVer = '23_0'
|
|
|
|
wxpVer = '2.3b1'
|
1999-12-31 03:29:02 -05:00
|
|
|
dateSt = time.strftime("%Y%m%d", time.localtime(time.time()))
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
base = os.path.split(sys.argv[0])[0]
|
|
|
|
base = os.path.join(base, '..')
|
|
|
|
WXPYDIR = os.path.abspath(base)
|
|
|
|
|
1999-12-31 03:29:02 -05:00
|
|
|
#----------------------------------------------------------------------
|
|
|
|
|
|
|
|
def do(cmd):
|
|
|
|
st = " " + cmd + " >> " + logfile
|
|
|
|
print st
|
|
|
|
f = open(logfile, "at")
|
|
|
|
f.write(st + '\n')
|
|
|
|
f.close()
|
|
|
|
os.system(cmd + " >>& " + logfile)
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------
|
|
|
|
|
|
|
|
def logTruncate():
|
|
|
|
f = open(logfile, "wt")
|
|
|
|
f.close()
|
|
|
|
|
|
|
|
|
|
|
|
def logSeparator(msg=None, f=None, recurse=1):
|
|
|
|
if not f:
|
|
|
|
f = open(logfile, "at")
|
|
|
|
f.write('\n')
|
|
|
|
f.write('--' * 35)
|
|
|
|
f.write('\n')
|
|
|
|
if msg:
|
|
|
|
f.write(msg)
|
|
|
|
f.write('\n')
|
|
|
|
f.write('--' * 35)
|
|
|
|
f.write('\n')
|
|
|
|
if recurse:
|
|
|
|
logSeparator(msg, sys.stdout, 0)
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------
|
|
|
|
|
|
|
|
def validateFile(file):
|
|
|
|
if not os.path.exists(file):
|
|
|
|
logSeparator("***** %s does not exist, exiting! *****" % file)
|
|
|
|
raise SystemExit
|
|
|
|
else:
|
|
|
|
logSeparator("%s found, continuing..." % file, recurse=0)
|
|
|
|
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------
|
|
|
|
|
|
|
|
def main():
|
|
|
|
logTruncate()
|
|
|
|
|
|
|
|
try:
|
|
|
|
logSeparator("Cleanup")
|
|
|
|
os.chdir(WXDIR + '/src/msw')
|
|
|
|
do('make cleandll FINAL=1')
|
|
|
|
|
|
|
|
logSeparator("Building Documentation...")
|
|
|
|
os.chdir(WXDIR + '/src/msw')
|
|
|
|
do('make touchmanual htmlhelp')
|
2000-07-15 15:51:35 -04:00
|
|
|
validateFile(WXDIR + '/docs/htmlhelp/wx.chm')
|
1999-12-31 03:29:02 -05:00
|
|
|
|
2000-12-10 23:00:06 -05:00
|
|
|
logSeparator("Building wxWindows...")
|
1999-12-31 03:29:02 -05:00
|
|
|
os.chdir(WXDIR + '/src/msw')
|
|
|
|
do('make dll pch FINAL=1')
|
|
|
|
validateFile(WXDIR + '/lib/wx'+dllVer+'.dll')
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
logSeparator("Cleaning wxPython build directory...")
|
|
|
|
os.chdir(WXPYDIR)
|
2000-12-10 23:00:06 -05:00
|
|
|
do('b.bat c')
|
1999-12-31 03:29:02 -05:00
|
|
|
|
2000-12-10 23:00:06 -05:00
|
|
|
logSeparator("Building wxPython...")
|
2000-07-15 15:51:35 -04:00
|
|
|
os.chdir(WXPYDIR + '\\src')
|
2000-12-10 23:00:06 -05:00
|
|
|
do("b.bat f")
|
2000-07-15 15:51:35 -04:00
|
|
|
validateFile(WXPYDIR+'\\wxPython\\wxc.pyd')
|
1999-12-31 03:29:02 -05:00
|
|
|
|
|
|
|
|
|
|
|
logSeparator("Building installer executable...")
|
2000-07-15 15:51:35 -04:00
|
|
|
os.chdir(WXPYDIR+'\\distrib')
|
1999-12-31 03:29:02 -05:00
|
|
|
do("autoit2 wise.aut")
|
2000-07-15 15:51:35 -04:00
|
|
|
srcName = WXPYDIR+'\\distrib\\wxPython-'+wxpVer+'.EXE'
|
|
|
|
destName = WXPYDIR+'\\distrib\\wxPython-'+wxpVer+'-'+dateSt+'.EXE'
|
1999-12-31 03:29:02 -05:00
|
|
|
validateFile(srcName)
|
|
|
|
try:
|
2000-01-31 16:07:04 -05:00
|
|
|
time.sleep(5)
|
1999-12-31 03:29:02 -05:00
|
|
|
os.rename(srcName, destName)
|
2000-01-31 16:07:04 -05:00
|
|
|
validateFile(destName)
|
1999-12-31 03:29:02 -05:00
|
|
|
except:
|
2000-07-15 15:51:35 -04:00
|
|
|
logSeparator("****** UNABLE TO RENAME FILE ******")
|
1999-12-31 03:29:02 -05:00
|
|
|
|
|
|
|
|
2000-12-10 23:00:06 -05:00
|
|
|
logSeparator("Building docs zip file...")
|
2000-07-15 15:51:35 -04:00
|
|
|
os.chdir(WXPYDIR)
|
|
|
|
do("distrib\\zipit.bat %s" % wxpVer)
|
1999-12-31 03:29:02 -05:00
|
|
|
|
2000-12-10 23:00:06 -05:00
|
|
|
srcDName = WXPYDIR+'\\distrib\\wxPython-docs-'+wxpVer+'.tar.gz'
|
|
|
|
destDName = WXPYDIR+'\\distrib\\wxPython-docs-'+wxpVer+'-'+dateSt+'.tar.gz'
|
2000-02-16 00:57:16 -05:00
|
|
|
validateFile(srcDName)
|
|
|
|
try:
|
|
|
|
os.rename(srcDName, destDName)
|
|
|
|
except:
|
|
|
|
pass
|
1999-12-31 03:29:02 -05:00
|
|
|
|
2000-01-31 16:07:04 -05:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2000-02-16 00:57:16 -05:00
|
|
|
# #*#*#*#*#* Comment this out to allow upload...
|
2000-12-10 23:00:06 -05:00
|
|
|
#return
|
2000-01-31 16:07:04 -05:00
|
|
|
|
1999-12-31 03:29:02 -05:00
|
|
|
logSeparator("Uploading to website...")
|
2000-07-15 15:51:35 -04:00
|
|
|
do('python c:\\utils\\sendwxp.py %s' % destName)
|
2000-12-10 23:00:06 -05:00
|
|
|
#do('python c:\\utils\\sendwxp.py %s' % destDName)
|
1999-12-31 03:29:02 -05:00
|
|
|
|
|
|
|
|
|
|
|
logSeparator("Finished!!!")
|
|
|
|
|
|
|
|
finally:
|
|
|
|
os.system("list " + logfile)
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|