#!/usr/bin/env python

import os
import yaml


class ChannelFilter(object):
    def __init__(self, path=None):
        if path is None:
            path = os.path.join(os.path.dirname(__file__), 'channels.yaml')
        with open(path) as f:
            self.config = yaml.load(f)

        print(self.config)

    @property
    def firehose_channel(self):
        return self.config['firehose-channel']

    @property
    def default_channel(self):
        return self.config['default-channel']

    def all_channels(self):
        channels = [self.default_channel, self.firehose_channel] + list(self.config['channels'])
        return list(set(channels))

    def channels_for(self, project):
        """
        :param project: Get all channels to spam for the given project
        :type project: basestring
        """
        channels = set()
        for channel in self.config['channels']:
            if project in self.config['channels'][channel]:
                channels.add(channel)
                continue
        if not channels:
            channels.add(self.default_channel)
        channels.add(self.firehose_channel)
        print(channels)
        return channels

@@ -680,24 +680,25 @@
 elf, project
+s
 ):%0A        %22
@@ -757,12 +757,8 @@
 for 
-the 
 give
@@ -766,16 +766,17 @@
  project
+s
 %0A       
@@ -795,18 +795,12 @@
 ct: 
-basestring
+list
 %0A   
@@ -881,16 +881,57 @@
 nels'%5D:%0A
+            for project in projects:%0A    
         
@@ -990,32 +990,36 @@
                 
+ 
+   
 channels.add(cha
@@ -1044,16 +1044,17 @@
     
-continue
+    break
 %0A   
@@ -1170,32 +1170,8 @@
 el)%0A
-        print(channels)%0A
     

Fix channel filtering to work properly