def load_plugins(hook_plugins, command_plugins):
    'Populates the plugin lists.'
    for file in find_plugins():
        try:
            module_name = os.path.splitext(os.path.basename(file))[0]
            module = importlib.import_module(((PLUGINS_DIR + '.') + module_name))
            for entry_name in dir(module):
                entry = getattr(module, entry_name)
                if ((not inspect.isclass(entry)) or (inspect.getmodule(entry) != module)):
                    continue
                if issubclass(entry, Hook):
                    hook_plugins.append(entry())
                elif issubclass(entry, Command):
                    command_plugins.append(entry())
        except (ImportError, NotImplementedError):
            continue
Populates the plugin lists.
def load_plugins(hook_plugins, command_plugins):
    
    for file in find_plugins():
        try:
            module_name = os.path.splitext(os.path.basename(file))[0]
            module = importlib.import_module(((PLUGINS_DIR + '.') + module_name))
            for entry_name in dir(module):
                entry = getattr(module, entry_name)
                if ((not inspect.isclass(entry)) or (inspect.getmodule(entry) != module)):
                    continue
                if issubclass(entry, Hook):
                    hook_plugins.append(entry())
                elif issubclass(entry, Command):
                    command_plugins.append(entry())
        except (ImportError, NotImplementedError):
            continue