mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-04 17:09:24 +01:00
Weed out the last of the floating point COUNT bugs
This commit is contained in:
parent
42f279cb6e
commit
ca9f696c8c
@ -171,9 +171,9 @@ class Infobot(callbacks.PrivmsgRegexp):
|
|||||||
r"^info$"
|
r"^info$"
|
||||||
cursor = self.db.cursor()
|
cursor = self.db.cursor()
|
||||||
cursor.execute("SELECT COUNT(*) FROM is_factoids")
|
cursor.execute("SELECT COUNT(*) FROM is_factoids")
|
||||||
numIs = cursor.fetchone()[0]
|
numIs = int(cursor.fetchone()[0])
|
||||||
cursor.execute("SELECT COUNT(*) FROM are_factoids")
|
cursor.execute("SELECT COUNT(*) FROM are_factoids")
|
||||||
numAre = cursor.fetchone()[0]
|
numAre = int(cursor.fetchone()[0])
|
||||||
s = 'I have %s is factoids and %s are factoids' % (numIs, numAre)
|
s = 'I have %s is factoids and %s are factoids' % (numIs, numAre)
|
||||||
irc.reply(s)
|
irc.reply(s)
|
||||||
|
|
||||||
|
@ -309,8 +309,9 @@ class URL(callbacks.PrivmsgCommandAndRegexp,
|
|||||||
cursor = db.cursor()
|
cursor = db.cursor()
|
||||||
cursor.execute("""SELECT COUNT(*) FROM urls""")
|
cursor.execute("""SELECT COUNT(*) FROM urls""")
|
||||||
(count,) = cursor.fetchone()
|
(count,) = cursor.fetchone()
|
||||||
|
count = int(count)
|
||||||
irc.reply('I have %s %s in my database.' %
|
irc.reply('I have %s %s in my database.' %
|
||||||
(count, int(count) == 1 and 'URL' or 'URLs'))
|
(count, count == 1 and 'URL' or 'URLs'))
|
||||||
|
|
||||||
def last(self, irc, msg, args):
|
def last(self, irc, msg, args):
|
||||||
"""[<channel>] [--{from,with,at,proto,near}=<value>] --{nolimit,fancy}
|
"""[<channel>] [--{from,with,at,proto,near}=<value>] --{nolimit,fancy}
|
||||||
|
Loading…
Reference in New Issue
Block a user