<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> from django import dispatch as django_dispatch <EOL> from django . db . models import signals as django_signals <EOL> from services . common import pusher as satnet_push <EOL> from services . configuration . models import segments as segment_models <EOL> @ django_dispatch . receiver ( <EOL> django_signals . post_save , <EOL> sender = segment_models . GroundStation <EOL> ) <EOL> def gs_added_or_updated_handler ( sender , instance , created , raw , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> if raw : <EOL> return <EOL> if created : <EOL> satnet_push . PushService ( ) . trigger_event ( <EOL> satnet_push . PushService . CONFIGURATION_EVENTS_CHANNEL , <EOL> satnet_push . PushService . GS_ADDED_EVENT , <EOL> { '<STR_LIT>' : instance . identifier } <EOL> ) <EOL> else : <EOL> satnet_push . PushService ( ) . trigger_event ( <EOL> satnet_push . PushService . CONFIGURATION_EVENTS_CHANNEL , <EOL> satnet_push . PushService . GS_UPDATED_EVENT , <EOL> { '<STR_LIT>' : instance . identifier } <EOL> ) <EOL> @ django_dispatch . receiver ( <EOL> django_signals . pre_delete , <EOL> sender = segment_models . GroundStation <EOL> ) <EOL> def gs_removed_handler ( sender , instance , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> satnet_push . PushService ( ) . trigger_event ( <EOL> satnet_push . PushService . CONFIGURATION_EVENTS_CHANNEL , <EOL> satnet_push . PushService . GS_REMOVED_EVENT , <EOL> { '<STR_LIT>' : instance . identifier } <EOL> ) </s>
