From e0216142ca275d656b7137fa69a01e08c8caf610 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Fri, 31 May 2019 20:30:06 -0400 Subject: [PATCH] test --- sopel_modules/SpiceBot/AI.py | 20 +++++-------------- .../SpiceBot_Configs/aiml/{ => aiml}/dog.aiml | 0 .../{ => aiml}/std-startup.xml | 0 3 files changed, 5 insertions(+), 15 deletions(-) rename sopel_modules/SpiceBot_Configs/aiml/{ => aiml}/dog.aiml (100%) rename sopel_modules/SpiceBot_Configs/{ => aiml}/std-startup.xml (100%) diff --git a/sopel_modules/SpiceBot/AI.py b/sopel_modules/SpiceBot/AI.py index 505d249..2f294cf 100644 --- a/sopel_modules/SpiceBot/AI.py +++ b/sopel_modules/SpiceBot/AI.py @@ -7,8 +7,6 @@ This is the SpiceBot AI system. Based On Chatty cathy import os import aiml -from .Logs import logs - class SpiceBot_AI(): @@ -23,23 +21,15 @@ class SpiceBot_AI(): initial_dir = os.getcwd() for plugin_dir in set(sopel_modules.__path__): configsdir = os.path.join(plugin_dir, "SpiceBot_Configs") - aimlstarter = os.path.join(configsdir, "std-startup.xml") + aimldir = os.path.join(configsdir, "aiml") + aimlstarter = os.path.join(aimldir, "std-startup.xml") os.chdir(configsdir) - try: - self.aiml_kernel.learn(aimlstarter) - self.aiml_kernel.respond("LOAD AIML B") - # self.dict['counts'] += 1 - except Exception as e: - logs.log('SpiceBot_AI', "Error loading %s: %s (%s)" % ('aiml', e, aimlstarter)) + self.aiml_kernel.learn(aimlstarter) + self.aiml_kernel.respond("LOAD AIML B") os.chdir(initial_dir) - # logs.log('SpiceBot_AI', "Found " + str(self.dict['counts']) + " " + 'aiml' + " commands.", True) def on_message(self, message): - try: - aiml_response = self.aiml_kernel.respond(message) - except Exception as e: - aiml_response = e - return None + aiml_response = self.aiml_kernel.respond(message) return aiml_response diff --git a/sopel_modules/SpiceBot_Configs/aiml/dog.aiml b/sopel_modules/SpiceBot_Configs/aiml/aiml/dog.aiml similarity index 100% rename from sopel_modules/SpiceBot_Configs/aiml/dog.aiml rename to sopel_modules/SpiceBot_Configs/aiml/aiml/dog.aiml diff --git a/sopel_modules/SpiceBot_Configs/std-startup.xml b/sopel_modules/SpiceBot_Configs/aiml/std-startup.xml similarity index 100% rename from sopel_modules/SpiceBot_Configs/std-startup.xml rename to sopel_modules/SpiceBot_Configs/aiml/std-startup.xml