mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
allow a VirtualFile
This commit is contained in:
parent
d7f1f67136
commit
512197c7d3
@ -41,6 +41,14 @@ class file:
|
||||
readMode = isinstance(filename, pm.Istream)
|
||||
writeMode = isinstance(filename, pm.Ostream)
|
||||
|
||||
elif isinstance(filename, pm.VirtualFile):
|
||||
# We can also "open" a VirtualFile object for reading.
|
||||
self.__stream = filename.openReadFile(autoUnwrap)
|
||||
if not self.__stream:
|
||||
raise IOError
|
||||
self.__needsVfsClose = True
|
||||
readMode = True
|
||||
|
||||
else:
|
||||
# Otherwise, we must have been given a filename. Open it.
|
||||
if isinstance(filename, types.StringTypes):
|
||||
|
Loading…
x
Reference in New Issue
Block a user