Merge pull request #5571 from ynput/bugfix/fix-warning-messages-about-overriden-init

Create Plugins: Better check of overriden '__init__' method
This commit is contained in:
Jakub Trllo 2023-09-05 18:16:43 +02:00 committed by GitHub
commit d851023836
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -214,8 +214,16 @@ class BaseCreator:
# Backwards compatibility for system settings
self.apply_settings(project_settings, system_settings)
init_overriden = self.__class__.__init__ is not BaseCreator.__init__
if init_overriden or expect_system_settings:
init_use_base = any(
self.__class__.__init__ is cls.__init__
for cls in {
BaseCreator,
Creator,
HiddenCreator,
AutoCreator,
}
)
if not init_use_base or expect_system_settings:
self.log.warning((
"WARNING: Source - Create plugin {}."
" System settings argument will not be passed to"