# -*- coding: utf-8 -*-
'''
This package contains the loader modules for the salt streams system
'''

# Import salt libs
import salt.loader
import salt.utils.odict

class Beacon(object):
    '''
    This class is used to eveluate and execute on the beacon system
    '''
    def __init__(self, opts):
        self.opts = opts
        self.beacons = salt.loader.beacons(opts)

    def process(self, config):
        '''
        Process the configured beacons

        The config must be a dict and looks like this in yaml

        code_block:: yaml

            beacons:
                inotify:
                    - /etc/fstab
                    - /var/cache/foo/*
        '''
        ret = salt.utils.odict.OrderedDict()
        for mod in config:
            fun_str = '{0}.beacon'.format(mod)
            if fun_str in self.beacons:
                ret[mod] = self.beacons[fun_str](config[mod])
        return ret

@@ -94,17 +94,16 @@
 tem%0A'''%0A
-%0A
 # Import
@@ -136,31 +136,8 @@
 der%0A
-import salt.utils.odict
 %0A%0Acl
@@ -666,38 +666,10 @@
 t = 
-salt.utils.odict.OrderedDict()
+%5B%5D
 %0A   
@@ -799,52 +799,298 @@
     
-ret%5Bmod%5D = self.beacons%5Bfun_str%5D(config%5Bmod%5D
+tag = 'salt/beacon/%7B0%7D/%7B1%7D/'.format(self.opts%5B'id'%5D, mod)%0A                raw = self.beacons%5Bfun_str%5D(config%5Bmod%5D)%0A                for data in raw:%0A                    if 'tag' in data:%0A                        tag += data.pop('tag')%0A                    ret.append(%7B'tag': tag, 'data': data%7D
 )%0A  

change process to return a list of events