mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-07 04:20:07 +01:00
Fix for list.sort requiring keywords in python3.5
Python3.5 changed the parameters in list.sort to be keyword only arguments. This fixes all the instances I could find.
This commit is contained in:
@@ -766,7 +766,7 @@ class RibbonBar(RibbonControl):
|
||||
# Sneaky obj array trickery to not copy the tab descriptors
|
||||
sorted_pages.append(info)
|
||||
|
||||
sorted_pages.sort(self.OrderPageTabInfoBySmallWidthAsc)
|
||||
sorted_pages.sort(key=self.OrderPageTabInfoBySmallWidthAsc)
|
||||
width -= tabsep*(numtabs - 1)
|
||||
|
||||
for i, info in enumerate(self._pages):
|
||||
|
||||
@@ -10406,7 +10406,7 @@ class UltimateListMainWindow(wx.ScrolledWindow):
|
||||
else:
|
||||
self.__func = func
|
||||
|
||||
self._lines.sort(self.OnCompareItems)
|
||||
self._lines.sort(key=self.OnCompareItems)
|
||||
|
||||
if self.IsShownOnScreen():
|
||||
self._dirty = True
|
||||
|
||||
@@ -2219,7 +2219,7 @@ class DocManager(wx.EvtHandler):
|
||||
if sort:
|
||||
def tempcmp(a, b):
|
||||
return cmp(a.GetDescription(), b.GetDescription())
|
||||
templates.sort(tempcmp)
|
||||
templates.sort(key=tempcmp)
|
||||
|
||||
strings = []
|
||||
for temp in templates:
|
||||
@@ -2259,7 +2259,7 @@ class DocManager(wx.EvtHandler):
|
||||
if sort:
|
||||
def tempcmp(a, b):
|
||||
return cmp(a.GetViewTypeName(), b.GetViewTypeName())
|
||||
templates.sort(tempcmp)
|
||||
templates.sort(key=tempcmp)
|
||||
|
||||
res = wx.GetSingleChoiceIndex(_("Select a document view:"),
|
||||
_("Views"),
|
||||
|
||||
@@ -755,7 +755,7 @@ class Shell(editwindow.EditWindow):
|
||||
#sort lowercase
|
||||
def _cmp(a,b):
|
||||
return ((a > b) - (a < b))
|
||||
unlist.sort(lambda a, b: _cmp(a.lower(), b.lower()))
|
||||
unlist.sort(key=lambda a, b: _cmp(a.lower(), b.lower()))
|
||||
|
||||
#this is more convenient, isn't it?
|
||||
self.AutoCompSetIgnoreCase(True)
|
||||
|
||||
@@ -2140,7 +2140,7 @@ class SlicesShell(editwindow.EditWindow):
|
||||
unlist = [thlist[i] for i in xrange(len(thlist)) if thlist[i] not in thlist[:i]]
|
||||
|
||||
#sort lowercase
|
||||
unlist.sort(lambda a, b: cmp(a.lower(), b.lower()))
|
||||
unlist.sort(key=lambda a, b: cmp(a.lower(), b.lower()))
|
||||
|
||||
#this is more convenient, isn't it?
|
||||
self.AutoCompSetIgnoreCase(True)
|
||||
|
||||
Reference in New Issue
Block a user