def setUp(self): # Test data and images are taken from # http://www.warriorhut.org/graphics/pornscanner/pornscanner.zip super(NSFWImageDetectorPluginTestCase, self).setUp() self.plugin = NSFWImageDetectorPlugin(bot=self.bot) self.fixtures_dir = os.path.join(self.fixtures_dir, 'nsfw_plugin') self.safe_images = glob.glob( os.path.join(self.fixtures_dir, 'safe/*.jpg')) self.unsafe_images = glob.glob( os.path.join(self.fixtures_dir, 'unsafe/*.jpg'))
def __init__(self, bot): self.bot = bot # reference back to asynchat handler self.joined_channel = False self.usertrim = re.compile('[!+@]') self.bot.known_users = {} # dict of known users present in the channel self.plugins = [ PsywerxHistory(bot=bot), PsywerxKarma(bot=bot), PsywerxGroups(bot=bot), NSFWImageDetectorPlugin(bot=bot), ReadLinks(bot=bot), Uptime(bot=bot), ]