Merge branch 'master' of https://github.com/bob-white/Phoenix into bob-white-master

This commit is contained in:
Robin Dunn
2017-09-07 20:42:29 -07:00
5 changed files with 11 additions and 6 deletions

View File

@@ -96,6 +96,7 @@ See Also
import wx
from functools import cmp_to_key
import six
@@ -766,7 +767,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=cmp_to_key(self.OrderPageTabInfoBySmallWidthAsc))
width -= tabsep*(numtabs - 1)
for i, info in enumerate(self._pages):

View File

@@ -236,6 +236,7 @@ import wx
import math
import bisect
import zlib
from functools import cmp_to_key
import six
@@ -10406,7 +10407,7 @@ class UltimateListMainWindow(wx.ScrolledWindow):
else:
self.__func = func
self._lines.sort(self.OnCompareItems)
self._lines.sort(key=cmp_to_key(self.OnCompareItems))
if self.IsShownOnScreen():
self._dirty = True

View File

@@ -16,6 +16,7 @@ import os.path
import shutil
import wx
import sys
from functools import cmp_to_key
_ = wx.GetTranslation
@@ -2219,7 +2220,7 @@ class DocManager(wx.EvtHandler):
if sort:
def tempcmp(a, b):
return cmp(a.GetDescription(), b.GetDescription())
templates.sort(tempcmp)
templates.sort(key=cmp_to_key(tempcmp))
strings = []
for temp in templates:
@@ -2259,7 +2260,7 @@ class DocManager(wx.EvtHandler):
if sort:
def tempcmp(a, b):
return cmp(a.GetViewTypeName(), b.GetViewTypeName())
templates.sort(tempcmp)
templates.sort(key=cmp_to_key(tempcmp))
res = wx.GetSingleChoiceIndex(_("Select a document view:"),
_("Views"),

View File

@@ -14,6 +14,7 @@ import keyword
import os
import sys
import time
from functools import cmp_to_key
from .buffer import Buffer
from . import dispatcher
@@ -755,7 +756,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=cmp_to_key(lambda a, b: _cmp(a.lower(), b.lower())))
#this is more convenient, isn't it?
self.AutoCompSetIgnoreCase(True)

View File

@@ -21,6 +21,7 @@ import keyword
import os
import sys
import time
from functools import cmp_to_key
from .buffer import Buffer
from . import dispatcher
@@ -2140,7 +2141,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=cmp_to_key(lambda a, b: cmp(a.lower(), b.lower())))
#this is more convenient, isn't it?
self.AutoCompSetIgnoreCase(True)