diff --git a/sccpy/__init__.py b/sccpy/__init__.py index 560f945..bb08bcf 100644 --- a/sccpy/__init__.py +++ b/sccpy/__init__.py @@ -1,4 +1,4 @@ from .core import getOrg, getOrgMembers, getUser -#from .modules import * +from .modules import * __all__ = ["getOrg", "getOrgMembers", "getUser"] diff --git a/sccpy/modules/__init__.py b/sccpy/modules/__init__.py new file mode 100644 index 0000000..2ba9d02 --- /dev/null +++ b/sccpy/modules/__init__.py @@ -0,0 +1,16 @@ +# modules/__init__.py + +# Importiere Untermodule dynamisch +import os +import importlib + +# Automatisch alle Python-Dateien im modules-Ordner als Untermodule laden +__all__ = [] +modules_dir = os.path.dirname(__file__) + +for filename in os.listdir(modules_dir): + if filename.endswith(".py") and filename != "__init__.py": + module_name = filename[:-3] + module = importlib.import_module(f"sccpy.modules.{module_name}") + globals()[module_name] = module + __all__.append(module_name) diff --git a/sccpy/modules/example.py b/sccpy/modules/example.py new file mode 100644 index 0000000..97e72cc --- /dev/null +++ b/sccpy/modules/example.py @@ -0,0 +1,8 @@ +# example.py + +def exampleFunction(): + """ + Example function in a module. + :return: A string message. + """ + return "This is an example function from a module."