From 4fa1ebd9957c51bfbbdffd90b08d972aa74971f5 Mon Sep 17 00:00:00 2001 From: Gregory Danielson Date: Sun, 1 Nov 2020 15:03:14 -0600 Subject: [PATCH] Add location[2] to ipcachewrite for new region part of cache --- lib/location.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/location.py b/lib/location.py index 6be90dd..8a19eaf 100644 --- a/lib/location.py +++ b/lib/location.py @@ -94,7 +94,8 @@ def ipcachewrite(ip_addr, location): if not os.path.exists(IP2LCACHE): os.makedirs(IP2LCACHE) with open(cached, 'w') as file: - file.write(location[0] + ';' + location[1]) + file.write(location[0] + ';' + location[1] + ';' + location[2]) + # like ip2location format, but reversed def ipcache(ip_addr): cached = os.path.join(IP2LCACHE, ip_addr)