From afd9fc11f10f380a46153e525f53d8636f5b4f50 Mon Sep 17 00:00:00 2001 From: Cameron Dale Date: Thu, 3 Jan 2008 15:51:22 -0800 Subject: [PATCH] Fixed some minor bugs. --- apt-dht.py | 2 +- apt_dht_Khashmir/DHT.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apt-dht.py b/apt-dht.py index 0742589..67f7ab5 100644 --- a/apt-dht.py +++ b/apt-dht.py @@ -57,7 +57,7 @@ service.IProcess(application).processName = 'apt-dht' DHT = __import__(config.get('DEFAULT', 'DHT')+'.DHT', globals(), locals(), ['DHT']) assert(IDHT.implementedBy(DHT.DHT), "You must provide a DHT implementation that implements the IDHT interface.") myDHT = DHT.DHT() -myDHT.loadConfig(config) +myDHT.loadConfig(config, config.get('DEFAULT', 'DHT')) myDHT.join() if not config.getboolean('DEFAULT', 'DHT-only'): diff --git a/apt_dht_Khashmir/DHT.py b/apt_dht_Khashmir/DHT.py index 087201e..51fccc4 100644 --- a/apt_dht_Khashmir/DHT.py +++ b/apt_dht_Khashmir/DHT.py @@ -30,7 +30,7 @@ class DHT: """See L{apt_dht.interfaces.IDHT}.""" self.config_parser = config self.section = section - self.config = [] + self.config = {} self.cache_dir = self.config_parser.get('DEFAULT', 'cache_dir') self.bootstrap = self.config_parser.getstringlist(section, 'BOOTSTRAP') self.bootstrap_node = self.config_parser.getboolean(section, 'BOOTSTRAP_NODE') @@ -105,7 +105,7 @@ class DHT: self.retrieving.setdefault(key, []).append(d) return d - def _getValue(self, key, result = -1): + def _getValue(self, key, result): if result: self.retrieved.setdefault(key, []).extend(result) else: -- 2.39.5