File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 16
16
class PluginManager :
17
17
def __init__ (self ):
18
18
self .log = logging .getLogger ("PluginManager" )
19
- self .path_plugins = os .path .abspath (os .path .dirname (plugins .__file__ ))
19
+ self .path_plugins = None
20
+ if plugins .__file__ :
21
+ self .path_plugins = os .path .dirname (os .path .abspath (plugins .__file__ ));
20
22
self .path_installed_plugins = config .data_dir + "/__plugins__"
21
23
self .plugins = defaultdict (list ) # Registered plugins (key: class name, value: list of plugins for class)
22
24
self .subclass_order = {} # Record the load order of the plugins, to keep it after reload
@@ -32,7 +34,8 @@ def __init__(self):
32
34
33
35
self .config .setdefault ("builtin" , {})
34
36
35
- sys .path .append (os .path .join (os .getcwd (), self .path_plugins ))
37
+ if self .path_plugins :
38
+ sys .path .append (os .path .join (os .getcwd (), self .path_plugins ))
36
39
self .migratePlugins ()
37
40
38
41
if config .debug : # Auto reload Plugins on file change
@@ -127,6 +130,8 @@ def listInstalledPlugins(self, list_disabled=False):
127
130
def loadPlugins (self ):
128
131
all_loaded = True
129
132
s = time .time ()
133
+ if self .path_plugins is None :
134
+ return
130
135
for plugin in self .listPlugins ():
131
136
self .log .debug ("Loading plugin: %s (%s)" % (plugin ["name" ], plugin ["source" ]))
132
137
if plugin ["source" ] != "builtin" :
You can’t perform that action at this time.
0 commit comments