def post_event(event, channel=None, username=None, api_url=None, hook=None):
 if (not api_url):
  api_url = _get_api_url()
 if (not hook):
  hook = _get_hook()
 if (not username):
  username = _get_username()
 if (not channel):
  channel = _get_channel()
 if (not event):
  log.error('message is a required option.')
 log.debug('Event: {0}'.format(str(event)))
 log.debug('Event data: {0}'.format(str(event['data'])))
 message = 'tag: {0}\r\n'.format(event['tag'])
 for (key, value) in event['data'].iteritems():
  message += '{0}: {1}\r\n'.format(key, value)
 result = post_message(channel, username, message, api_url, hook)
 return bool(result)

def post_event ( event , channel = None , username = None , api_url = None , hook = None ) : if ( not api_url ) : api_url = _get_api_url ( ) if ( not hook ) : hook = _get_hook ( ) if ( not username ) : username = _get_username ( ) if ( not channel ) : channel = _get_channel ( ) if ( not event ) : log . error ( 'message is a required option.' ) log . debug ( 'Event: {0}' . format ( str ( event ) ) ) log . debug ( 'Event data: {0}' . format ( str ( event [ 'data' ] ) ) ) message = 'tag: {0}\r\n' . format ( event [ 'tag' ] ) for ( key , value ) in event [ 'data' ] . iteritems ( ) : message += '{0}: {1}\r\n' . format ( key , value ) result = post_message ( channel , username , message , api_url , hook ) return bool ( result )
send an event to a mattermost channel .