mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
allow sending Python Notify messages into the C++ Notify system
This commit is contained in:
parent
67e3f1daa6
commit
a2b01921df
@ -10,6 +10,12 @@ import types
|
|||||||
class Notifier:
|
class Notifier:
|
||||||
serverDelta = 0
|
serverDelta = 0
|
||||||
|
|
||||||
|
# If this object is set to something, it is used to print output
|
||||||
|
# messages instead of writing them to the console. This is
|
||||||
|
# particularly useful for integrating the Python notify system
|
||||||
|
# with the C++ notify system.
|
||||||
|
streamWriter = None
|
||||||
|
|
||||||
def __init__(self, name, logger=None):
|
def __init__(self, name, logger=None):
|
||||||
"""
|
"""
|
||||||
name is a string
|
name is a string
|
||||||
@ -201,10 +207,11 @@ class Notifier:
|
|||||||
|
|
||||||
def __print(self, string):
|
def __print(self, string):
|
||||||
"""
|
"""
|
||||||
Prints the string to standard output followed by a newline.
|
Prints the string to output followed by a newline.
|
||||||
If we ever need to do something else than Python print, you
|
|
||||||
could put it here.
|
|
||||||
"""
|
"""
|
||||||
|
if self.streamWriter:
|
||||||
|
self.streamWriter.appendData(string + '\n')
|
||||||
|
else:
|
||||||
print string
|
print string
|
||||||
|
|
||||||
def debugStateCall(self, obj=None, fsmMemberName='fsm',
|
def debugStateCall(self, obj=None, fsmMemberName='fsm',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user