From 04ba955b384435c3510d20dc6bb2fa1cede5ee0f Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Thu, 28 Feb 2019 21:15:11 +0100 Subject: [PATCH] Add patch to fix Python 3 related issues with layout selection from Debian https://bugs.debian.org/921824 --- terminatorlib/layoutlauncher.py | 2 +- terminatorlib/notebook.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/terminatorlib/layoutlauncher.py b/terminatorlib/layoutlauncher.py index b4981748..6045b041 100755 --- a/terminatorlib/layoutlauncher.py +++ b/terminatorlib/layoutlauncher.py @@ -72,7 +72,7 @@ class LayoutLauncher: """Update the contents of the layout""" self.layouttreestore.clear() layouts = self.config.list_layouts() - for layout in sorted(layouts, cmp=lambda x,y: cmp(x.lower(), y.lower())): + for layout in sorted(layouts, key=str.lower): if layout != "default": self.layouttreestore.append([layout]) else: diff --git a/terminatorlib/notebook.py b/terminatorlib/notebook.py index 000d6f97..6f32cd3b 100755 --- a/terminatorlib/notebook.py +++ b/terminatorlib/notebook.py @@ -3,6 +3,7 @@ # GPL v2 only """notebook.py - classes for the notebook widget""" +from functools import cmp_to_key from gi.repository import GObject from gi.repository import Gtk from gi.repository import Gdk @@ -100,7 +101,7 @@ class Notebook(Container, Gtk.Notebook): num = 0 keys = list(children.keys()) - keys.sort(child_compare) + keys = sorted(keys, key=cmp_to_key(child_compare)) for child_key in keys: child = children[child_key]