Replaced `.title` in `get_plugin` with `.upper` on the first character.

`str.title` capitalizes any alphabetic letter after any non-alphabetic
letter. That's a problem for Platypush plugins' naming convention,
because plugins like `sensor.distance.vl53l1x` may be broken into
`sensor.distance.vl53.l1.x`.
This commit is contained in:
Fabio Manganiello 2023-03-31 14:09:43 +02:00
parent c2f9ebf4ed
commit e198f2a175
1 changed files with 2 additions and 1 deletions

View File

@ -148,7 +148,8 @@ def get_plugin(plugin, plugin_name=None, reload=False):
# e.g. plugins.music.mpd main class: MusicMpdPlugin
cls_name = ''
for token in name.split('.'):
cls_name += token.title()
if token:
cls_name += token[0].upper() + token[1:]
cls_name += 'Plugin'
plugin_conf = Config.get_plugins()[name] if name in Config.get_plugins() else {}