From da1211bbb209b462ba777ec8f6d0e83638612afd Mon Sep 17 00:00:00 2001 From: Kim Huebel Date: Thu, 26 Nov 2020 16:08:36 +0000 Subject: [PATCH] added new field separators for DMRIds.dat-file now the files can be separated with " ", ";", "," or "\t" that is tabulator Format of file must be: first field = id second field = callsign following fields with name, QTH etc will be ignored --- logtailer.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/logtailer.py b/logtailer.py index 1f60897..c34b595 100644 --- a/logtailer.py +++ b/logtailer.py @@ -183,9 +183,18 @@ def main(): raise ValueError('File not found', format(dmr_id_lookupfile)) f = open(dmr_id_lookupfile, 'r') - lines = f.readlines() + lines = f.readlines() + separator = "\t" for line in lines: - tokens = line.split("\t") + if line.find(" "): + separator = " " + if line.find(";"): + separator = ";" + if line.find(","): + separator = "," + if line.find("\t"): + separator = "\t" + tokens = line.split(separator) dmrids[tokens[0]] = tokens[1] logging.info("Starting Websocketserver")