#NEWLINE# @ set_ev_cls ( stplib . EventPortStateChange , MAIN_DISPATCHER ) #NEWLINE# def _port_state_change_handler( self , ev ) : #NEWLINE# #INDENT# dpid_str = dpid_lib . dpid_to_str ( ev . dp . id ) #NEWLINE# of_state = { #NEWLINE# #INDENT# stplib . PORT_STATE_DISABLE : 'DISABLE' , #NEWLINE# stplib . PORT_STATE_BLOCK : 'BLOCK' , #NEWLINE# stplib . PORT_STATE_LISTEN : 'LISTEN' , #NEWLINE# stplib . PORT_STATE_LEARN : 'LEARN' , #NEWLINE# stplib . PORT_STATE_FORWARD : 'FORWARD' , #NEWLINE# #UNINDENT# } #NEWLINE# self . logger . debug ( '[dpid=%s][port=%d] state=%s' , dpid_str , ev . port_no , of_state [ ev . port_state ] )