2 # simple script to download and build g3d in-place
10 print "Connecting to http://downloads.sourceforge.net"
11 response
= urllib2
.urlopen("http://downloads.sourceforge.net/g3d-cpp/G3D-7.00-src.zip")
13 g3d_src
= open("G3D-7.00-src.zip","wb")
14 print "Downloading G3D.."
15 g3d_src
.write( response
.read() )
20 zipf
= open("G3D-7.00-src.zip", "rb")
21 zip = zipfile
.ZipFile(zipf
)
22 for name
in zip.namelist():
23 print "Extracting " + name
24 if name
.endswith('/'):
25 os
.mkdir(os
.path
.join(os
.getcwd(),name
))
27 outfile
= open(os
.path
.join(dir, name
), "wb")
28 outfile
.write(zip.read(name
))
33 (build_out
,build_in
) = popen2
.popen2("./buildg3d lib")
34 for line
in build_out
:
38 print "Connecting to http://downloads.sourceforge.net"
39 response
= urllib2
.urlopen("http://downloads.sourceforge.net/g3d-cpp/G3D-7.00-data.zip")
41 g3d_src
= open("G3D-7.00-data.zip","wb")
42 print "Downloading G3D Data pack. Will take awhile.."
43 g3d_src
.write( response
.read() )
48 zipf
= open("G3D-7.00-data.zip", "rb")
49 zip = zipfile
.ZipFile(zipf
)
50 for name
in zip.namelist():
51 print "Extracting " + name
52 if name
.endswith('/'):
53 os
.mkdir(os
.path
.join(os
.getcwd(),name
))
55 outfile
= open(os
.path
.join(dir, name
), "wb")
56 outfile
.write(zip.read(name
))
59 # TO DO .. copy dlls to exe dir