From 8bbddf2bf3563f11764491f35092e791c2934c36 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Fri, 31 May 2019 19:22:45 -0400 Subject: [PATCH] test loading --- sopel_modules/SpiceBot/AI.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sopel_modules/SpiceBot/AI.py b/sopel_modules/SpiceBot/AI.py index cc44ca2..342026a 100644 --- a/sopel_modules/SpiceBot/AI.py +++ b/sopel_modules/SpiceBot/AI.py @@ -18,13 +18,11 @@ class SpiceBot_AI(): # Learn responses import sopel_modules for plugin_dir in set(sopel_modules.__path__): - if plugin_dir in ["SpiceBot_Configs"]: - for pathname in os.listdir(plugin_dir): - if pathname in ["aiml"]: - pathpath = os.path.join(plugin_dir, pathname) - for aimlfile in os.listdir(pathpath): - aiml_filename = os.path.join(pathpath, pathname) - self.aiml_kernel.learn(aiml_filename) + configsdir = os.path.join(plugin_dir, "SpiceBot_Configs") + aimldir = os.path.join(configsdir, "aiml") + for aimlfile in os.listdir(aimldir): + aiml_filename = os.path.join(aimldir, aimlfile) + self.aiml_kernel.learn(aiml_filename) def on_message(self, message): return self.aiml_kernel.respond(message.content)