From 7903c754e17bfece3f30b3daebd09cdba7d58457 Mon Sep 17 00:00:00 2001 From: bai Date: Fri, 27 Mar 2020 22:21:25 -0300 Subject: Country --- cgi/framework.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cgi/framework.py') diff --git a/cgi/framework.py b/cgi/framework.py index 9c95cc1..f90ed92 100644 --- a/cgi/framework.py +++ b/cgi/framework.py @@ -89,6 +89,9 @@ def addressIsES(ip): 'GY', 'GT', 'HN', 'MX', 'NI', 'PA', 'PE', 'PY', 'PR', 'SR', 'UY', 'VE'] # 'BR', return getCountry(ip) in ES +def addressIsUS(ip): + return getCountry(ip) == 'US' + def getCountry(ip): import geoip return geoip.country(ip) -- cgit v1.2.1-18-gbd029