Fixed handling of multiple base classes

This commit is contained in:
Sven Heidemann 2022-01-18 19:19:01 +01:00
parent f41e31371f
commit e5b3e80378

View File

@ -36,24 +36,20 @@ class ImplementationScannerService(ImplementationScannerABC):
subclasses = classes.where(lambda c: c.name == sub_name)
implementations = List(ClassImplementation)
for sub in subclasses:
# sub: Optional[PythonClass] = classes.where(lambda c: c.name == sub_name).first_or_default()
# if sub is None:
# return None
line = line.replace(' ', '')
base_name = line.split('(')[1].split(')')[0]
if ',' in base_name:
for name in base_name.split(','):
if '=' in name:
continue
if ',' not in base_name:
implementation = self._get_implementation(base_name, sub, classes)
if implementation is not None:
implementations.append(implementation)
continue
implementation = self._get_implementation(name, sub, classes)
if implementation is not None:
implementations.append(implementation)
# return implementations
# return self._get_implementation(base_name, sub, classes)
implementation = self._get_implementation(base_name, sub, classes)
if implementation is not None:
implementations.append(implementation)
for name in base_name.split(','):
if '=' in name:
continue
implementation = self._get_implementation(name, sub, classes)
if implementation is not None:
implementations.append(implementation)
return implementations
return None