Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Commit

Permalink
More Python 3 fixes needed to also install the packages
Browse files Browse the repository at this point in the history
Daemon still does not start. It fails as follows:

Traceback (most recent call last):
  File "/usr/share/wicd/daemon/wicd-daemon.py", line 62, in <module>
    from wicd.logfile import ManagedStdio
  File "/usr/lib/python3/dist-packages/wicd/logfile.py", line 32, in <module>
    class LogFile(file):
NameError: name 'file' is not defined
  • Loading branch information
xtaran committed Sep 10, 2019
1 parent c4ba09c commit 187f85f
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion curses/curses_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ def __init__(self, tuples, handler, attrs=('body', 'infobar'), debug=False):
# 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'),
Expand Down
2 changes: 1 addition & 1 deletion curses/wicd-curses.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
# 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
Expand Down
2 changes: 1 addition & 1 deletion gtk/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
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
Expand Down
2 changes: 1 addition & 1 deletion gtk/prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#

import gtk
import gobject
from gi.repository import GObject as gobject
import os

from wicd import misc
Expand Down
2 changes: 1 addition & 1 deletion gtk/wicd-client.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def main() -- Runs the wicd frontend main loop.

import sys
import gtk
import gobject
from gi.repository import GObject as gobject
import getopt
import os
import pango
Expand Down
2 changes: 1 addition & 1 deletion wicd/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

import gobject
from gi.repository import GObject as gobject
import time

from dbus import DBusException
Expand Down
6 changes: 4 additions & 2 deletions wicd/wicd-daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class WirelessDaemon() -- DBus interface to managed the wireless network.
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):
Expand Down Expand Up @@ -1950,5 +1950,7 @@ def on_exit(child_pid):
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)
2 changes: 1 addition & 1 deletion wicd/wnettools.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class BaseWirelessInterface() -- Control a wireless network interface.
import socket, fcntl
import shutil

import wpath
from . import wpath
from . import misc
from .misc import find_path

Expand Down

0 comments on commit 187f85f

Please sign in to comment.