mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +01:00
plugins/Unix: Keep track of two lines in Unix.spell since aspell sometimes list suggestions after a '*' or '+' line.
This commit is contained in:
parent
1edb4e13bf
commit
0367ae5615
@ -154,6 +154,10 @@ class Unix(callbacks.Plugin):
|
||||
# aspell puts extra whitespace, ignore it
|
||||
while not line.strip('\r\n'):
|
||||
line = pipeReadline(r)
|
||||
# cache an extra line in case aspell's first line says the word
|
||||
# is spelled correctly, but subsequent lines offer spelling
|
||||
# suggestions
|
||||
line2 = pipeReadline(r)
|
||||
except TimeoutError:
|
||||
irc.error('The spell command timed out.')
|
||||
return
|
||||
@ -162,6 +166,10 @@ class Unix(callbacks.Plugin):
|
||||
w.close()
|
||||
inst.wait()
|
||||
# parse the output
|
||||
# aspell will sometimes list spelling suggestions after a '*' or '+'
|
||||
# line for complex words.
|
||||
if line[0] in '*+' and line2.strip('\r\n'):
|
||||
line = line2
|
||||
if line[0] in '*+':
|
||||
resp = format('%q may be spelled correctly.', word)
|
||||
elif line[0] == '#':
|
||||
|
Loading…
Reference in New Issue
Block a user