From 14eb6b3d8427a35bc7d9f8dfd560b599e12dd484 Mon Sep 17 00:00:00 2001 From: Cameron Dale Date: Tue, 8 Jan 2008 12:38:58 -0800 Subject: [PATCH] No need to look at the DEFAULT section when parsing the config. --- apt_dht_Khashmir/DHT.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apt_dht_Khashmir/DHT.py b/apt_dht_Khashmir/DHT.py index 3d6c9f9..cfe07f0 100644 --- a/apt_dht_Khashmir/DHT.py +++ b/apt_dht_Khashmir/DHT.py @@ -32,7 +32,7 @@ class DHT: self.config_parser = config self.section = section self.config = {} - self.cache_dir = self.config_parser.get('DEFAULT', 'cache_dir') + self.cache_dir = self.config_parser.get(section, 'cache_dir') self.bootstrap = self.config_parser.getstringlist(section, 'BOOTSTRAP') self.bootstrap_node = self.config_parser.getboolean(section, 'BOOTSTRAP_NODE') for k in self.config_parser.options(section): @@ -44,8 +44,6 @@ class DHT: self.config[k] = self.config_parser.gettime(section, k) else: self.config[k] = self.config_parser.get(section, k) - if 'PORT' not in self.config: - self.config['PORT'] = self.config_parser.getint('DEFAULT', 'PORT') def join(self): """See L{apt_dht.interfaces.IDHT}.""" -- 2.39.5