Skip to content

Commit 11c7d5c

Browse files
mripardpsss
authored andcommitted
Replace plugin name dashes by underscores
Some plugins like public-inbox might use dashes in their name to be more user-friendly, but that will break python module loading system. Let's replace all the dashes in the plugin names by underscores. Signed-off-by: Maxime Ripard <[email protected]>
1 parent cf62044 commit 11c7d5c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

did/stats.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,12 @@ def configured_plugins(self, config):
213213
else:
214214
items_created = True
215215

216+
# Some plugins (like public-inbox) need to have underscores
217+
# in their names to follow python modules conventions, but
218+
# it's more user-friendly to have dashes instead, so let's
219+
# replace all the dashes by underscores.
220+
type_ = type_.replace('-', '_')
221+
216222
if not type_:
217223
msg = "Plugin type not defined in section '{0}'."
218224
raise did.base.ConfigError(msg.format(section))

0 commit comments

Comments
 (0)