summaryrefslogtreecommitdiff
path: root/src/leap/util/geo.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-03-06 15:27:23 -0300
committerTomás Touceda <chiiph@leap.se>2013-03-06 15:27:23 -0300
commit5ff29dc57e2877a14e705d09b7042cddf4165d0a (patch)
tree18e5817a105f0aaa7a9a752f7b644e44a6c867bc /src/leap/util/geo.py
parente23553caaf93a734578b02f9130dee38161d0e22 (diff)
Remove everything to start from scratch
Diffstat (limited to 'src/leap/util/geo.py')
-rw-r--r--src/leap/util/geo.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/leap/util/geo.py b/src/leap/util/geo.py
deleted file mode 100644
index 54b29596..00000000
--- a/src/leap/util/geo.py
+++ /dev/null
@@ -1,32 +0,0 @@
-"""
-experimental geo support.
-not yet a feature.
-in debian, we rely on the (optional) geoip-database
-"""
-import os
-import platform
-
-from leap.util import HAS_GEOIP
-
-GEOIP = None
-
-if HAS_GEOIP:
- import pygeoip # we know we can :)
-
- GEOIP_PATH = None
-
- if platform.system() == "Linux":
- PATH = "/usr/share/GeoIP/GeoIP.dat"
- if os.path.isfile(PATH):
- GEOIP_PATH = PATH
- GEOIP = pygeoip.GeoIP(GEOIP_PATH, pygeoip.MEMORY_CACHE)
-
-
-def get_country_name(ip):
- if not GEOIP:
- return
- try:
- country = GEOIP.country_name_by_addr(ip)
- except pygeoip.GeoIPError:
- country = None
- return country if country else "-"