diff options
author | Iván Ávalos <avalos@disroot.org> | 2024-06-14 21:08:21 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2024-06-14 21:08:21 -0600 |
commit | 471dc4ca7b6cfd656cc2c04c526fe56ee538991c (patch) | |
tree | 4766fa7209e2eaab65269db456cf0436e6a64a49 /tools/test-integration.py | |
parent | 447c7e15fcec8fc72d0457bb7dbf166cbea84acd (diff) | |
parent | 64528b96da4a742070d5845a876b07ca66ad0be3 (diff) | |
download | trackermap-server-471dc4ca7b6cfd656cc2c04c526fe56ee538991c.tar.gz trackermap-server-471dc4ca7b6cfd656cc2c04c526fe56ee538991c.tar.bz2 trackermap-server-471dc4ca7b6cfd656cc2c04c526fe56ee538991c.zip |
Merge tag 'v6.2'
Diffstat (limited to 'tools/test-integration.py')
-rwxr-xr-x | tools/test-integration.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/test-integration.py b/tools/test-integration.py index f31ad7a82..29c741390 100755 --- a/tools/test-integration.py +++ b/tools/test-integration.py @@ -9,6 +9,7 @@ import json import socket import time import threading +import re messages = { 'gps103' : 'imei:123456789012345,help me,1201011201,,F,120100.000,A,6000.0000,N,13000.0000,E,0.00,;', @@ -137,11 +138,11 @@ debug = '-v' in sys.argv def load_ports(): ports = {} dir = os.path.dirname(os.path.abspath(__file__)) - root = xml.etree.ElementTree.parse(dir + '/../setup/default.xml').getroot() - for entry in root.findall('entry'): - key = entry.attrib['key'] - if key.endswith('.port'): - ports[key[:-5]] = int(entry.text) + with open(dir + '/../src/main/java/org/traccar/config/PortConfigSuffix.java', 'r') as file: + content = file.read() + pattern = re.compile(r'PORTS\.put\("([^"]+)",\s*(\d+)\);') + matches = pattern.findall(content) + ports = {protocol: int(port) for protocol, port in matches} if debug: print('\nports: {ports!r}\n') return ports |