mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
*** empty log message ***
This commit is contained in:
parent
768861a4d0
commit
d70c8b1809
@ -173,15 +173,26 @@ class FFIExternalObject:
|
|||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
# Print this info for all objects
|
# Print this info for all objects
|
||||||
baseRepr = ('<' + self.__class__.__name__ + ' instance at C++ pointer: ' + `self.this` + '>')
|
baseRepr = ('<' + self.__class__.__name__ + ' instance at C++ pointer: ' + `self.this` + '>')
|
||||||
try:
|
# Lots of Panda classes have an write or output function defined that takes an Ostream
|
||||||
# Lots of Panda classes have an output function defined that takes an Ostream
|
# We create a LineStream for the write or output function to write to, then we extract
|
||||||
# We create a LineStream for the output function to write to, then we extract
|
|
||||||
# the string out of it and return it as our repr
|
# the string out of it and return it as our repr
|
||||||
import LineStream
|
import LineStream
|
||||||
lineStream = LineStream.LineStream()
|
lineStream = LineStream.LineStream()
|
||||||
self.output(lineStream)
|
try:
|
||||||
return baseRepr + '\n' + lineStream.getLine()
|
# First try the write function, that is the better one
|
||||||
|
self.write(lineStream)
|
||||||
|
while lineStream.isTextAvailable():
|
||||||
|
baseRepr = baseRepr + '\n' + lineStream.getLine()
|
||||||
except:
|
except:
|
||||||
|
try:
|
||||||
|
# Ok, no write function, lets try output then
|
||||||
|
self.output(lineStream)
|
||||||
|
while lineStream.isTextAvailable():
|
||||||
|
baseRepr = baseRepr + '\n' + lineStream.getLine()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
# In any case, return the baseRepr
|
||||||
return baseRepr
|
return baseRepr
|
||||||
|
|
||||||
def __hash__(self):
|
def __hash__(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user