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'):
"""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')
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: