mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Multiple bugs that couldn't be tested while the dict.org server was down have now been tested, found, and eradicated.
This commit is contained in:
parent
b40a7e7757
commit
02b2eddd45
@ -23,12 +23,7 @@ version = '1.0'
|
|||||||
def dequote(s):
|
def dequote(s):
|
||||||
"""Will remove single or double quotes from the start and end of a string
|
"""Will remove single or double quotes from the start and end of a string
|
||||||
and return the result."""
|
and return the result."""
|
||||||
quotechars = "'\""
|
return s.strip('\'"')
|
||||||
while s and s[0] in quotechars:
|
|
||||||
s = s[1:]
|
|
||||||
while str and str[-1] in quotechars:
|
|
||||||
s = s[0:-1]
|
|
||||||
return s
|
|
||||||
|
|
||||||
def enquote(s):
|
def enquote(s):
|
||||||
"""This function will put a string in double quotes, properly
|
"""This function will put a string in double quotes, properly
|
||||||
|
@ -85,7 +85,7 @@ class Dict(callbacks.Privmsg, plugins.Configurable):
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
conn = dictclient.Connection(self.configurables.get('server'))
|
conn = dictclient.Connection(self.configurables.get('server'))
|
||||||
dbs = conf.getdbdescs()
|
dbs = conn.getdbdescs().keys()
|
||||||
dbs.sort()
|
dbs.sort()
|
||||||
irc.reply(msg, utils.commaAndify(dbs))
|
irc.reply(msg, utils.commaAndify(dbs))
|
||||||
except socket.timeout:
|
except socket.timeout:
|
||||||
@ -98,7 +98,7 @@ class Dict(callbacks.Privmsg, plugins.Configurable):
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
conn = dictclient.Connection(self.configurables.get('server'))
|
conn = dictclient.Connection(self.configurables.get('server'))
|
||||||
dbs = conf.getdbdescs()
|
dbs = conn.getdbdescs().keys()
|
||||||
irc.reply(msg, random.choice(dbs))
|
irc.reply(msg, random.choice(dbs))
|
||||||
except socket.timeout:
|
except socket.timeout:
|
||||||
irc.error(msg, replyTimeout)
|
irc.error(msg, replyTimeout)
|
||||||
|
Loading…
Reference in New Issue
Block a user