From 628994dffbc39566839f029ade69e6ba68726dc2 Mon Sep 17 00:00:00 2001 From: Joe Shochet Date: Thu, 1 Feb 2001 03:11:16 +0000 Subject: [PATCH] *** empty log message *** --- direct/src/ffi/FFIExternalObject.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/direct/src/ffi/FFIExternalObject.py b/direct/src/ffi/FFIExternalObject.py index 624e10e313..9d375e0c39 100644 --- a/direct/src/ffi/FFIExternalObject.py +++ b/direct/src/ffi/FFIExternalObject.py @@ -170,6 +170,20 @@ class FFIExternalObject: else: return 1 + def __repr__(self): + # Print this info for all objects + baseRepr = ('<' + self.__class__.__name__ + ' instance at C++ pointer: ' + `self.this` + '>') + try: + # Lots of Panda classes have an output function defined that takes an Ostream + # 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 + import LineStream + lineStream = LineStream.LineStream() + self.output(lineStream) + return baseRepr + '\n' + lineStream.getLine() + except: + return baseRepr + def __hash__(self): return self.this