From a87ce825ad90a7c52255c8262670b9c5488a4931 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Thu, 3 Nov 2016 11:35:30 +0000 Subject: [PATCH] [Core] Remove old geoip.dat code and fix log line --- deluge/core/preferencesmanager.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/deluge/core/preferencesmanager.py b/deluge/core/preferencesmanager.py index ef928ce8f..d166706b7 100644 --- a/deluge/core/preferencesmanager.py +++ b/deluge/core/preferencesmanager.py @@ -455,19 +455,16 @@ class PreferencesManager(component.Component): log.debug("%s: %s", key, value) self.session_set_setting("anonymous_mode", value) - def _on_set_geoip_db_location(self, key, geoip_db): - log.debug("%s: %s", key, geoip_db) + def _on_set_geoip_db_location(self, key, geoipdb_path): + log.debug("%s: %s", key, geoipdb_path) # Load the GeoIP DB for country look-ups if available - deluge_geoip_db = deluge.common.resource_filename("deluge", os.path.join("data", "GeoIP.dat")) - for geoip_path in (geoip_db, deluge_geoip_db): - if os.path.exists(geoip_path): - try: - self.core.geoip_instance = GeoIP.open(geoip_path, GeoIP.GEOIP_STANDARD) - except AttributeError: - log.warning("GeoIP Unavailable") - break + if os.path.exists(geoipdb_path): + try: + self.core.geoip_instance = GeoIP.open(geoipdb_path, GeoIP.GEOIP_STANDARD) + except AttributeError: + log.warning("GeoIP Unavailable") else: - log.warning("Unable to find GeoIP database file: %s") + log.warning("Unable to find GeoIP database file: %s", geoipdb_path) def _on_set_cache_size(self, key, value): log.debug("%s: %s", key, value)