<s> from girder import events <EOL> from girder . models . model_base import ValidationException <EOL> from . import constants , rest <EOL> def validateSettings ( event ) : <EOL> key , val = event . info [ '<STR_LIT:key>' ] , event . info [ '<STR_LIT:value>' ] <EOL> if key == constants . PluginSettings . GOOGLE_ANALYTICS_TRACKING_ID : <EOL> if not val : <EOL> raise ValidationException ( <EOL> '<STR_LIT>' , '<STR_LIT:value>' ) <EOL> event . preventDefault ( ) . stopPropagation ( ) <EOL> def load ( info ) : <EOL> events . bind ( '<STR_LIT>' , '<STR_LIT>' , validateSettings ) <EOL> info [ '<STR_LIT>' ] . google_analytics = rest . GoogleAnalytics ( ) </s>
