Bug#921824: terminator: Impossible to load a layout on startup after upgrading to 1.91-3

2019-02-28 Thread Markus Frosch
On Sat, 9 Feb 2019 12:06:55 +0100 phep  wrote:
> I managed to fix this with the patch below but this probably not the best 
> way to do it. Besides, this might be the sign that the code base should be 
> checked up more thoroughly before to depend on python3.

Hey Patrice,
thank you so much for testing and suggesting a patch.

I partially adopted your patch and will add it to the next upload.

If you noticed something else with the current packages please report it ;)

Cheers
Markus Frosch
-- 
mar...@lazyfrosch.de / lazyfro...@debian.org
https://lazyfrosch.de



signature.asc
Description: OpenPGP digital signature


Bug#921824: terminator: Impossible to load a layout on startup after upgrading to 1.91-3

2019-02-09 Thread phep

Hi,

I managed to fix this with the patch below but this probably not the best 
way to do it. Besides, this might be the sign that the code base should be 
checked up more thoroughly before to depend on python3.



diff --git a/layoutlauncher.py b/layoutlauncher.py
index b498174..31573fd 100644
--- a/layoutlauncher.py
+++ b/layoutlauncher.py
@@ -4,6 +4,7 @@
 """layoutlauncher.py - class for the Layout Launcher window"""

 import os
+from functools import cmp_to_key
 from gi.repository import Gtk
 from gi.repository import GObject

@@ -13,6 +14,9 @@ from .translation import _
 from .terminator import Terminator
 from .plugin import PluginRegistry

+def cmp(a, b):
+return (a > b) - (a < b)
+
 class LayoutLauncher:
 """Class implementing the various parts of the preferences editor"""
 terminator = None
@@ -72,7 +76,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=cmp_to_key(lambda x,y: 
cmp(x.lower(), y.lower(:

 if layout != "default":
 self.layouttreestore.append([layout])
 else:
diff --git a/notebook.py b/notebook.py
index 000d6f9..6f32cd3 100644
--- a/notebook.py
+++ b/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]


Cheers,

phep



Bug#921824: terminator: Impossible to load a layout on startup after upgrading to 1.91-3

2019-02-09 Thread Patrice Pillot
Package: terminator
Version: 1.91-3
Severity: important

Dear Maintainer,

   * What led up to the situation?

I run `terminator -l some_layout_name` or `terminator -s`

   * What was the outcome of this action?

I got the following stack trace (same in both cases):

Traceback (most recent call last):
  File "/usr/bin/terminator", line 72, in 
LAYOUTLAUNCHER=LayoutLauncher()
  File "/usr/share/terminator/terminatorlib/layoutlauncher.py", line 62, in 
__init__
self.update_layouts()
  File "/usr/share/terminator/terminatorlib/layoutlauncher.py", line 75, in 
update_layouts
for layout in sorted(layouts, cmp=lambda x,y: cmp(x.lower(), y.lower())):
TypeError: 'cmp' is an invalid keyword argument for sort()

   * What outcome did you expect instead?

I was expecting terminator would start with the requested layout as I
was used to (or the layout launcher window as the man page advertises).

Alternatively, after I run terminator with no options, I typed Alt-L to display
the layout launcher. This worked but the list is empty and I got the
following stack trace :

Traceback (most recent call last):
  File "/usr/share/terminator/terminatorlib/terminal.py", line 884, in 
on_keypress
getattr(self, "key_" + mapping)()
  File "/usr/share/terminator/terminatorlib/terminal.py", line 1898, in 
key_layout_launcher
LAYOUTLAUNCHER=LayoutLauncher()
  File "/usr/share/terminator/terminatorlib/layoutlauncher.py", line 62, in 
__init__
self.update_layouts()
  File "/usr/share/terminator/terminatorlib/layoutlauncher.py", line 75, in 
update_layouts
for layout in sorted(layouts, cmp=lambda x,y: cmp(x.lower(), y.lower())):
TypeError: 'cmp' is an invalid keyword argument for sort()

Thanks in advance for fixing this annoying bug.

phep

-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8) (ignored: LC_ALL 
set to fr_FR.utf8), LANGUAGE=fr_FR.utf8 (charmap=UTF-8) (ignored: LC_ALL set to 
fr_FR.utf8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages terminator depends on:
ii  dbus-x11   1.12.12-1
ii  gir1.2-glib-2.01.58.3-2
ii  gir1.2-gtk-3.0 3.24.5-1
ii  gir1.2-pango-1.0   1.42.4-6
ii  gir1.2-vte-2.910.54.2-2
ii  python33.7.2-1
ii  python3-cairo  1.16.2-1+b1
ii  python3-configobj  5.0.6-3
ii  python3-dbus   1.2.8-3
ii  python3-gi 3.30.4-1
ii  python3-gi-cairo   3.30.4-1
ii  python3-psutil 5.5.0-1

Versions of packages terminator recommends:
ii  gir1.2-keybinder-3.0  0.3.2-1
ii  gir1.2-notify-0.7 0.7.7-4
ii  xdg-utils 1.1.3-1

terminator suggests no packages.

-- no debconf information