diff --git a/etg/_propgrid.py b/etg/_propgrid.py index 66ce1f5f..b8fc5e12 100644 --- a/etg/_propgrid.py +++ b/etg/_propgrid.py @@ -67,36 +67,6 @@ def run(): module.addInclude(INCLUDES) - # Deprecated aliases for the various helper classes in Classic - module.addPyCode("""\ - PyArrayStringProperty = wx.deprecated(ArrayStringProperty, "Use ArrayStringProperty instead.") - PyChoiceEditor = wx.deprecated(PGChoiceEditor, "Use PGChoiceEditor instead.") - PyColourProperty = wx.deprecated(ColourProperty, "Use ColourProperty instead.") - PyComboBoxEditor = wx.deprecated(PGComboBoxEditor, "Use PGComboBoxEditor instead.") - PyEditEnumProperty = wx.deprecated(EditEnumProperty, "Use PGEditEnumProperty instead.") - PyEditor = wx.deprecated(PGEditor, "Use PGEditor instead.") - PyEditorDialogAdapter = wx.deprecated(PGEditorDialogAdapter, "Use PGEditorDialogAdapter instead.") - PyEnumProperty = wx.deprecated(EnumProperty, "Use EnumProperty instead.") - PyFileDialogAdapter = wx.deprecated(PGFileDialogAdapter, "Use PGFileDialogAdapter instead.") - PyFileProperty = wx.deprecated(FileProperty, "Use FileProperty instead.") - PyFlagsProperty = wx.deprecated(FlagsProperty, "Use FlagsProperty instead.") - PyFloatProperty = wx.deprecated(FloatProperty, "Use FloatProperty instead.") - PyFontProperty = wx.deprecated(FontProperty, "Use FontProperty instead.") - PyIntProperty = wx.deprecated(IntProperty, "Use IntProperty instead.") - PyLongStringDialogAdapter = wx.deprecated(PGLongStringDialogAdapter, "Use PGLongStringDialogAdapter instead.") - PyLongStringProperty = wx.deprecated(LongStringProperty, "Use LongStringProperty instead.") - PyProperty = wx.deprecated(PGProperty, "Use PGProperty instead.") - PyStringProperty = wx.deprecated(StringProperty, "Use StringProperty instead.") - PySystemColourProperty = wx.deprecated(SystemColourProperty, "Use SystemColourProperty instead.") - PyTextCtrlEditor = wx.deprecated(PGTextCtrlEditor, "Use PGTextCtrlEditor instead.") - PyUIntProperty = wx.deprecated(UIntProperty, "Use UIntProperty instead.") - """) - - module.addPyFunction('RegisterEditor', '(editor, editorName)', - deprecated='Use PropertyGrid.DoRegisterEditor instead', - body='return PropertyGrid.DoRegisterEditorClass(editor, editorName)', - ) - #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) diff --git a/etg/propgridadvprops.py b/etg/propgridadvprops.py index c0ff20ae..5f5e3ae3 100644 --- a/etg/propgridadvprops.py +++ b/etg/propgridadvprops.py @@ -59,6 +59,38 @@ def run(): if hasattr(item, 'type') and 'wxVariant' in item.type: item.type = item.type.replace('wxVariant', 'wxPGVariant') + + # Deprecated aliases for the various helper classes in Classic + module.addPyCode("""\ + PyArrayStringProperty = wx.deprecated(ArrayStringProperty, "Use ArrayStringProperty instead.") + PyChoiceEditor = wx.deprecated(PGChoiceEditor, "Use PGChoiceEditor instead.") + PyColourProperty = wx.deprecated(ColourProperty, "Use ColourProperty instead.") + PyComboBoxEditor = wx.deprecated(PGComboBoxEditor, "Use PGComboBoxEditor instead.") + PyEditEnumProperty = wx.deprecated(EditEnumProperty, "Use PGEditEnumProperty instead.") + PyEditor = wx.deprecated(PGEditor, "Use PGEditor instead.") + PyEditorDialogAdapter = wx.deprecated(PGEditorDialogAdapter, "Use PGEditorDialogAdapter instead.") + PyEnumProperty = wx.deprecated(EnumProperty, "Use EnumProperty instead.") + PyFileDialogAdapter = wx.deprecated(PGFileDialogAdapter, "Use PGFileDialogAdapter instead.") + PyFileProperty = wx.deprecated(FileProperty, "Use FileProperty instead.") + PyFlagsProperty = wx.deprecated(FlagsProperty, "Use FlagsProperty instead.") + PyFloatProperty = wx.deprecated(FloatProperty, "Use FloatProperty instead.") + PyFontProperty = wx.deprecated(FontProperty, "Use FontProperty instead.") + PyIntProperty = wx.deprecated(IntProperty, "Use IntProperty instead.") + PyLongStringDialogAdapter = wx.deprecated(PGLongStringDialogAdapter, "Use PGLongStringDialogAdapter instead.") + PyLongStringProperty = wx.deprecated(LongStringProperty, "Use LongStringProperty instead.") + PyProperty = wx.deprecated(PGProperty, "Use PGProperty instead.") + PyStringProperty = wx.deprecated(StringProperty, "Use StringProperty instead.") + PySystemColourProperty = wx.deprecated(SystemColourProperty, "Use SystemColourProperty instead.") + PyTextCtrlEditor = wx.deprecated(PGTextCtrlEditor, "Use PGTextCtrlEditor instead.") + PyUIntProperty = wx.deprecated(UIntProperty, "Use UIntProperty instead.") + """) + + module.addPyFunction('RegisterEditor', '(editor, editorName)', + deprecated='Use PropertyGrid.DoRegisterEditor instead', + body='return PropertyGrid.DoRegisterEditorClass(editor, editorName)', + ) + + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) diff --git a/etg/propgridproperty.py b/etg/propgridproperty.py index 284e1f30..256d773d 100644 --- a/etg/propgridproperty.py +++ b/etg/propgridproperty.py @@ -44,6 +44,7 @@ def run(): c = module.find('wxPGCellData') assert isinstance(c, etgtools.ClassDef) c.find('~wxPGCellData').ignore(False) + c.bases = ['wxRefCounter'] c = module.find('wxPGCellRenderer') c.bases = ['wxRefCounter'] diff --git a/unittests/test_pi_import.py b/unittests/test_pi_import.py index a1c98a0d..30f04009 100644 --- a/unittests/test_pi_import.py +++ b/unittests/test_pi_import.py @@ -6,10 +6,10 @@ import wx class PIImportTest(unittest.TestCase): """ - The *.pi files generated are used with IDE's like WingIDE to create - things like autocomplete lists and call tips. They are essentially just - Python code with stubs for all the classes and other things that are in - the extension modules and that are not easily introspected. + The *.pyi files generated are used with some IDE's to create things like + autocomplete lists and call tips. They are essentially just Python code + with stubs for all the classes and other things that are in the extension + modules and that are not easily introspected. This test case ensures that the code in the pi files is valid by trying to run the file with a new instance of Python.