mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-08 04:50:07 +01:00
Fixup: using incorrect method names in some cases where they have been renamed
This commit is contained in:
@@ -538,8 +538,10 @@ class FunctionDef(BaseDef, FixWxPrefix):
|
||||
if getattr(self, 'isCtor', False):
|
||||
name = '__init__'
|
||||
else:
|
||||
name = self.name or self.pyName
|
||||
name = self.pyName or self.name
|
||||
name = self.fixWxPrefix(name)
|
||||
if 'Destroy' in (name, self.name, self.pyName):
|
||||
print(f'Generating signature for: {name}, {self.name}, {self.pyName}')
|
||||
# __bool__ and __nonzero__ need to be defined as returning int for SIP, but for Python
|
||||
# __bool__ is required to return a bool:
|
||||
if name in ('__bool__', '__nonzero__'):
|
||||
@@ -727,7 +729,7 @@ class ClassDef(BaseDef):
|
||||
@convertFromPyObject.setter
|
||||
def convertFromPyObject(self, value: AutoConversionInfo) -> None:
|
||||
self._convertFromPyObject = value.code
|
||||
name = self.name or self.pyName
|
||||
name = self.pyName or self.name
|
||||
name = removeWxPrefix(name)
|
||||
FixWxPrefix.register_autoconversion(name, value.convertables)
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ magicMethods = {
|
||||
|
||||
|
||||
class AutoConversionInfo(NamedTuple):
|
||||
convertables: tuple[str, ...] # String type-hints for each of the types that can be automatically converted to this class
|
||||
convertables: Tuple[str, ...] # String type-hints for each of the types that can be automatically converted to this class
|
||||
code: str # Code that will be added to SIP for this conversion
|
||||
|
||||
|
||||
@@ -254,10 +254,10 @@ class FixWxPrefix(object):
|
||||
"""
|
||||
|
||||
_coreTopLevelNames = None
|
||||
_auto_conversions: dict[str, tuple[str, ...]] = {}
|
||||
_auto_conversions: dict[str, Tuple[str, ...]] = {}
|
||||
|
||||
@classmethod
|
||||
def register_autoconversion(cls, class_name: str, convertables: tuple[str, ...]) -> None:
|
||||
def register_autoconversion(cls, class_name: str, convertables: Tuple[str, ...]) -> None:
|
||||
cls._auto_conversions[class_name] = convertables
|
||||
|
||||
def fixWxPrefix(self, name, checkIsCore=False):
|
||||
|
||||
Reference in New Issue
Block a user