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
This commit is contained in:
parent
261f7607b5
commit
da1211bbb2
1 changed files with 11 additions and 2 deletions
13
logtailer.py
13
logtailer.py
|
@ -183,9 +183,18 @@ def main():
|
||||||
raise ValueError('File not found', format(dmr_id_lookupfile))
|
raise ValueError('File not found', format(dmr_id_lookupfile))
|
||||||
|
|
||||||
f = open(dmr_id_lookupfile, 'r')
|
f = open(dmr_id_lookupfile, 'r')
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
|
separator = "\t"
|
||||||
for line in lines:
|
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]
|
dmrids[tokens[0]] = tokens[1]
|
||||||
|
|
||||||
logging.info("Starting Websocketserver")
|
logging.info("Starting Websocketserver")
|
||||||
|
|
Loading…
Reference in a new issue