Skip to content

Commit

Permalink
makepanda: fix various syntax warnings in Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
rdb committed Feb 11, 2019
1 parent f741c94 commit d93fb70
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion makepanda/installpanda.py
Expand Up @@ -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()

Expand Down
18 changes: 9 additions & 9 deletions makepanda/makechm.py
Expand Up @@ -213,19 +213,19 @@ 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)
if os.path.isfile("%s.hhc" % base): os.remove("%s.hhc" % base)
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:
Expand All @@ -246,7 +246,7 @@ def makeReferenceCHM(outputfile, dirname, title):
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):
Expand All @@ -260,22 +260,22 @@ def makeReferenceCHM(outputfile, dirname, title):
# 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!")

16 changes: 8 additions & 8 deletions makepanda/makepanda.py
Expand Up @@ -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'
Expand Down Expand Up @@ -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"):
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -6648,7 +6648,7 @@ def get_config_express():

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')
Expand Down

0 comments on commit d93fb70

Please sign in to comment.