mirror of
https://github.com/chubin/wttr.in.git
synced 2025-08-14 15:58:27 +02:00
Add location[2] to ipcachewrite for new region part of cache
This commit is contained in:
@ -94,7 +94,8 @@ def ipcachewrite(ip_addr, location):
|
|||||||
if not os.path.exists(IP2LCACHE):
|
if not os.path.exists(IP2LCACHE):
|
||||||
os.makedirs(IP2LCACHE)
|
os.makedirs(IP2LCACHE)
|
||||||
with open(cached, 'w') as file:
|
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):
|
def ipcache(ip_addr):
|
||||||
cached = os.path.join(IP2LCACHE, ip_addr)
|
cached = os.path.join(IP2LCACHE, ip_addr)
|
||||||
|
Reference in New Issue
Block a user