mirror of
https://github.com/KevinMidboe/mktxp-no-cli.git
synced 2025-10-29 17:50:23 +00:00
DS refactor, fixes/optimizations
This commit is contained in:
@@ -42,19 +42,18 @@ class CapsmanOutput:
|
||||
else:
|
||||
dhcp_rt_by_interface[interface] = [registration_record]
|
||||
|
||||
|
||||
output_entry = BaseOutputProcessor.OutputCapsmanEntry
|
||||
output_table = BaseOutputProcessor.output_table(output_entry)
|
||||
|
||||
output_records = 0
|
||||
registration_records = len(registration_records)
|
||||
output_entry = BaseOutputProcessor.OutputCapsmanEntry
|
||||
output_table = BaseOutputProcessor.output_table(output_entry)
|
||||
|
||||
for key in dhcp_rt_by_interface.keys():
|
||||
for record in dhcp_rt_by_interface[key]:
|
||||
output_table.add_row(output_entry(**record))
|
||||
output_records += 1
|
||||
if output_records < registration_records:
|
||||
output_table.add_row(output_entry())
|
||||
|
||||
|
||||
print (output_table.draw())
|
||||
|
||||
for server in dhcp_rt_by_interface.keys():
|
||||
|
||||
@@ -35,11 +35,11 @@ class DHCPOutput:
|
||||
else:
|
||||
dhcp_by_server[server] = [dhcp_lease_record]
|
||||
|
||||
output_entry = BaseOutputProcessor.OutputDHCPEntry
|
||||
output_table = BaseOutputProcessor.output_table(output_entry)
|
||||
|
||||
output_records = 0
|
||||
lease_records = len(dhcp_lease_records)
|
||||
output_entry = BaseOutputProcessor.OutputDHCPEntry
|
||||
output_table = BaseOutputProcessor.output_table(output_entry)
|
||||
|
||||
for key in dhcp_by_server.keys():
|
||||
for record in dhcp_by_server[key]:
|
||||
record['host_name'] = BaseOutputProcessor.dhcp_name(router_entry, record, drop_comment = True)
|
||||
@@ -47,7 +47,7 @@ class DHCPOutput:
|
||||
output_records += 1
|
||||
if output_records < lease_records:
|
||||
output_table.add_row(output_entry())
|
||||
|
||||
|
||||
print (output_table.draw())
|
||||
|
||||
for server in dhcp_by_server.keys():
|
||||
|
||||
@@ -42,11 +42,11 @@ class WirelessOutput:
|
||||
else:
|
||||
dhcp_rt_by_interface[interface] = [registration_record]
|
||||
|
||||
output_entry = BaseOutputProcessor.OutputWiFiEntry
|
||||
output_table = BaseOutputProcessor.output_table(output_entry)
|
||||
|
||||
output_records = 0
|
||||
registration_records = len(registration_records)
|
||||
output_entry = BaseOutputProcessor.OutputWiFiEntry
|
||||
output_table = BaseOutputProcessor.output_table(output_entry)
|
||||
|
||||
for key in dhcp_rt_by_interface.keys():
|
||||
for record in dhcp_rt_by_interface[key]:
|
||||
output_table.add_row(output_entry(**record))
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
|
||||
|
||||
import re, os
|
||||
from datetime import timedelta
|
||||
from collections import namedtuple
|
||||
|
||||
Reference in New Issue
Block a user