Fallback to using DNS for geoip lookups if the database file is not

available
This commit is contained in:
Andrew Resch 2008-11-25 22:43:31 +00:00
parent 4eedc1b23e
commit 66ae89122d
2 changed files with 5 additions and 4 deletions

View File

@ -165,9 +165,10 @@ class Core(
# Load the session state if available # Load the session state if available
self.load_session_state() self.load_session_state()
# Load the GeoIP DB for country look-ups # Load the GeoIP DB for country look-ups if available
self.session.load_country_db( geoip_db = pkg_resources.resource_filename("deluge", os.path.join("data", "GeoIP.dat"))
pkg_resources.resource_filename("deluge", os.path.join("data", "GeoIP.dat"))) if os.path.exists(geoip_db):
self.session.load_country_db(geoip_db)
# Set the user agent # Set the user agent
self.settings = lt.session_settings() self.settings = lt.session_settings()

View File

@ -344,7 +344,7 @@ setup(
author = "Andrew Resch, Marcos Pinto, Martijn Voncken, Sadrul Habib Chowdhury", author = "Andrew Resch, Marcos Pinto, Martijn Voncken, Sadrul Habib Chowdhury",
author_email = "andrewresch@gmail.com, markybob@dipconsultants.com, \ author_email = "andrewresch@gmail.com, markybob@dipconsultants.com, \
mvoncken@gmail.com, sadrul@users.sourceforge.net", mvoncken@gmail.com, sadrul@users.sourceforge.net",
cmdclass=cmdclass, cmdclass = cmdclass,
data_files = _data_files, data_files = _data_files,
description = "Bittorrent Client", description = "Bittorrent Client",
entry_points = """ entry_points = """