From 58d42fa8fe07086ec172b27d872e628aff5dbefc Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Wed, 31 Jan 2024 18:06:57 -0500 Subject: [PATCH] Making sure the code is compatible with Python 3.12+ --- owrx/aircraft.py | 6 +++--- owrx/client.py | 2 +- owrx/feature.py | 4 ++-- owrx/markers.py | 2 +- owrx/storage.py | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/owrx/aircraft.py b/owrx/aircraft.py index 17fd5bb2..29ef2561 100644 --- a/owrx/aircraft.py +++ b/owrx/aircraft.py @@ -307,9 +307,9 @@ class AircraftManager(object): # class AircraftParser(TextParser): def __init__(self, filePrefix: str = None, service: bool = False): - self.reFlight = re.compile("^([0-9A-Z]{2}|[A-Z]{3})0*([0-9]+[A-Z]*)$") - self.reDots = re.compile("^\.*([^\.].*?)\.*$") - self.reIATA = re.compile("^..[0-9]+$") + self.reFlight = re.compile(r"^([0-9A-Z]{2}|[A-Z]{3})0*([0-9]+[A-Z]*)$") + self.reDots = re.compile(r"^\.*([^\.].*?)\.*$") + self.reIATA = re.compile(r"^..[0-9]+$") super().__init__(filePrefix=filePrefix, service=service) def parse(self, msg: bytes): diff --git a/owrx/client.py b/owrx/client.py index 6ee0c5b2..1c5bab1a 100644 --- a/owrx/client.py +++ b/owrx/client.py @@ -80,7 +80,7 @@ class ClientRegistry(object): with self.chatLock: if name is not None: # Names can only include alphanumerics - name = re.sub("\W+", "", name) + name = re.sub(r"\W+", "", name) # Cannot have duplicate names if client not in self.chat or name != self.chat[client]["name"]: for c in self.chat: diff --git a/owrx/feature.py b/owrx/feature.py index 97248419..bebedc21 100644 --- a/owrx/feature.py +++ b/owrx/feature.py @@ -530,9 +530,9 @@ class FeatureDetector(object): def has_freedv_rx(self): """ - The "freedv\_rx" executable is required to demodulate FreeDV digital transmissions. It comes together with the + The "freedv_rx" executable is required to demodulate FreeDV digital transmissions. It comes together with the codec2 library, but it's only a supplemental part and not installed by default or contained in its packages. - To install it, you will need to compile codec2 from source and manually install freedv\_rx. + To install it, you will need to compile codec2 from source and manually install freedv_rx. Detailed installation instructions are available on the [OpenWebRX wiki](https://github.com/jketterl/openwebrx/wiki/FreeDV-demodulator-notes). diff --git a/owrx/markers.py b/owrx/markers.py index fc82307c..0befd2b5 100644 --- a/owrx/markers.py +++ b/owrx/markers.py @@ -388,7 +388,7 @@ class Markers(object): result = {} try: data = urllib.request.urlopen(url).read().decode('utf-8') - data = json.loads(re.sub("^\s*//.*", "", data, flags=re.MULTILINE)) + data = json.loads(re.sub(r"^\s*//.*", "", data, flags=re.MULTILINE)) for entry in data: if "lat" in entry and "lon" in entry and "url" in entry: diff --git a/owrx/storage.py b/owrx/storage.py index 265b8ad9..c4a1ec4f 100644 --- a/owrx/storage.py +++ b/owrx/storage.py @@ -107,7 +107,7 @@ class Storage(object): if not inFile.startswith('/'): inFile = self.getFilePath(inFile) # Only converting BMP files for now - outFile = re.sub('\.bmp$', '.png', inFile) + outFile = re.sub(r'\.bmp$', '.png', inFile) if outFile==inFile: return try: