mirror of
https://gitea.com/Lerking/XtendR.git
synced 2025-07-21 12:41:17 +02:00
0.1.2 #26 Added possibility to choose your own plugins folder. /JL
This commit is contained in:
2
setup.py
2
setup.py
@@ -3,7 +3,7 @@ if __name__ == "__main__":
|
||||
|
||||
setup(
|
||||
name="XtendR",
|
||||
version="0.1.1",
|
||||
version="0.1.2",
|
||||
packages=find_packages(),
|
||||
install_requires=[],
|
||||
author="Jan Lerking",
|
||||
|
@@ -4,7 +4,7 @@ import os
|
||||
import json
|
||||
from xtendr.xtendrbase import XtendRBase
|
||||
|
||||
__version__ = "0.1.1"
|
||||
__version__ = "0.1.2"
|
||||
|
||||
class XtendRSystem:
|
||||
"""Plugin system to manage plugins.
|
||||
@@ -12,7 +12,7 @@ class XtendRSystem:
|
||||
Example:
|
||||
>>> system = XtendRSystem()
|
||||
>>> system.version()
|
||||
XtendR v0.1.1
|
||||
XtendR v0.1.2
|
||||
>>> system.attach("example_plugin") # Assuming 'example_plugin/example_plugin.json' exists
|
||||
>>> system.run("example_plugin")
|
||||
ExamplePlugin is running!
|
||||
@@ -21,7 +21,8 @@ class XtendRSystem:
|
||||
>>> system.detach("example_plugin")
|
||||
Detached plugin 'example_plugin'.
|
||||
"""
|
||||
def __init__(self):
|
||||
def __init__(self, pluginpath = "plugins"):
|
||||
self.pluginspath = pluginpath
|
||||
self.plugins = {}
|
||||
|
||||
def version(self) -> str:
|
||||
@@ -33,7 +34,7 @@ class XtendRSystem:
|
||||
print(f"Plugin '{name}' is already attached.")
|
||||
return
|
||||
|
||||
plugin_path = os.path.join(os.getcwd(), "plugins", name)
|
||||
plugin_path = os.path.join(os.getcwd(), self.pluginpath, name)
|
||||
info_path = os.path.join(plugin_path, name + ".json")
|
||||
print(plugin_path + "\n" + info_path)
|
||||
|
||||
|
Reference in New Issue
Block a user