mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 07:48:37 -04:00
makepanda: fix various syntax warnings in Python 3.8
This commit is contained in:
parent
f741c9476f
commit
d93fb702eb
@ -62,7 +62,7 @@ def WriteMimeXMLFile(fname, info):
|
||||
fhandle.write("\t<mime-type type=\"%s\">\n" % (mime))
|
||||
fhandle.write("\t\t<comment xml:lang=\"en\">%s</comment>\n" % (desc))
|
||||
fhandle.write("\t\t<glob pattern=\"*.%s\"/>\n" % (ext))
|
||||
fhandle.write("\t</mime-type>\s")
|
||||
fhandle.write("\t</mime-type>\n")
|
||||
fhandle.write("</mime-info>\n")
|
||||
fhandle.close()
|
||||
|
||||
|
@ -213,11 +213,11 @@ def makeCHM(outputfile, dirname, title, special = None):
|
||||
# Now, execute the command to compile the files.
|
||||
if "PROGRAMFILES" in os.environ and os.path.isdir("%s\\HTML Help Workshop" % os.environ["PROGRAMFILES"]):
|
||||
cmd = "\"%s\\HTML Help Workshop\\hhc.exe\" %s.hhp" % (os.environ["PROGRAMFILES"], base)
|
||||
elif os.path.isdir("C:\Program Files\HTML Help Workshop"):
|
||||
elif os.path.isdir("C:\\Program Files\\HTML Help Workshop"):
|
||||
cmd = "\"C:\\Program Files\\HTML Help Workshop\\hhc.exe\" %s.hhp" % base
|
||||
else:
|
||||
cmd = "hhc \"%s.hhp\"" % base
|
||||
print cmd
|
||||
print(cmd)
|
||||
os.system(cmd)
|
||||
if not KEEPTEMP:
|
||||
if os.path.isfile("%s.hhp" % base): os.remove("%s.hhp" % base)
|
||||
@ -225,7 +225,7 @@ def makeCHM(outputfile, dirname, title, special = None):
|
||||
if os.path.isfile("%s.hhk" % base): os.remove("%s.hhk" % base)
|
||||
if os.path.isfile("%s.chw" % base): os.remove("%s.chw" % base)
|
||||
if not os.path.isfile(base + ".chm"):
|
||||
print "An error has occurred!"
|
||||
print("An error has occurred!")
|
||||
if __name__ == "__main__":
|
||||
exit(1)
|
||||
else:
|
||||
@ -246,7 +246,7 @@ if __name__ == "__main__":
|
||||
VERSION = None
|
||||
try:
|
||||
f = file("built/include/pandaVersion.h","r")
|
||||
pattern = re.compile('^\s*[#]\s*define\s+PANDA_VERSION_STR\s+["]([0-9.]+)["]')
|
||||
pattern = re.compile('^\\s*[#]\\s*define\\s+PANDA_VERSION_STR\\s+["]([0-9.]+)["]')
|
||||
for line in f:
|
||||
match = pattern.match(line,0)
|
||||
if (match):
|
||||
@ -260,22 +260,22 @@ if __name__ == "__main__":
|
||||
# Now, make CHM's for both the manual and reference, if we have them.
|
||||
for lang in ["python", "cxx"]:
|
||||
if not os.path.isdir("manual-" + lang):
|
||||
print "No directory named 'manual-%s' found" % lang
|
||||
print("No directory named 'manual-%s' found" % lang)
|
||||
else:
|
||||
print "Making CHM file for manual-%s..." % lang
|
||||
print("Making CHM file for manual-%s..." % lang)
|
||||
if VERSION == None:
|
||||
makeManualCHM("manual-%s.chm" % lang, "manual-" + lang, "Panda3D Manual")
|
||||
else:
|
||||
makeManualCHM("manual-%s-%s.chm" % (VERSION, lang), "manual-" + lang, "Panda3D %s Manual" % VERSION)
|
||||
|
||||
if not os.path.isdir("reference-" + lang):
|
||||
print "No directory named 'reference-%s' found" % lang
|
||||
print("No directory named 'reference-%s' found" % lang)
|
||||
else:
|
||||
print "Making CHM file for reference-%s..." % lang
|
||||
print("Making CHM file for reference-%s..." % lang)
|
||||
if VERSION == None:
|
||||
makeReferenceCHM("reference-%s.chm" % lang, "reference-" + lang, "Panda3D Reference")
|
||||
else:
|
||||
makeReferenceCHM("reference-%s-%s.chm" % (VERSION, lang), "reference-" + lang, "Panda3D %s Reference" % VERSION)
|
||||
|
||||
print "Done!"
|
||||
print("Done!")
|
||||
|
||||
|
@ -1570,7 +1570,7 @@ def CompileIgate(woutd,wsrc,opts):
|
||||
# NOTE: this 1600 value is the version number for VC2010.
|
||||
cmd += ' -D_MSC_VER=1600 -D"__declspec(param)=" -D__cdecl -D_near -D_far -D__near -D__far -D__stdcall'
|
||||
if (COMPILER=="GCC"):
|
||||
cmd += ' -D__attribute__\(x\)='
|
||||
cmd += ' -D__attribute__\\(x\\)='
|
||||
target_arch = GetTargetArch()
|
||||
if target_arch in ("x86_64", "amd64"):
|
||||
cmd += ' -D_LP64'
|
||||
@ -1675,9 +1675,9 @@ def CompileLib(lib, obj, opts):
|
||||
cmd += " /MACHINE:" + GetTargetArch().upper()
|
||||
cmd += ' /OUT:' + BracketNameWithQuotes(lib)
|
||||
for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
|
||||
cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\ipp\lib\ia32"'
|
||||
cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\TBB\Lib\ia32\vc10"'
|
||||
cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\compiler\lib\ia32"'
|
||||
cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
|
||||
cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
|
||||
cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
|
||||
oscmd(cmd)
|
||||
|
||||
if (COMPILER=="GCC"):
|
||||
@ -1783,9 +1783,9 @@ def CompileLink(dll, obj, opts):
|
||||
cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
|
||||
cmd += " /NOD:LIBCI.LIB /DEBUG"
|
||||
cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls"
|
||||
cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\ipp\lib\ia32"'
|
||||
cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\TBB\Lib\ia32\vc10"'
|
||||
cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\compiler\lib\ia32"'
|
||||
cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
|
||||
cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
|
||||
cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
|
||||
if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
|
||||
optlevel = GetOptimizeOption(opts)
|
||||
if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
|
||||
@ -6648,7 +6648,7 @@ if PkgSkip("PYTHON") == 0:
|
||||
|
||||
if GetTarget() == 'linux' or GetTarget() == 'freebsd':
|
||||
# Setup rpath so libs can be found in the same directory as the deployed game
|
||||
LibName('DEPLOYSTUB', "-Wl,-rpath,\$ORIGIN")
|
||||
LibName('DEPLOYSTUB', "-Wl,-rpath,\\$ORIGIN")
|
||||
LibName('DEPLOYSTUB', "-Wl,-z,origin")
|
||||
LibName('DEPLOYSTUB', "-rdynamic")
|
||||
PyTargetAdd('deploy-stub.exe', input='deploy-stub.obj')
|
||||
|
Loading…
x
Reference in New Issue
Block a user