I have the following classes:
from forwind.lidarapi.api import MCLidarGUIPlugin
class MCLidarActions( Handler ):
tcp_send = Event
def object__updated_changed( self, info ):
print info;
pass;
def _tcp_send_changed( self ):
print( "Click" )
and
from forwind.lidarapi.actions.api import MCLidarActions
class MCUDPActions( MCLidarActions ):
def object__updated_changed( self, info ):
pass;
def _tcp_send_changed( self ):
print( "Click UDP" )
When I click on a button in the MCLidarActions the _tcp_send_changed function will be called, how can I extend this function, I want to take action in the MCUDPActions as well. In this case If I click on the button it will printed out click but I want to print out Click UDP as well
If I understood correctly you problem, you could do:
result
But in the above code, it is necessary to define a function __init__ in each subclass MCUDPActions and MC_uuuuuuuuuuuuuutp_Actions of the base class MCLidarActions
To avoid that , the appending in li can be put in the base class:
and the result is exactly the same.