Forking what is left of ZeroNet and hopefully adding an AT Proto Frontend/Proxy
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

PluginManager: get plugins path via import

* skip __pycache__ when loading

redfish 73814550 226f7dea

+6 -1
plugins/__init__.py

This is a binary file and will not be displayed.

+6 -1
src/Plugin/PluginManager.py
··· 7 7 8 8 from Debug import Debug 9 9 from Config import config 10 + 11 + import plugins 12 + 10 13 import importlib 11 14 12 15 13 16 class PluginManager: 14 17 def __init__(self): 15 18 self.log = logging.getLogger("PluginManager") 16 - self.plugin_path = "plugins" # Plugin directory 19 + self.plugin_path = os.path.abspath(os.path.dirname(plugins.__file__)) 17 20 self.plugins = defaultdict(list) # Registered plugins (key: class name, value: list of plugins for class) 18 21 self.subclass_order = {} # Record the load order of the plugins, to keep it after reload 19 22 self.pluggable = {} ··· 40 43 s = time.time() 41 44 for dir_name in sorted(os.listdir(self.plugin_path)): 42 45 dir_path = os.path.join(self.plugin_path, dir_name) 46 + if dir_name == "__pycache__": 47 + continue # skip 43 48 if dir_name.startswith("disabled"): 44 49 continue # Dont load if disabled 45 50 if not os.path.isdir(dir_path):