8 Commits
Author SHA1 Message Date
Axel Beckert f090e292dc Fix wicd-curses warnings in status bar and similar cases
Replace all occurrences of "from gi.repository import GObject as
gobject" with "from gi.repository import GLib as gobject".
2019-09-12 00:59:05 +02:00
Axel Beckert c1c26d8112 Remaining needed changes to get the daemon running with Python 3 2019-09-11 02:43:20 +02:00
Axel Beckert c238d26a9e Fix "NameError: name 'cmp' is not defined"
Source: https://codegolf.stackexchange.com/questions/49778/how-can-i-use-cmpa-b-with-python3

Now the wicd daemon starts as "/usr/sbin/wicd -c -f -e -o" wihout
errors, only warnings are left.

wicd-curses also runs but spews warnings into the status line, too.
2019-09-11 01:40:43 +02:00
Axel Beckert 9587c52c88 Fix "TypeError: cmp is an invalid keyword argument for sort()" 2019-09-11 01:33:03 +02:00
Axel Beckert c2789eb467 Fix "TypeError: sorted expected 1 arguments, got 2" 2019-09-11 01:29:07 +02:00
Axel Beckert fef2a43a59 Fix LogFile class by using io.FileIO instead of file
Thanks to Frank Hofmann for the right pointer to
https://stackoverflow.com/questions/47838405/porting-a-sub-class-of-python2-file-class-to-python3

Now at least "/usr/sbin/wicd -c -f -e -o" keeps running.

Still throws errors and warnings, though:

/usr/share/wicd/daemon/wicd-daemon.py:1925: PyGIDeprecationWarning: GObject.MainLoop is deprecated; use GLib.MainLoop instead
  mainloop = gobject.MainLoop()
/usr/share/wicd/daemon/monitor.py:392: PyGIDeprecationWarning: GObject.MainLoop is deprecated; use GLib.MainLoop instead
  mainloop = gobject.MainLoop()
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/share/wicd/daemon/wicd-daemon.py", line 1020, in _async_scan
    self._sync_scan()
  File "/usr/share/wicd/daemon/wicd-daemon.py", line 1024, in _sync_scan
    scan = self.wifi.Scan(str(self.hidden_essid))
  File "/usr/lib/python3/dist-packages/wicd/networking.py", line 673, in Scan
    aps = wiface.GetNetworks(essid)
  File "/usr/lib/python3/dist-packages/wicd/wnettools.py", line 227, in newfunc
    return func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/wicd/wnettools.py", line 1392, in GetNetworks
    entry = self._ParseAccessPoint(cell, ralink_info)
  File "/usr/lib/python3/dist-packages/wicd/wnettools.py", line 1447, in _ParseAccessPoint
    ap['bitrates'] = sorted(m, lambda x, y: int(float(x) - float(y)))
TypeError: sorted expected 1 arguments, got 2
2019-09-11 01:24:27 +02:00
Axel Beckert 187f85f6a0 More Python 3 fixes needed to also install the packages
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
2019-09-11 01:16:58 +02:00
Axel Beckert c4ba09c196 Fix some execution paths in setup.py for Python 3
Mostly adds additionally thrown Exceptions and str vs bytes
conversions.
2019-09-11 01:13:04 +02:00