1
0
Fork 0

DDG module: don't print an empty abstract each time

This commit is contained in:
Némunaire 2012-11-01 09:49:57 +01:00
parent 7d0d678f3b
commit f00dfc82f7
2 changed files with 5 additions and 2 deletions

View File

@ -62,7 +62,10 @@ class DDGSearch:
@property
def abstract(self):
try:
return self.ddgres.getNode("Abstract").getContent() + " <" + self.ddgres.getNode("AbstractURL").getContent() + ">"
if self.ddgres.getNode("Abstract").getContent() != "":
return self.ddgres.getNode("Abstract").getContent() + " <" + self.ddgres.getNode("AbstractURL").getContent() + ">"
else:
return None
except:
return None

View File

@ -102,7 +102,7 @@ def wiki(msg):
else:
lang = "en"
s = Wikipedia.Wikipedia(msg.cmd[1], lang)
s = Wikipedia.Wikipedia(' '.join(msg.cmd[1:]), lang)
res = Response(msg.sender, channel=msg.channel, nomore="No more results")
for result in s.nextRes: