modul example
This commit is contained in:
parent
90e0cf3d94
commit
f0a7fd9ed6
@ -1,4 +1,4 @@
|
|||||||
from .core import getOrg, getOrgMembers, getUser
|
from .core import getOrg, getOrgMembers, getUser
|
||||||
#from .modules import *
|
from .modules import *
|
||||||
|
|
||||||
__all__ = ["getOrg", "getOrgMembers", "getUser"]
|
__all__ = ["getOrg", "getOrgMembers", "getUser"]
|
||||||
|
|||||||
16
sccpy/modules/__init__.py
Normal file
16
sccpy/modules/__init__.py
Normal file
@ -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)
|
||||||
8
sccpy/modules/example.py
Normal file
8
sccpy/modules/example.py
Normal file
@ -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."
|
||||||
Loading…
Reference in New Issue
Block a user