Skip to content

Instantly share code, notes, and snippets.

@mpurzynski
Created August 3, 2017 22:21
Show Gist options
  • Select an option

  • Save mpurzynski/31abf70f7375b0fd2227d4b365fdd02d to your computer and use it in GitHub Desktop.

Select an option

Save mpurzynski/31abf70f7375b0fd2227d4b365fdd02d to your computer and use it in GitHub Desktop.
class message(object):
def __init__(self):
'''
takes an incoming bro message
and sets the doc_type
'''
self.registration = ['bro', 'nsm']
self.priority = 5
sys.stderr.write('dupa.9\n')
def onMessage(self, message, metadata):
# set the doc type to bro
# to avoid data type conflicts with other doc types
# (int v string, etc)
metadata['doc_type']= 'bro'
sys.stderr.write('dupa.10\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment