From c54a223b1c746de69a79044e58c8eda2bd6b7b62 2021-08-27 18:38:07 From: Matthias Bussonnier Date: 2021-08-27 18:38:07 Subject: [PATCH] reformat --- diff --git a/IPython/core/pylabtools.py b/IPython/core/pylabtools.py index d114f69..35f7924 100644 --- a/IPython/core/pylabtools.py +++ b/IPython/core/pylabtools.py @@ -43,11 +43,11 @@ backend2gui = dict(zip(backends.values(), backends.keys())) backend2gui['Qt4Agg'] = 'qt' # In the reverse mapping, there are a few extra valid matplotlib backends that # map to the same GUI support -backend2gui['GTK'] = backend2gui['GTKCairo'] = 'gtk' -backend2gui['GTK3Cairo'] = 'gtk3' -backend2gui['GTK4Cairo'] = 'gtk4' -backend2gui['WX'] = 'wx' -backend2gui['CocoaAgg'] = 'osx' +backend2gui["GTK"] = backend2gui["GTKCairo"] = "gtk" +backend2gui["GTK3Cairo"] = "gtk3" +backend2gui["GTK4Cairo"] = "gtk4" +backend2gui["WX"] = "wx" +backend2gui["CocoaAgg"] = "osx" # And some backends that don't need GUI integration del backend2gui["nbAgg"] del backend2gui["agg"] diff --git a/IPython/lib/inputhookgtk4.py b/IPython/lib/inputhookgtk4.py index 3b2ccf1..a872cee 100644 --- a/IPython/lib/inputhookgtk4.py +++ b/IPython/lib/inputhookgtk4.py @@ -1,25 +1,26 @@ """ Enable Gtk4 to be used interactively by IPython. """ -#----------------------------------------------------------------------------- +# ----------------------------------------------------------------------------- # Copyright (c) 2021, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. -#----------------------------------------------------------------------------- +# ----------------------------------------------------------------------------- -#----------------------------------------------------------------------------- +# ----------------------------------------------------------------------------- # Imports -#----------------------------------------------------------------------------- +# ----------------------------------------------------------------------------- import sys from gi.repository import GLib -#----------------------------------------------------------------------------- +# ----------------------------------------------------------------------------- # Code -#----------------------------------------------------------------------------- +# ----------------------------------------------------------------------------- + class _InputHook: def __init__(self, context): diff --git a/IPython/terminal/pt_inputhooks/gtk4.py b/IPython/terminal/pt_inputhooks/gtk4.py index 5ba7c4c..009fbf1 100644 --- a/IPython/terminal/pt_inputhooks/gtk4.py +++ b/IPython/terminal/pt_inputhooks/gtk4.py @@ -8,7 +8,9 @@ from gi.repository import GLib class _InputHook: def __init__(self, context): self._quit = False - GLib.io_add_watch(context.fileno(), GLib.PRIORITY_DEFAULT, GLib.IO_IN, self.quit) + GLib.io_add_watch( + context.fileno(), GLib.PRIORITY_DEFAULT, GLib.IO_IN, self.quit + ) def quit(self, *args, **kwargs): self._quit = True diff --git a/examples/IPython Kernel/gui/gui-gtk4.py b/examples/IPython Kernel/gui/gui-gtk4.py index 6be7582..bb8c56b 100644 --- a/examples/IPython Kernel/gui/gui-gtk4.py +++ b/examples/IPython Kernel/gui/gui-gtk4.py @@ -9,7 +9,8 @@ In [2]: %run gui-gtk4.py """ import gi -gi.require_version('Gtk', '4.0') + +gi.require_version("Gtk", "4.0") from gi.repository import Gtk, GLib # noqa