# Path: plugin.py
# class Plugin:
# class PluginManager:
# class Documents:
#     def __init__(self):
#     def user(self):
#     def process(self, request):
#     def unload(self):
#     def __init__(self):
#     def load_plugin(self, name, reload=False):
#     def get_plugins(self):
#     def send_request(self, plugin, request):
#     def __init__(self, plugin: Plugin):
#     def set_document_type(self, name: str):
#     def set_document_table(self, table):
#     def get(self, pid):
#     def list(self, owner):
#     def create(self, pdoc: PluginDocument):
#     def update(pdoc: PluginDocument):
#     def delete(self, pdoc: PluginDocument):


from os import listdir, path
from plugin import Plugin, plugin_manager
"""This plugin can search other plugins, list them and auto-load some plugins."""




class Plugins(Plugin):
    auto_load_list_file = 'plugins/plugins/auto_load_list'

    def __init__(self):
        super().__init__()
        for p in self.auto_load_list:

# Path: plugin.py
# class Plugin:
# class PluginManager:
# class Documents:
#     def __init__(self):
#     def user(self):
#     def process(self, request):
#     def unload(self):
#     def __init__(self):
#     def load_plugin(self, name, reload=False):
#     def get_plugins(self):
#     def send_request(self, plugin, request):
#     def __init__(self, plugin: Plugin):
#     def set_document_type(self, name: str):
#     def set_document_table(self, table):
#     def get(self, pid):
#     def list(self, owner):
#     def create(self, pdoc: PluginDocument):
#     def update(pdoc: PluginDocument):
#     def delete(self, pdoc: PluginDocument):


# Path: plugins/plugins/plugins.py
from os import listdir, path
from plugin import Plugin, plugin_manager

"""This plugin can search other plugins, list them and auto-load some plugins."""




class Plugins(Plugin):
    auto_load_list_file = 'plugins/plugins/auto_load_list'

    def __init__(self):
        super().__init__()
        for p in self.auto_load_list:

            plugin_manager.load_plugin(p)