diff --git a/curses/curses_misc.py b/curses/curses_misc.py index 1f69ce7..0e80b57 100644 --- a/curses/curses_misc.py +++ b/curses/curses_misc.py @@ -707,7 +707,7 @@ class OptCols(urwid.WidgetWrap): # callbacks map the text contents to its assigned callback. self.callbacks = [] for cmd in tuples: - key = reduce(lambda s, (f, t): s.replace(f, t), [ + key = reduce(lambda s, tuple: s.replace(tuple[0], tuple[1]), [ ('ctrl ', 'Ctrl+'), ('meta ', 'Alt+'), ('left', '<-'), ('right', '->'), ('page up', 'Page Up'), ('page down', 'Page Down'), diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 5bf4cf4..2ab2539 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -46,7 +46,7 @@ import urwid # DBus communication stuff from dbus import DBusException # It took me a while to figure out that I have to use this. -import gobject +from gi.repository import GObject as gobject # Other important wicd-related stuff from wicd import wpath diff --git a/gtk/gui.py b/gtk/gui.py index ea9f4c9..b02ff8a 100644 --- a/gtk/gui.py +++ b/gtk/gui.py @@ -26,7 +26,7 @@ Module containing the code for the main wicd GUI. import os import sys import time -import gobject +from gi.repository import GObject as gobject import gtk from itertools import chain from dbus import DBusException diff --git a/gtk/prefs.py b/gtk/prefs.py index f34a559..fbd5446 100644 --- a/gtk/prefs.py +++ b/gtk/prefs.py @@ -25,7 +25,7 @@ handles recieving/sendings the settings from/to the daemon. # import gtk -import gobject +from gi.repository import GObject as gobject import os from wicd import misc diff --git a/gtk/wicd-client.py b/gtk/wicd-client.py index 39fe339..e008912 100644 --- a/gtk/wicd-client.py +++ b/gtk/wicd-client.py @@ -39,7 +39,7 @@ class TrayIcon() -- Parent class of TrayIconGUI and IconConnectionInfo. import sys import gtk -import gobject +from gi.repository import GObject as gobject import getopt import os import pango diff --git a/wicd/monitor.py b/wicd/monitor.py index 38def57..88642eb 100755 --- a/wicd/monitor.py +++ b/wicd/monitor.py @@ -24,7 +24,7 @@ when appropriate. # along with this program. If not, see . # -import gobject +from gi.repository import GObject as gobject import time from dbus import DBusException diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 0b30312..a5b22c1 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -44,7 +44,7 @@ from subprocess import Popen from operator import itemgetter # DBUS -import gobject +from gi.repository import GObject as gobject import dbus import dbus.service if getattr(dbus, 'version', (0, 0, 0)) < (0, 80, 0): @@ -1950,5 +1950,7 @@ if __name__ == '__main__': print(("Root privileges are required for the daemon to run properly." + " Exiting.")) sys.exit(1) - gobject.threads_init() + # No more needed since PyGObject 3.11, c.f. + # https://wiki.gnome.org/PyGObject/Threading + #gobject.threads_init() main(sys.argv) diff --git a/wicd/wnettools.py b/wicd/wnettools.py index 1424062..bfa290b 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -39,7 +39,7 @@ import dbus import socket, fcntl import shutil -import wpath +from . import wpath from . import misc from .misc import find_path