Fix assorted instances of leftover Python 3 syntax

Closes #1490
This commit is contained in:
max 2023-05-05 11:08:17 +02:00 committed by rdb
parent 5d833c988a
commit cc74efa79a
6 changed files with 18 additions and 18 deletions

View File

@ -1905,7 +1905,7 @@ class main(wx.Frame):
self.txaExtraLines.append(line) self.txaExtraLines.append(line)
txafile.close() txafile.close()
except: except:
print "Error opening .txa file!" print("Error opening .txa file!")
self.palettize_saveTxaTxt.SetValue(os.path.join(dirname + os.sep , filename)) self.palettize_saveTxaTxt.SetValue(os.path.join(dirname + os.sep , filename))
dlg.Destroy() dlg.Destroy()
@ -2705,7 +2705,7 @@ class main(wx.Frame):
selectedItemIndex = int(self.batchTree.GetItemText(selectedItemId).split()[0])-1 selectedItemIndex = int(self.batchTree.GetItemText(selectedItemId).split()[0])-1
batchItem = self.batchList[selectedItemIndex] batchItem = self.batchList[selectedItemIndex]
print '\n'+self.BuildCommand(batchItem) print('\n'+self.BuildCommand(batchItem))
if (batchItem['cmd'].count('maya2egg')): if (batchItem['cmd'].count('maya2egg')):
# Display Maya2Egg Tool Panel # Display Maya2Egg Tool Panel
@ -2840,7 +2840,7 @@ class main(wx.Frame):
self.txaExtraLines.append(line) self.txaExtraLines.append(line)
txafile.close() txafile.close()
except: except:
print "Error opening .txa file!" print("Error opening .txa file!")
self.batchItemNameTxt.SetValue(batchItem['label']) self.batchItemNameTxt.SetValue(batchItem['label'])

View File

@ -17,8 +17,8 @@ import os
from direct.dist import FreezeTool from direct.dist import FreezeTool
def usage(code, msg = ''): def usage(code, msg = ''):
print >> sys.stderr, __doc__ print(__doc__, file=sys.stderr)
print >> sys.stderr, msg print(msg, file=sys.stderr)
sys.exit(code) sys.exit(code)
if __name__ == '__main__': if __name__ == '__main__':
@ -30,7 +30,7 @@ if __name__ == '__main__':
try: try:
opts, args = getopt.getopt(sys.argv[1:], 'h') opts, args = getopt.getopt(sys.argv[1:], 'h')
except getopt.error, msg: except getopt.error as msg:
usage(1, msg) usage(1, msg)
for opt, arg in opts: for opt, arg in opts:

View File

@ -34,7 +34,7 @@ command = 'env CODESIGN_ALLOCATE="/Developer/Platforms/iPhoneOS.platform/Develop
'xcent' : xcent, 'xcent' : xcent,
} }
print command print(command)
result = os.system(command) result = os.system(command)
if result != 0: if result != 0:
raise StandardError raise StandardError

View File

@ -11,7 +11,7 @@ SocketIP.InitNetworkDriver();
addr = SocketAddress() addr = SocketAddress()
addr.setHost("127.0.0.1",8080) addr.setHost("127.0.0.1",8080)
print addr.getIpPort() print(addr.getIpPort())
inbound = SocketTCPListen() inbound = SocketTCPListen()
@ -23,16 +23,16 @@ while 1 == 1:
source = SocketAddress() source = SocketAddress()
if inbound.GetIncomingConnection(newsession,source) : if inbound.GetIncomingConnection(newsession,source) :
#newsession.SetNonBlocking(); #newsession.SetNonBlocking();
print source.getIpPort() print(source.getIpPort())
newsession.SendData("Hello From the Listener\n\r"); newsession.SendData("Hello From the Listener\n\r");
s = newsession.RecvData(10); s = newsession.RecvData(10);
print s print(s)
print newsession.GetLastError() print(newsession.GetLastError())
if newsession.ErrorIsWouldBlocking(newsession.GetLastError()) : if newsession.ErrorIsWouldBlocking(newsession.GetLastError()) :
print "Reading Would Block" print("Reading Would Block")
else: else:
print "Not A Blocking Error" print("Not A Blocking Error")
newsession.SendData("GoodBy From the Listener\n\r"); newsession.SendData("GoodBy From the Listener\n\r");
newsession.Close(); newsession.Close();

View File

@ -15,7 +15,7 @@ SocketIP.InitNetworkDriver();
addr = SocketAddress() addr = SocketAddress()
addr.setHost("127.0.0.1",6666) addr.setHost("127.0.0.1",6666)
print addr.getIpPort() print(addr.getIpPort())
MyConection = BufferedDatagramConnection(0,4096000,4096000,102400); MyConection = BufferedDatagramConnection(0,4096000,4096000,102400);
#help(BufferedDatagramConnection) #help(BufferedDatagramConnection)
@ -42,8 +42,8 @@ dg1.addUint16(54321)
while 1==1: while 1==1:
for x in range(200000): for x in range(200000):
if not MyConection.SendMessage(dg1): if not MyConection.SendMessage(dg1):
print "Error Sending Message" print("Error Sending Message")
MyConection.Flush(); MyConection.Flush();
time.sleep(1) time.sleep(1)
print "loop" print("loop")

View File

@ -15,7 +15,7 @@ SocketIP.InitNetworkDriver();
addr = SocketAddress() addr = SocketAddress()
addr.setHost("127.0.0.1",6666) addr.setHost("127.0.0.1",6666)
print addr.getIpPort() print(addr.getIpPort())
MyConection = BufferedDatagramConnection(0,4096000,4096000,102400); MyConection = BufferedDatagramConnection(0,4096000,4096000,102400);
#help(BufferedDatagramConnection) #help(BufferedDatagramConnection)
@ -47,4 +47,4 @@ while 1==1:
MyConection.Flush(); MyConection.Flush();
time.sleep(1) time.sleep(1)
print "loop" print("loop")