mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-10 20:22:36 +01:00
Dict: Fix lookup of some words (looks like dict.org does not follow RFC2229). Closes GH-494.
This commit is contained in:
parent
80b4e164ec
commit
58261e78c7
@ -54,6 +54,8 @@ class Connection:
|
||||
consisting of two items: the integer result code and the text
|
||||
following. You will not usually use this function directly."""
|
||||
line = self.rfile.readline().decode('utf8').strip()
|
||||
if line.startswith('['):
|
||||
return [None, line]
|
||||
code, text = line.split(' ', 1)
|
||||
return [int(code), text]
|
||||
|
||||
@ -194,7 +196,7 @@ class Connection:
|
||||
|
||||
while 1:
|
||||
code, text = self.getresultcode()
|
||||
if code != 151:
|
||||
if code != 151 or code is None:
|
||||
break
|
||||
|
||||
resultword, resultdb = re.search('^"(.+)" (\S+)', text).groups()
|
||||
|
@ -35,6 +35,7 @@ class DictTestCase(PluginTestCase):
|
||||
if network:
|
||||
def testDict(self):
|
||||
self.assertNotError('dict slash')
|
||||
self.assertNotError('dict flutter')
|
||||
self.assertNotRegexp('dict web1913 slash', 'foldoc')
|
||||
self.assertError('dict ""')
|
||||
self.assertRegexp('dict eng-fra school', 'école')
|
||||
|
Loading…
Reference in New Issue
Block a user