From: Cameron Dale Date: Thu, 3 Jan 2008 23:51:22 +0000 (-0800) Subject: Fixed some minor bugs. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=afd9fc11f10f380a46153e525f53d8636f5b4f50;p=quix0rs-apt-p2p.git Fixed some minor bugs. --- 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: