diff --git a/monitor-qt.py b/monitor-qt.py index f1ab2fa..7b2741e 100755 --- a/monitor-qt.py +++ b/monitor-qt.py @@ -48,18 +48,18 @@ def arg_layout(value): args = parser.parse_args() -# TODO : check the number of network interfaces +# check the number of network interfaces adapters = ifaddr.get_adapters() adaptersList = () interfaceIndex = 0 -# TODO : if > 1, list all interfaces with their IP and an index, and request the user to select the good interface +# if > 1, list all interfaces with their IP and an index, and request the user to select the good interface if len(list(adapters)) > 1: for index, adapter in enumerate(adapters): adaptersList = adaptersList + (adapter.name, ) for ip in adapter.ips: if ip.is_IPv4: print(str(index) + ") " + adapter.nice_name + " %s/%s" % (ip.ip, ip.network_prefix)) - # TODO: read the index chosen by the user, if valid persist the interface name in a property + # read the index chosen by the user, if valid persist the interface name in a property interfaceIndex = int(input('Please select the network interface used by Pioneer ProDj Link\n')) network_interface = adaptersList[interfaceIndex] else: diff --git a/prodj/network/nfsclient.py b/prodj/network/nfsclient.py index c5712c4..969b052 100644 --- a/prodj/network/nfsclient.py +++ b/prodj/network/nfsclient.py @@ -1,4 +1,5 @@ import asyncio +import sys import logging import os import socket @@ -13,6 +14,8 @@ class NfsClient: def __init__(self, prodj): self.prodj = prodj + if sys.version_info >= (3, 8) and sys.platform.lower().startswith("win"): + asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) self.loop = asyncio.new_event_loop() self.receiver = RpcReceiver()