#NEWLINE# def remove_hooks( occurrence ) : #NEWLINE# #INDENT# "remove hook from droned's default server resource" #NEWLINE# if ( resource . service . SERVICENAME not in ( dependant_service , SERVICENAME ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# global service #NEWLINE# service = False #NEWLINE# try : #NEWLINE# #INDENT# resource = get_resource ( ) #NEWLINE# if ( SERVICENAME in resource . children ) : #NEWLINE# #INDENT# resource . children . pop ( SERVICENAME ) #NEWLINE# #UNINDENT# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# Event ( 'service-stopped' ) . unsubscribe ( remove_hooks ) #NEWLINE# if ( occurrence . service . SERVICENAME == 'drone' ) : #NEWLINE# #INDENT# Event ( 'service-stopped' ) . fire ( service = __module__ ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# Event ( 'service-started' ) . unsubscribe ( add_hooks )