Correction of a problem with wheel package.

This commit is contained in:
François Dausseur
2024-02-26 13:08:42 +01:00
parent 72906a6b7f
commit 4449d29a59
3 changed files with 17 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
#!/usr/bin/python3
import os
import sys
import traceback
from configparser import ConfigParser
import logging
@@ -204,6 +205,7 @@ class CommandsLoader:
def __init__(self, config: ConfigParser, log: logging.Handler, modpath: str):
self.config = config
self.modpath = modpath
sys.path.append(os.path.join(modpath))
Commands.defmod = self.config["general"].get("default")
precmd = self.config["general"].get("methods_prefix")
if not precmd is None:
@@ -242,7 +244,11 @@ class CommandsLoader:
self.cmods = cmds
def _load_module(self, name: str):
module = import_module(name)
try:
module = import_module(name)
except ModuleNotFoundError:
raise Exception(f"""The module "{name}" could not be loaded.""")
members = inspect.getmembers(module, inspect.isclass)
conf = None
if name[len(self.precmds):] in self.config.sections():