tomli/tomllib compatibility layer added.

Type annotation Self removed.

python version requirement changed.

tomli added as runtime dependency if py ver < 3.11

minor version bump.
This commit is contained in:
onyx-and-iris
2022-09-05 17:06:11 +01:00
parent 731f0906ef
commit db789b8342
6 changed files with 31 additions and 59 deletions

View File

@@ -2,9 +2,13 @@ import abc
import threading
import time
from pathlib import Path
from typing import Optional, Self
from typing import Optional
try:
import tomllib
except ModuleNotFoundError:
import tomli as tomllib
import tomllib
from pythonosc.dispatcher import Dispatcher
from pythonosc.osc_message_builder import OscMessageBuilder
from pythonosc.osc_server import BlockingOSCUDPServer
@@ -60,7 +64,7 @@ class XAirRemote(abc.ABC):
raise XAirRemoteError("No valid ip or password detected")
self.server = OSCClientServer((self.xair_ip, self.xair_port), dispatcher)
def __enter__(self) -> Self:
def __enter__(self):
self.worker = threading.Thread(target=self.run_server, daemon=True)
self.worker.start()
self.validate_connection()