mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 15:25:54 -04:00
direct: Fix a few remaining uses of file() instead of open()
This commit is contained in:
parent
b7124da4aa
commit
20f38cad66
@ -4,7 +4,7 @@ import time
|
||||
|
||||
class RotatingLog:
|
||||
"""
|
||||
A file() (or open()) replacement that will automatically open and write
|
||||
An `open()` replacement that will automatically open and write
|
||||
to a new file if the prior file is too large or after a time interval.
|
||||
"""
|
||||
|
||||
|
@ -42,7 +42,7 @@ class DistributedLargeBlobSenderAI(DistributedObjectAI.DistributedObjectAI):
|
||||
break
|
||||
# NOTE: there's a small chance of a race condition here, if
|
||||
# the file is created by another AI just after the stat fails
|
||||
f = file(filename, 'wb')
|
||||
f = open(filename, 'wb')
|
||||
f.write(s)
|
||||
f.close()
|
||||
os.chdir(origDir)
|
||||
|
@ -24,7 +24,7 @@ class DistributedCameraOV(DistributedObjectOV):
|
||||
self.fixtures = fixtures
|
||||
|
||||
def storeToFile(self, name):
|
||||
f = file('cameras-%s.txt' % name, 'w')
|
||||
f = open('cameras-%s.txt' % name, 'w')
|
||||
f.writelines(self.getObject().pack())
|
||||
f.close()
|
||||
|
||||
@ -35,7 +35,7 @@ class DistributedCameraOV(DistributedObjectOV):
|
||||
|
||||
def loadFromFile(self, name):
|
||||
self.b_setFixtures([])
|
||||
f = file('cameras-%s.txt' % name, 'r');
|
||||
f = open('cameras-%s.txt' % name, 'r')
|
||||
for line in f.readlines():
|
||||
pos,hpr,fov = self.unpackFixture(line)
|
||||
self.addFixture([pos[0],pos[1],pos[2],
|
||||
|
Loading…
x
Reference in New Issue
Block a user