mirror of https://gitlab.com/hp3icc/emq-TE1.git
Update tgname.sh
This commit is contained in:
parent
3b21ad9dcc
commit
527437deb0
|
|
@ -347,6 +347,12 @@ archivo_entrada_tg_tgif = '/opt/tg-tgif'
|
|||
# Archivo de origen tg-systemx
|
||||
archivo_entrada_tg_systemx = '/opt/tg-systemx'
|
||||
|
||||
# Archivo de origen tg-bm
|
||||
archivo_tg_bm = '/opt/tg-bm'
|
||||
|
||||
# Archivo de origen tg-fdmr
|
||||
archivo_tg_fdmr = '/opt/tg-fdmr'
|
||||
|
||||
# URL del primer archivo de texto
|
||||
url1 = "http://www.pistar.uk/downloads/TGList_BM.txt"
|
||||
# URL del segundo archivo CSV
|
||||
|
|
@ -364,6 +370,14 @@ with open(archivo_entrada_tg_tgif, 'r') as archivo_tg_tgif:
|
|||
with open(archivo_entrada_tg_systemx, 'r') as archivo_tg_systemx:
|
||||
lineas_tg_systemx = archivo_tg_systemx.readlines()
|
||||
|
||||
# Leer el archivo tg-bm
|
||||
with open(archivo_tg_bm, 'r') as archivo_tg_bm:
|
||||
lineas_tg_bm = archivo_tg_bm.readlines()
|
||||
|
||||
# Leer el archivo tg-fdmr
|
||||
with open(archivo_tg_fdmr, 'r') as archivo_tg_fdmr:
|
||||
lineas_tg_fdmr = archivo_tg_fdmr.readlines()
|
||||
|
||||
# Descargar el contenido del primer archivo de texto
|
||||
response1 = requests.get(url1)
|
||||
content1 = response1.content.decode("utf-8")
|
||||
|
|
@ -438,31 +452,23 @@ for linea in lineas_tg_systemx:
|
|||
nueva_linea = 'DMR,2,{},{} {}'.format(primera_columna, plataforma, partes[1])
|
||||
lineas_filtradas.append(nueva_linea)
|
||||
|
||||
# Procesar las líneas adicionales de url1
|
||||
for i, row in enumerate(data_url1):
|
||||
if i == 0:
|
||||
# Agregar el número 1 al inicio y rellenar con ceros
|
||||
primera_columna = '1{:06d}'.format(row[0])
|
||||
# Procesar las líneas de tg-bm y aplicar el formato de url1
|
||||
for i, row in enumerate(lineas_tg_bm):
|
||||
partes = row.strip().split('\t')
|
||||
if len(partes) > 0 and len(partes[0]) <= 6 and partes[0].isdigit():
|
||||
primera_columna = '1{:06d}'.format(int(partes[0]))
|
||||
plataforma = 'BM /'
|
||||
lineas_filtradas.append('DMR,2,{},{} {}'.format(primera_columna, plataforma, row[1]))
|
||||
else:
|
||||
# Agregar el número 1 al inicio y rellenar con ceros
|
||||
primera_columna = '1{:06d}'.format(row[0])
|
||||
plataforma = 'BM /'
|
||||
lineas_filtradas.append('DMR,2,{},{} {}'.format(primera_columna, plataforma, row[1]))
|
||||
nueva_linea = 'DMR,2,{},{} {}'.format(primera_columna, plataforma, partes[1])
|
||||
lineas_filtradas.append(nueva_linea)
|
||||
|
||||
# Procesar las líneas adicionales de url2
|
||||
for i, row in enumerate(data_url2):
|
||||
if i == 0:
|
||||
# Agregar el número 2 al inicio y rellenar con ceros
|
||||
primera_columna = '2{:06d}'.format(row[0])
|
||||
# Procesar las líneas de tg-fdmr y aplicar el formato de url2
|
||||
for i, row in enumerate(lineas_tg_fdmr):
|
||||
partes = row.strip().split('\t')
|
||||
if len(partes) > 0 and len(partes[0]) <= 6 and partes[0].isdigit():
|
||||
primera_columna = '2{:06d}'.format(int(partes[0]))
|
||||
plataforma = 'FDMR /'
|
||||
lineas_filtradas.append('DMR,2,{},{} {}'.format(primera_columna, plataforma, row[1]))
|
||||
else:
|
||||
# Agregar el número 2 al inicio y rellenar con ceros
|
||||
primera_columna = '2{:06d}'.format(row[0])
|
||||
plataforma = 'FDMR /'
|
||||
lineas_filtradas.append('DMR,2,{},{} {}'.format(primera_columna, plataforma, row[1]))
|
||||
nueva_linea = 'DMR,2,{},{} {}'.format(primera_columna, plataforma, partes[1])
|
||||
lineas_filtradas.append(nueva_linea)
|
||||
|
||||
# Generar el archivo de salida
|
||||
with open('/opt/MMDVMHost-Websocketboard/html/data/TG_List.csv', 'w') as archivo_salida:
|
||||
|
|
|
|||
Loading…
Reference in New Issue