This commit is contained in:
2025-03-28 18:22:16 +01:00
parent 406c1b77ed
commit ebf31756b5
3 changed files with 6 additions and 4 deletions

View File

@@ -20,7 +20,9 @@ if __name__ == "__main__":
"""
system = XtendRSystem()
system.attach("example_plugin", my_callback) # Assuming 'example_plugin/plugin_info.json' exists
time.sleep(6)
for i in range(3):
print(f"Main program is running iteration {i+1}...")
time.sleep(2)
system.run("example_plugin", test="Hello!")
system.stop("example_plugin")
system.run("example_plugin", 25)

View File

@@ -3,7 +3,7 @@ if __name__ == "__main__":
setup(
name="XtendR",
version="0.3.0",
version="0.3.2",
packages=find_packages(),
install_requires=[],
author="Jan Lerking",

View File

@@ -5,7 +5,7 @@ import json
import threading
from xtendr.xtendrbase import XtendRBase
__version__ = "0.3.0"
__version__ = "0.3.2"
class XtendRSystem:
"""Plugin system to manage plugins.
@@ -69,7 +69,7 @@ class XtendRSystem:
}
print(f"Attached plugin '{name}'.")
print(f"Running pre-load on '{name}'.")
thread = threading.Thread(target=self.plugins[name].pre_load(), args=(callback,))
thread = threading.Thread(target=self.plugins[name]['instance'].pre_load, args=(callback,))
thread.start()
except (ModuleNotFoundError, json.JSONDecodeError, AttributeError) as e:
print(f"Failed to attach plugin '{name}': {e}")