Date Fri, 29 May 2020 12:19:02 -0700 Subject Re: clean up kernel_{read,write} & friends v2 share 4k On Fri, May 29, 2020 at 6:08 AM David Laight wrote:
A wide monitor is for looking at lots of files.
Not necessarily.
Date Fri, 29 May 2020 12:19:02 -0700 Subject Re: clean up kernel_{read,write} & friends v2 share 4k On Fri, May 29, 2020 at 6:08 AM David Laight wrote:
A wide monitor is for looking at lots of files.
Not necessarily.
# Quick POC #1, obviously want to get rid of the "terminal" assumption | |
def convert_from_arista_to_pseudo_set_format(contents: str): | |
final = [] | |
contents = 'terminal' + contents.split('terminal', 1)[1] | |
contents = contents.split('\n!\n') | |
for block in contents: | |
split = block.split('\n') | |
main = f'set {split[0]}' |
# e.g. Convert 4261160822 to 65020.10102 | |
def convert_ASPLAIN_to_ASDOT(as_number): | |
if not(isinstance(as_number, int)) or as_number < 0 or as_number > 4294967295: | |
raise Exception('Invalid AS Number: must be int, must be greater than or equal to 0 and less than or equal to 4294967295') | |
return '{}.{}'.format(as_number // 65536, as_number % 65536) | |
# e.g. Convert 65020.10102 to 4261160822 | |
def convert_ASDOT_to_ASPLAIN(as_dot_number): | |
if not(isinstance(as_dot_number, str)) or as_dot_number.count('.') != 1: |