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

1
VERSION Normal file
View File

@@ -0,0 +1 @@
0.1

View File

@@ -1,6 +1,9 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "pyappengine"
version = "0.1"
authors = [
{ name="François Dausseur", email="fdausseur@free.fr" },
]
@@ -15,5 +18,10 @@ classifiers = [
dependencies = [
"systemd-python",
]
dynamic = ["version"]
[project.urls]
"Homepage" = "https://git.beafrancois.fr/Foue/pyappengine"
[tool.setuptools.dynamic]
version = {file = ["VERSION"]}

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():