mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Check for # comments at the beginning of lines in ShapedDevices.csv
This commit is contained in:
parent
f4a0f3237c
commit
a2ea475457
@ -46,9 +46,15 @@ def refreshShapers():
|
||||
rowNum = 2
|
||||
with open('ShapedDevices.csv') as csv_file:
|
||||
csv_reader = csv.reader(csv_file, delimiter=',')
|
||||
next(csv_reader)
|
||||
#Remove comments if any
|
||||
commentsRemoved = []
|
||||
for row in csv_reader:
|
||||
circuitID, circuitName, deviceID, deviceName, ParentNode, mac, ipv4_input, ipv6_input, downloadMin, uploadMin, downloadMax, uploadMax = row
|
||||
if not row[0].startswith('#'):
|
||||
commentsRemoved.append(row)
|
||||
#Remove header
|
||||
commentsRemoved.pop(0)
|
||||
for row in commentsRemoved:
|
||||
circuitID, circuitName, deviceID, deviceName, ParentNode, mac, ipv4_input, ipv6_input, downloadMin, uploadMin, downloadMax, uploadMax, comment = row
|
||||
ipv4_hosts = []
|
||||
if ipv4_input != "":
|
||||
try:
|
||||
@ -107,9 +113,15 @@ def refreshShapers():
|
||||
knownCircuitIDs = []
|
||||
with open('ShapedDevices.csv') as csv_file:
|
||||
csv_reader = csv.reader(csv_file, delimiter=',')
|
||||
next(csv_reader)
|
||||
#Remove comments if any
|
||||
commentsRemoved = []
|
||||
for row in csv_reader:
|
||||
circuitID, circuitName, deviceID, deviceName, ParentNode, mac, ipv4_input, ipv6_input, downloadMin, uploadMin, downloadMax, uploadMax = row
|
||||
if not row[0].startswith('#'):
|
||||
commentsRemoved.append(row)
|
||||
#Remove header
|
||||
commentsRemoved.pop(0)
|
||||
for row in commentsRemoved:
|
||||
circuitID, circuitName, deviceID, deviceName, ParentNode, mac, ipv4_input, ipv6_input, downloadMin, uploadMin, downloadMax, uploadMax, comment = row
|
||||
ipv4_hosts = []
|
||||
if ipv4_input != "":
|
||||
ipv4_input = ipv4_input.replace(' ','')
|
||||
|
Loading…
Reference in New Issue
Block a user