From e198f2a1753a46dd51be65b1e07ab4113eed64a9 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Fri, 31 Mar 2023 14:09:43 +0200 Subject: [PATCH] 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`. --- platypush/context/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platypush/context/__init__.py b/platypush/context/__init__.py index c63738b8d..3c0cb1e62 100644 --- a/platypush/context/__init__.py +++ b/platypush/context/__init__.py @@ -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 {}