From cb9ef6c436e8db871daf7cbd80480bf897d63681 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Thu, 2 May 2019 20:04:22 -0400 Subject: [PATCH] CommandsQuery: Update Logic for sopel_modules --- sopel_modules/SpiceBot_CommandsQuery/CommandsQuery.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sopel_modules/SpiceBot_CommandsQuery/CommandsQuery.py b/sopel_modules/SpiceBot_CommandsQuery/CommandsQuery.py index 3996216..c1b6cf1 100644 --- a/sopel_modules/SpiceBot_CommandsQuery/CommandsQuery.py +++ b/sopel_modules/SpiceBot_CommandsQuery/CommandsQuery.py @@ -50,11 +50,12 @@ def setup_thread(bot): # pypi installed try: import sopel_modules - pypi_modules = os.path.dirname(os.path.abspath(sopel_modules.__file__)) - pypi_modules_dir = os.path.join(pypi_modules, 'modules') - filepathlisting.append(pypi_modules_dir) + for plugin_dir in set(sopel_modules.__path__): + for pathname in os.listdir(plugin_dir): + pypi_modules_dir = os.path.join(plugin_dir, pathname) + filepathlisting.append(pypi_modules_dir) except Exception as e: - stderr("[Sopel-CommandsQuery] sopel_modules not found:" + str(e)) + stderr("[Sopel-CommandsQuery] sopel_modules not loaded :" + str(e)) # Extra directories filepathlist = [] @@ -159,7 +160,6 @@ def query_detection(bot, trigger): # command must start with if not str(trigger).startswith(tuple(['?'])): return - stderr(trigger.args) commands_list = dict() for commandstype in bot.memory['Sopel-CommandsQuery'].keys():