Fixed Python 3 support

This commit is contained in:
Sworddragon 2011-04-02 04:49:14 +02:00 committed by oy
parent 3e6b77b040
commit e3a2d656f1
2 changed files with 11 additions and 11 deletions

View file

@ -220,7 +220,7 @@ if 1:
content += "call %VSPATH%vsvars32.bat\n\n"
content += ":compile\n"
content += 'cd %s\n"%s\\%s%sbam" config\n"%s\\%s%sbam" %s' % (src_dir_teeworlds, work_dir, src_dir_bam, bam_execution_path, work_dir, src_dir_bam, bam_execution_path, options.release_type)
file.write(content)
file.write(content.encode())
file.close()
command = os.system("build.bat")
else:

View file

@ -6,8 +6,8 @@ if match != None:
#valid_platforms = ["win32", "linux86", "linux86_64", "src"]
if len(sys.argv) != 3:
print "wrong number of arguments"
print sys.argv[0], "VERSION PLATFORM"
print("wrong number of arguments")
print(sys.argv[0], "VERSION PLATFORM")
sys.exit(-1)
name = "teeworlds"
@ -30,8 +30,8 @@ if platform == "src":
use_gz = 1
#if not platform in valid_platforms:
# print "not a valid platform"
# print valid_platforms
# print("not a valid platform")
# print(valid_platforms)
# sys.exit(-1)
if platform == 'win32':
@ -57,11 +57,11 @@ def copydir(src, dst, excl=[]):
package = "%s-%s-%s" %(name, version, platform)
package_dir = package
print "cleaning target"
print("cleaning target")
shutil.rmtree(package_dir, True)
os.mkdir(package_dir)
print "adding files"
print("adding files")
shutil.copy("readme.txt", package_dir)
shutil.copy("license.txt", package_dir)
shutil.copy("storage.cfg", package_dir)
@ -169,7 +169,7 @@ if use_bundle:
file(os.path.join(serverbundle_content_dir, "PkgInfo"), "w").write("APPL????")
if use_zip:
print "making zip archive"
print("making zip archive")
zf = zipfile.ZipFile("%s.zip" % package, 'w', zipfile.ZIP_DEFLATED)
for root, dirs, files in os.walk(package_dir, topdown=True):
@ -180,14 +180,14 @@ if use_zip:
zf.close()
if use_gz:
print "making tar.gz archive"
print("making tar.gz archive")
os.system("tar czf %s.tar.gz %s" % (package, package_dir))
if use_dmg:
print "making disk image"
print("making disk image")
os.system("rm -f %s.dmg %s_temp.dmg" % (package, package))
os.system("hdiutil create -srcfolder %s -volname Teeworlds -quiet %s_temp" % (package_dir, package))
os.system("hdiutil convert %s_temp.dmg -format UDBZ -o %s.dmg -quiet" % (package, package))
os.system("rm -f %s_temp.dmg" % package)
print "done"
print("done")