from pyfbsdk import *
def OnUIIdle(control, event):
print "UIIdle", control, event
def OnConnectionNotify(control, event):
"""
FBEventConnectionNotify
FBConnectionAction Action : Connection's action performed.
int SrcIndex : Index of the source in the destination component.
FBConnectionType ConnectionType: Connection's type.
object SrcPlug : The source plug involved in the action.
object DstPlug : The destination plug involved in the action.
object NewPlug : New plug created by the action. (Mostly used by merge/replace)
"""
print "OnConnectionNotify", event.Action, event.SrcIndex, event.ConnectionType, event.SrcPlug, event.DstPlug, event.NewPlug
def OnConnectionDataNotify(control, event):
"""
FBEventConnectionDataNotify
FBConnectionAction Action : Connection's action performed.
object Plug : The plug involved in the action.
"""
print "OnConnectionDataNotify", event.Action, event.Plug
def OnConnectionStateNotify(control, event):
"""
FBEventConnectionStateNotify
FBConnectionAction Action : Connection's action performed.
object Plug : The plug involved in the action.
"""
print "OnConnectionStateNotify", event.Action, event.Plug
def Register():
sys.OnConnectionNotify.Add(OnConnectionNotify)
sys.OnConnectionDataNotify.Add(OnConnectionDataNotify)
sys.OnConnectionStateNotify.Add(OnConnectionStateNotify)
app.OnFileExit.Add(Unregister)
def Unregister(control=None, event=None):
sys.OnConnectionNotify.Remove(OnConnectionNotify)
sys.OnConnectionDataNotify.Remove(OnConnectionDataNotify)
sys.OnConnectionStateNotify.Remove(OnConnectionStateNotify)
app.OnFileExit.Remove(Unregister)
sys = FBSystem()
app = FBApplication()
Register()