mirror of
https://gitea.com/Lerking/XtendR.git
synced 2025-07-21 12:41:17 +02:00
#31 Done. /JL
This commit is contained in:
@@ -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)
|
||||
|
2
setup.py
2
setup.py
@@ -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",
|
||||
|
@@ -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}")
|
||||
|
Reference in New Issue
Block a user