@@ -33,12 +33,18 @@ def load_plugin_from_file(self, filename):
33
33
config = Config (filename )
34
34
plugin_name = os .path .splitext (os .path .basename (filename ))[0 ]
35
35
info ('Sections: {}' .format (config .sections ()))
36
+ inherited_from = set ()
37
+ for section in config .sections ():
38
+ inherit = config .get (section , 'inherit' , None )
39
+ if inherit :
40
+ inherited_from .add (inherit )
36
41
for section in config .sections ():
37
42
try :
38
43
enabled = config .get (section , 'enabled' , 'true' ).lower () == 'true'
39
44
inherit = config .get (section , 'inherit' , None )
40
- if enabled :
45
+ if enabled or section in inherited_from :
41
46
plugin = {
47
+ 'enabled' : enabled ,
42
48
'filename' : filename ,
43
49
'section' : section ,
44
50
'channel' : config .get (section , 'channel' ),
@@ -94,6 +100,8 @@ def load_plugins(self):
94
100
for root , dirnames , filenames in os .walk (self .plugin_folder ):
95
101
for filename in fnmatch .filter (filenames , '*.plugin' ):
96
102
self .load_plugin_from_file (os .path .join (root , filename ))
103
+ #Remove any disabled plugins that were only loaded because they are inherited from.
104
+ self .plugins = {key :value for key , value in self .plugins .items () if value ['enabled' ]}
97
105
98
106
def get_plugin (self , filename , section ):
99
107
"""Return the plugin for the corresponding filename and section."""
0 commit comments