Skip to content

Commit

Permalink
Replace plugin name dashes by underscores
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
mripard authored and psss committed Apr 29, 2024
1 parent cf62044 commit 11c7d5c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions did/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,12 @@ def configured_plugins(self, config):
else:
items_created = True

# Some plugins (like public-inbox) need to have underscores
# in their names to follow python modules conventions, but
# it's more user-friendly to have dashes instead, so let's
# replace all the dashes by underscores.
type_ = type_.replace('-', '_')

if not type_:
msg = "Plugin type not defined in section '{0}'."
raise did.base.ConfigError(msg.format(section))
Expand Down

0 comments on commit 11c7d5c

Please sign in to comment.