Tweak the deprecation warnings

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@72018 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2012-07-11 05:02:43 +00:00
parent c41a402a98
commit 9d79e123fa
27 changed files with 71 additions and 71 deletions

View File

@@ -473,7 +473,7 @@ def run():
module.addPyClass('PySimpleApp', ['App'], deprecated="Use wx.App.",
module.addPyClass('PySimpleApp', ['App'], deprecated="Use wx.App instead.",
doc="""This class is deprecated. Please use wx.App instead.""",
items=[
PyFunctionDef('__init__', '(self, *args, **kw)',

View File

@@ -233,7 +233,7 @@ def run():
""")
module.addPyFunction('BitmapFromBuffer', '(width, height, dataBuffer, alphaBuffer=None)',
deprecated="Use Bitmap.FromBuffer or Bitmap.FromBufferAndAlpha.",
deprecated="Use Bitmap.FromBuffer or Bitmap.FromBufferAndAlpha instead.",
doc='A compatibility wrapper for Bitmap.FromBuffer and Bitmap.FromBufferAndAlpha',
body="""\
if alphaBuffer is not None:
@@ -275,7 +275,7 @@ def run():
""")
module.addPyFunction('BitmapFromBufferRGBA', '(width, height, dataBuffer)',
deprecated="Use Bitmap.FromBufferRGBA.",
deprecated="Use Bitmap.FromBufferRGBA instead.",
doc='A compatibility wrapper for Bitmap.FromBufferRGBA',
body='return Bitmap.FromBufferRGBA(width, height, dataBuffer)')
@@ -320,7 +320,7 @@ def run():
""")
module.addPyFunction('EmptyBitmapRGBA', '(width, height, red=0, green=0, blue=0, alpha=0)',
deprecated="Use Bitmap.FromRGBA.",
deprecated="Use Bitmap.FromRGBA instead.",
doc='A compatibility wrapper for Bitmap.FromRGBA',
body='return Bitmap.FromRGBA(width, height, red, green, blue, alpha)')

View File

@@ -64,9 +64,9 @@ def run():
c.find('SetAttr.attr').transfer = True
c.addPyCode("""\
{name}.PyGetDate = wx.deprecated({name}.GetDate, 'Use GetDate.')
{name}.PySetDate = wx.deprecated({name}.SetDate, 'Use SetDate.')
{name}.PySetDateRange = wx.deprecated({name}.SetDateRange, 'Use SetDateRange.')
{name}.PyGetDate = wx.deprecated({name}.GetDate, 'Use GetDate instead.')
{name}.PySetDate = wx.deprecated({name}.SetDate, 'Use SetDate instead.')
{name}.PySetDateRange = wx.deprecated({name}.SetDateRange, 'Use SetDateRange instead.')
""".format(name=c.name[2:]))
cc.find('EnableYearChange').ignore()

View File

@@ -270,7 +270,7 @@ def run():
return 0; // not a new instance
"""
module.addPyCode('NamedColour = wx.deprecated(Colour, "Use Colour.")')
module.addPyCode('NamedColour = wx.deprecated(Colour, "Use Colour instead.")')
# Just for TESTING, remove it later

View File

@@ -36,7 +36,7 @@ def run():
tools.fixWindowClass(c)
module.addPyCode("PyControl = wx.deprecated(Control, 'Use Control.')")
module.addPyCode("PyControl = wx.deprecated(Control, 'Use Control instead.')")
#-----------------------------------------------------------------
tools.doCommonTweaks(module)

View File

@@ -77,8 +77,8 @@ def run():
module.addPyCode(pycode)
# former renamed constructors
module.addPyCode('StockCursor = wx.deprecated(Cursor, "Use Cursor instead")')
module.addPyCode('CursorFromImage = wx.deprecated(Cursor, "Use Cursor instead")')
module.addPyCode('StockCursor = wx.deprecated(Cursor, "Use Cursor instead.")')
module.addPyCode('CursorFromImage = wx.deprecated(Cursor, "Use Cursor instead.")')
#-----------------------------------------------------------------
tools.doCommonTweaks(module)

View File

@@ -356,9 +356,9 @@ def run():
#------------------------------------------------------------
module.addPyCode("PyDataObjectSimple = wx.deprecated(DataObjectSimple), 'Use DataObjectSimple.'")
module.addPyCode("PyTextDataObject = wx.deprecated(TextDataObject, 'Use TextDataObject.')")
module.addPyCode("PyBitmapDataObject = wx.deprecated(BitmapDataObject, 'Use TextDataObject.')")
module.addPyCode("PyDataObjectSimple = wx.deprecated(DataObjectSimple), 'Use DataObjectSimple instead.'")
module.addPyCode("PyTextDataObject = wx.deprecated(TextDataObject, 'Use TextDataObject instead.')")
module.addPyCode("PyBitmapDataObject = wx.deprecated(BitmapDataObject, 'Use TextDataObject instead.')")
#-----------------------------------------------------------------
tools.doCommonTweaks(module)

View File

@@ -43,8 +43,8 @@ def run():
""")
c.addPyCode("""\
DateEvent.PyGetDate = wx.deprecated(DateEvent.GetDate, 'Use GetDate.')
DateEvent.PySetDate = wx.deprecated(DateEvent.SetDate, 'Use GetDate.')
DateEvent.PyGetDate = wx.deprecated(DateEvent.GetDate, 'Use GetDate instead.')
DateEvent.PySetDate = wx.deprecated(DateEvent.SetDate, 'Use SetDate instead.')
""")
#-----------------------------------------------------------------

View File

@@ -118,7 +118,7 @@ def run():
self->DrawLabel(*text, *bitmap, *rect, alignment, indexAccel, &rv);
return new wxRect(rv);
""")
c.addPyCode('DC.DrawImageLabel = wx.deprecated(DC.DrawLabel, "Use DrawLabel.")')
c.addPyCode('DC.DrawImageLabel = wx.deprecated(DC.DrawLabel, "Use DrawLabel instead.")')
# Return the array instead of using an output parameter
m = c.find('GetPartialTextExtents')

View File

@@ -79,7 +79,7 @@ def run():
c.find('wxDropTarget.data').transfer = True
c.find('SetDataObject.data').transfer = True
module.addPyCode("PyDropTarget = wx.deprecated(DropTarget, 'Use DropTarget.')")
module.addPyCode("PyDropTarget = wx.deprecated(DropTarget, 'Use DropTarget instead.')")

View File

@@ -296,7 +296,7 @@ def run():
return event.Unbind(self, id, id2, handler)
""")
module.addPyCode('PyEvtHandler = wx.deprecated(EvtHandler, "Use EvtHandler.")')
module.addPyCode('PyEvtHandler = wx.deprecated(EvtHandler, "Use EvtHandler instead.")')
#---------------------------------------

View File

@@ -73,7 +73,7 @@ def run():
"""))
module.addPyCode("""\
@wx.deprecatedMsg('Use GUIEventLoop.')
@wx.deprecatedMsg('Use GUIEventLoop instead.')
class EventLoop(GUIEventLoop):
'''Class using the old name for compatibility.'''
def __init__(self):

View File

@@ -55,7 +55,7 @@ def run():
c = module.find('wxArchiveFSHandler')
c.addPrivateCopyCtor();
module.addPyCode('ZipFSHandler = wx.deprecated(ArchiveFSHandler, "Use ArchiveFSHandler.")')
module.addPyCode('ZipFSHandler = wx.deprecated(ArchiveFSHandler, "Use ArchiveFSHandler instead.")')
c = module.find('wxFSFile')
c.addPrivateCopyCtor();

View File

@@ -102,7 +102,7 @@ def run():
return sipBuildResult(0, "(dd)", width, height);
""")
c.addPyCode("GraphicsContext.DrawRotatedText = wx.deprecated(GraphicsContext.DrawText, 'Use DrawText.')")
c.addPyCode("GraphicsContext.DrawRotatedText = wx.deprecated(GraphicsContext.DrawText, 'Use DrawText instead.')")
c.addCppCode(tools.ObjArrayHelperTemplate('wxPoint2D', 'sipType_wxPoint2DDouble',

View File

@@ -483,22 +483,22 @@ def run():
# For compatibility:
module.addPyFunction('EmptyImage', '(width=0, height=0, clear=True)',
deprecated="Use wx.Image.",
deprecated="Use wx.Image instead.",
doc='A compatibility wrapper for the wx.Image(width, height) constructor',
body='return Image(width, height, clear)')
module.addPyFunction('ImageFromBitmap', '(bitmap)',
deprecated="Use wx.Image.",
deprecated="Use wx.Image instead.",
doc='Create a wx.Image from a wx.Bitmap',
body='return bitmap.ConvertToImage()')
module.addPyFunction('ImageFromData', '(width, height, data)',
deprecated="Use wx.Image.",
deprecated="Use wx.Image instead.",
doc='Compatibility wrapper for creating an image from RGB data',
body='return Image(width, height, data)')
module.addPyFunction('ImageFromDataWithAlpha', '(width, height, data, alpha)',
deprecated="Use wx.Image.",
deprecated="Use wx.Image instead.",
doc='Compatibility wrapper for creating an image from RGB and Alpha data',
body='return Image(width, height, data, alpha)')

View File

@@ -43,10 +43,10 @@ def run():
c.addPyCode("""\
# For 2.8 compatibility
KeyboardState.m_controlDown = wx.deprecated(KeyboardState.controlDown, "Use controlDown.")
KeyboardState.m_shiftDown = wx.deprecated(KeyboardState.shiftDown, "Use shiftDown.")
KeyboardState.m_altDown = wx.deprecated(KeyboardState.altDown, "Use altDown.")
KeyboardState.m_metaDown = wx.deprecated(KeyboardState.metaDown, "Use metaDown.")
KeyboardState.m_controlDown = wx.deprecated(KeyboardState.controlDown, "Use controlDown instead.")
KeyboardState.m_shiftDown = wx.deprecated(KeyboardState.shiftDown, "Use shiftDown instead.")
KeyboardState.m_altDown = wx.deprecated(KeyboardState.altDown, "Use altDown instead.")
KeyboardState.m_metaDown = wx.deprecated(KeyboardState.metaDown, "Use metaDown instead.")
""")
#-----------------------------------------------------------------

View File

@@ -183,12 +183,12 @@ def run():
# Some deprecated aliases for Classic renames
c.addPyCode('ListCtrl.FindItemData = wx.deprecated(ListCtrl.FindItem, "Use FindItem.")')
c.addPyCode('ListCtrl.FindItemAtPos = wx.deprecated(ListCtrl.FindItem, "Use FindItem.")')
c.addPyCode('ListCtrl.InsertStringItem = wx.deprecated(ListCtrl.InsertItem, "Use InsertItem.")')
c.addPyCode('ListCtrl.InsertImageItem = wx.deprecated(ListCtrl.InsertItem, "Use InsertItem.")')
c.addPyCode('ListCtrl.InsertImageStringItem = wx.deprecated(ListCtrl.InsertItem, "Use InsertItem.")')
c.addPyCode('ListCtrl.SetStringItem = wx.deprecated(ListCtrl.SetItem, "Use SetItem.")')
c.addPyCode('ListCtrl.FindItemData = wx.deprecated(ListCtrl.FindItem, "Use FindItem instead.")')
c.addPyCode('ListCtrl.FindItemAtPos = wx.deprecated(ListCtrl.FindItem, "Use FindItem instead.")')
c.addPyCode('ListCtrl.InsertStringItem = wx.deprecated(ListCtrl.InsertItem, "Use InsertItem instead.")')
c.addPyCode('ListCtrl.InsertImageItem = wx.deprecated(ListCtrl.InsertItem, "Use InsertItem instead.")')
c.addPyCode('ListCtrl.InsertImageStringItem = wx.deprecated(ListCtrl.InsertItem, "Use InsertItem instead.")')
c.addPyCode('ListCtrl.SetStringItem = wx.deprecated(ListCtrl.SetItem, "Use SetItem instead.")')
# Provide a way to determine if column ordering is possble

View File

@@ -50,19 +50,19 @@ def run():
c.find('AppendSubMenu.submenu').transfer = True
c.find('GetMenuItems').ignore() # keep the overload, but not the first one.
c.addPyMethod('AppendMenu', '(self, id, item, subMenu, help="")', deprecated='Use Append.',
c.addPyMethod('AppendMenu', '(self, id, item, subMenu, help="")', deprecated='Use Append instead.',
body='return self.Append(id, item, subMenu, help)')
c.addPyMethod('AppendItem', '(self, menuItem)', deprecated='Use Append.',
c.addPyMethod('AppendItem', '(self, menuItem)', deprecated='Use Append instead.',
body='return self.Append(menuItem)')
c.addPyMethod('InsertMenu', '(self, pos, id, item, subMenu, help="")', deprecated='Use Insert.',
c.addPyMethod('InsertMenu', '(self, pos, id, item, subMenu, help="")', deprecated='Use Insert instead.',
body='return self.Insert(pos, id, item, subMenu, help)')
c.addPyMethod('InsertItem', '(self, pos, menuItem)', deprecated='Use Insert.',
c.addPyMethod('InsertItem', '(self, pos, menuItem)', deprecated='Use Insert instead.',
body='return self.Insert(pos, menuItem)')
c.addPyMethod('PrependMenu', '(self, id, item, subMenu, help="")', deprecated='Use Prepend.',
c.addPyMethod('PrependMenu', '(self, id, item, subMenu, help="")', deprecated='Use Prepend instead.',
body='return self.Prepend(id, item, subMenu, help)')
c.addPyMethod('PrependItem', '(self, menuItem)', deprecated='Use Prepend.',
c.addPyMethod('PrependItem', '(self, menuItem)', deprecated='Use Prepend instead.',
body='return self.Prepend(menuItem)')
# Don't hide the Destroy inherited from wxObject

View File

@@ -35,7 +35,7 @@ def run():
c.find('OnSysColourChanged').ignore()
tools.fixWindowClass(c)
module.addPyCode("PyPanel = wx.deprecated(Panel, 'Use Panel.')")
module.addPyCode("PyPanel = wx.deprecated(Panel, 'Use Panel instead.')")
#-----------------------------------------------------------------
tools.doCommonTweaks(module)

View File

@@ -73,7 +73,7 @@ def run():
c.addCppMethod('int', '__nonzero__', '()', """\
return self->IsOk();
""")
c.addPyCode("PrintPreview.Ok = wx.deprecated(PrintPreview.IsOk, 'Use IsOk.')")
c.addPyCode("PrintPreview.Ok = wx.deprecated(PrintPreview.IsOk, 'Use IsOk instead.')")
c = module.find('wxPrinter')
c.addPrivateCopyCtor()
@@ -98,10 +98,10 @@ def run():
# deprecated classes
module.addPyCode("PyPrintPreview = wx.deprecated(PrintPreview, 'Use PrintPreview.')")
module.addPyCode("PyPreviewFrame = wx.deprecated(PreviewFrame, 'Use PreviewFrame.')")
module.addPyCode("PyPreviewControlBar = wx.deprecated(PreviewControlBar, 'Use PreviewControlBar.')")
module.addPyCode("PyPrintout = wx.deprecated(Printout, 'Use Printout.')")
module.addPyCode("PyPrintPreview = wx.deprecated(PrintPreview, 'Use PrintPreview instead.')")
module.addPyCode("PyPreviewFrame = wx.deprecated(PreviewFrame, 'Use PreviewFrame instead.')")
module.addPyCode("PyPreviewControlBar = wx.deprecated(PreviewControlBar, 'Use PreviewControlBar instead.')")
module.addPyCode("PyPrintout = wx.deprecated(Printout, 'Use Printout instead.')")
#-----------------------------------------------------------------
tools.doCommonTweaks(module)

View File

@@ -146,7 +146,7 @@ def run():
scrolled.ignore()
module.addPyCode("PyScrolledWindow = wx.deprecated(ScrolledWindow, 'Use ScrolledWindow.')")
module.addPyCode("PyScrolledWindow = wx.deprecated(ScrolledWindow, 'Use ScrolledWindow instead.')")
#-----------------------------------------------------------------
tools.doCommonTweaks(module)

View File

@@ -190,7 +190,7 @@ def run():
module.addPyCode("PySizer = wx.deprecated(Sizer, 'Use Sizer.')")
module.addPyCode("PySizer = wx.deprecated(Sizer, 'Use Sizer instead.')")
module.addItem(tools.wxListWrapperTemplate('wxSizerItemList', 'wxSizerItem', module))

View File

@@ -81,7 +81,7 @@ def run():
# TODO: Which others are commonly enough used that they should be here too?
c.addPyMethod('AddSimpleTool', '(self, toolId, bitmap, shortHelpString="", longHelpString="", isToggle=0)',
doc='Old style method to add a tool to the toolbar.',
deprecated='Use AddTool.',
deprecated='Use AddTool instead.',
body="""\
kind = wx.ITEM_NORMAL
if isToggle: kind = wx.ITEM_CHECK
@@ -92,7 +92,7 @@ def run():
'(self, id, label, bitmap, bmpDisabled=wx.NullBitmap, kind=wx.ITEM_NORMAL,'
' shortHelp="", longHelp="", clientData=None)',
doc='Old style method to add a tool in the toolbar.',
deprecated='Use AddTool.',
deprecated='Use AddTool instead.',
body="""\
return self.AddTool(id, label, bitmap, bmpDisabled, kind,
shortHelp, longHelp, clientData)
@@ -100,7 +100,7 @@ def run():
c.addPyMethod('InsertSimpleTool', '(self, pos, toolId, bitmap, shortHelpString="", longHelpString="", isToggle=0)',
doc='Old style method to insert a tool in the toolbar.',
deprecated='Use InsertTool.',
deprecated='Use InsertTool instead.',
body="""\
kind = wx.ITEM_NORMAL
if isToggle: kind = wx.ITEM_CHECK
@@ -111,7 +111,7 @@ def run():
'(self, pos, id, label, bitmap, bmpDisabled=wx.NullBitmap, kind=wx.ITEM_NORMAL,'
' shortHelp="", longHelp="", clientData=None)',
doc='Old style method to insert a tool in the toolbar.',
deprecated='Use InsertTool.',
deprecated='Use InsertTool instead.',
body="""\
return self.InsertTool(pos, id, label, bitmap, bmpDisabled, kind,
shortHelp, longHelp, clientData)

View File

@@ -59,8 +59,8 @@ def run():
item.transfer = True
c.addPyCode("""\
TreeCtrl.GetItemPyData = wx.deprecated(TreeCtrl.GetItemData, 'Use GetItemData.')
TreeCtrl.SetItemPyData = wx.deprecated(TreeCtrl.SetItemData, 'Use SetItemData.')
TreeCtrl.GetItemPyData = wx.deprecated(TreeCtrl.GetItemData, 'Use GetItemData instead.')
TreeCtrl.SetItemPyData = wx.deprecated(TreeCtrl.SetItemData, 'Use SetItemData instead.')
""")

View File

@@ -34,7 +34,7 @@ def run():
assert isinstance(c, etgtools.ClassDef)
c.find('Clone').factory = True
module.addPyCode("PyValidator = wx.deprecated(Validator, 'Use Validator.')")
module.addPyCode("PyValidator = wx.deprecated(Validator, 'Use Validator instead.')")
#-----------------------------------------------------------------
tools.doCommonTweaks(module)

View File

@@ -132,7 +132,7 @@ def run():
body="""\
self->SetSize(x, y, width, height, sizeFlags);
""")
c.addPyCode("Window.SetDimensions = wx.deprecated(Window.SetDimensions, 'Use SetSize.')")
c.addPyCode("Window.SetDimensions = wx.deprecated(Window.SetDimensions, 'Use SetSize instead.')")
# Make the Register/UnregisterHotKey functions be available on Windows,
# and empty stubs otherwise
@@ -254,14 +254,14 @@ def run():
tools.addSipConvertToSubClassCode(c)
# for compatibility with Classic
c.addPyMethod('GetPositionTuple', '(self)', 'return self.GetPosition()', deprecated='Use GetPosition')
c.addPyMethod('MoveXY', '(self, x, y)', 'return self.Move(x, y)', deprecated='Use Move.')
c.addPyMethod('SetSizeWH', '(self, w, h)', 'return self.SetSize(w,h)', deprecated='Use SetSize.')
c.addPyMethod('SetVirtualSizeWH', '(self, w, h)', 'return self.SetVirtualSize(w,h)', deprecated='Use SetVirtualSize.')
c.addPyMethod('GetVirtualSizeTuple', '(self)', 'return self.GetVirtualSize()', deprecated='Use GetVirtualSize.')
c.addPyMethod('SetToolTipString', '(self, string)', 'return self.SetToolTip(string)', deprecated='Use SetToolTip')
c.addPyMethod('ConvertDialogPointToPixels', '(self, point)', 'return self.ConvertDialogToPixels(point)', deprecated='Use ConvertDialogToPixels.')
c.addPyMethod('ConvertDialogSizeToPixels', '(self, size)', 'return self.ConvertDialogToPixels(point)', deprecated='Use ConvertDialogToPixels.')
c.addPyMethod('GetPositionTuple', '(self)', 'return self.GetPosition()', deprecated='Use GetPosition instead')
c.addPyMethod('MoveXY', '(self, x, y)', 'return self.Move(x, y)', deprecated='Use Move instead.')
c.addPyMethod('SetSizeWH', '(self, w, h)', 'return self.SetSize(w,h)', deprecated='Use SetSize instead.')
c.addPyMethod('SetVirtualSizeWH', '(self, w, h)', 'return self.SetVirtualSize(w,h)', deprecated='Use SetVirtualSize instead.')
c.addPyMethod('GetVirtualSizeTuple', '(self)', 'return self.GetVirtualSize()', deprecated='Use GetVirtualSize instead.')
c.addPyMethod('SetToolTipString', '(self, string)', 'return self.SetToolTip(string)', deprecated='Use SetToolTip instead.')
c.addPyMethod('ConvertDialogPointToPixels', '(self, point)', 'return self.ConvertDialogToPixels(point)', deprecated='Use ConvertDialogToPixels instead.')
c.addPyMethod('ConvertDialogSizeToPixels', '(self, size)', 'return self.ConvertDialogToPixels(point)', deprecated='Use ConvertDialogToPixels instead.')
#-----------------------------------------------------------------------
# Other stuff
@@ -291,7 +291,7 @@ def run():
briefDoc="Returns a list-like object of the the application's top-level windows, (frames,dialogs, etc.)",
body="return &wxTopLevelWindows;")
module.addPyCode("PyWindow = wx.deprecated(Window, 'Use Window.')")
module.addPyCode("PyWindow = wx.deprecated(Window, 'Use Window instead.')")
#-----------------------------------------------------------------
tools.doCommonTweaks(module)

View File

@@ -115,19 +115,19 @@ def run():
module.addPyFunction('DateTimeFromTimeT', '(timet)',
doc="Compatibility wrapper for DateTime.FromTimeT",
body="return DateTime.FromTimeT(timet)",
deprecated='Use DateTime.FromTimeT.')
deprecated='Use DateTime.FromTimeT instead.')
module.addPyFunction('DateTimeFromJDN', '(jdn)',
doc="Compatibility wrapper for DateTime.FromJDN",
body="return DateTime.FromJDN(jdn)",
deprecated='Use DateTime.FromJDN')
deprecated='Use DateTime.FromJDN instead.')
module.addPyFunction('DateTimeFromHMS', '(hour, minute=0, second=0, millisecond=0)',
doc="Compatibility wrapper for DateTime.FromHMS",
body="return DateTime.FromHMS(hour, minute, second, millisecond)",
deprecated='DateTime.FromHMS')
deprecated='DateTime.FromHMS instead.')
module.addPyFunction('DateTimeFromDMY', '(day, month, year=DateTime.Inv_Year, hour=0, minute=0, second=0, millisecond=0)',
doc="Compatibility wrapper for DateTime.FromDMY",
body="return DateTime.FromDMY(day, month, year, hour, minute, second, millisecond)",
deprecated='Use DateTime.FromDMY')
deprecated='Use DateTime.FromDMY instead.')
# Fixup similar conflicts in the Set method overloads