Please test with the parse function changed from
def parse_ttn_gateway_info(lines)
to
def parse_ttn_gateway_info(info)