From 9e59f81b9db168eb2391c73b427b0dfce86b0ab4 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Mon, 5 Mar 2018 16:00:04 +0900 Subject: [PATCH] read only line format change Instead of complex string building, use the standard format() call to set lengths before we use it to replace it with actual data --- bin/reverse_geolocate.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/reverse_geolocate.py b/bin/reverse_geolocate.py index c000b91..b534b59 100755 --- a/bin/reverse_geolocate.py +++ b/bin/reverse_geolocate.py @@ -685,7 +685,16 @@ if args.read_only: # after how many lines do we reprint the header header_repeat = 40; # the formatted line for the output - format_line = " {filename:<" + str(format_length['filename']) + "} | {latitude:>" + str(format_length['latitude']) + "} | {longitude:>" + str(format_length['longitude']) + "} | {code:<" + str(format_length['code']) + "} | {country:<" + str(format_length['country']) + "} | {state:<" + str(format_length['state']) + "} | {city:<" + str(format_length['city']) + "} | {location:<" + str(format_length['location']) + "} " + format_line = " {{filename:<{}}} | {{latitude:>{}}} | {{longitude:>{}}} | {{code:<{}}} | {{country:<{}}} | {{state:<{}}} | {{city:<{}}} | {{location:<{}}} ".format( + format_length['filename'], + format_length['latitude'], + format_length['longitude'], + format_length['code'], + format_length['country'], + format_length['state'], + format_length['city'], + format_length['location'] + ) # header line header = format_line.format( filename = "File",