mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-30 22:24:20 +01:00
Wrong pluralization in karma.
This commit is contained in:
parent
0415251146
commit
5cacbfb18a
@ -276,7 +276,7 @@ class ChannelDB(callbacks.PrivmsgCommandAndRegexp, ChannelDBHandler):
|
|||||||
(seen, m) = cursor.fetchone()
|
(seen, m) = cursor.fetchone()
|
||||||
seen = int(seen)
|
seen = int(seen)
|
||||||
s = '%s was last seen here %s ago saying %r' % \
|
s = '%s was last seen here %s ago saying %r' % \
|
||||||
(name, utils.timeElapsed(time.time(), seen), m)
|
(name, utils.timeElapsed(time.time() - seen), m)
|
||||||
irc.reply(msg, s)
|
irc.reply(msg, s)
|
||||||
|
|
||||||
def karma(self, irc, msg, args):
|
def karma(self, irc, msg, args):
|
||||||
@ -297,9 +297,11 @@ class ChannelDB(callbacks.PrivmsgCommandAndRegexp, ChannelDBHandler):
|
|||||||
else:
|
else:
|
||||||
(added, subtracted) = cursor.fetchone()
|
(added, subtracted) = cursor.fetchone()
|
||||||
total = added - subtracted
|
total = added - subtracted
|
||||||
irc.reply(msg, '%s\'s karma has been increased %s times ' \
|
irc.reply(msg, '%s\'s karma has been increased %s %s ' \
|
||||||
'and decreased %s times for a total karma of %s' % \
|
'and decreased %s %s for a total karma of %s.' % \
|
||||||
(name, added, subtracted, total))
|
(name, added, added == 1 and 'time' or 'times',
|
||||||
|
subtracted, subtracted == 1 and 'time' or 'times',
|
||||||
|
total))
|
||||||
|
|
||||||
def increaseKarma(self, irc, msg, match):
|
def increaseKarma(self, irc, msg, match):
|
||||||
r"^(.*?)\+\+"
|
r"^(.*?)\+\+"
|
||||||
@ -307,7 +309,7 @@ class ChannelDB(callbacks.PrivmsgCommandAndRegexp, ChannelDBHandler):
|
|||||||
name = match.group(1)
|
name = match.group(1)
|
||||||
db = self.getDb(msg.args[0])
|
db = self.getDb(msg.args[0])
|
||||||
cursor = db.cursor()
|
cursor = db.cursor()
|
||||||
cursor.execute("""INSERT INTO karma VALUES (NULL, %s, 1, 0)""", name)
|
cursor.execute("""INSERT INTO karma VALUES (NULL, %s, 0, 0)""", name)
|
||||||
cursor.execute("""UPDATE karma SET added=added+1 WHERE name=%s""",name)
|
cursor.execute("""UPDATE karma SET added=added+1 WHERE name=%s""",name)
|
||||||
|
|
||||||
def decreaseKarma(self, irc, msg, match):
|
def decreaseKarma(self, irc, msg, match):
|
||||||
@ -316,7 +318,7 @@ class ChannelDB(callbacks.PrivmsgCommandAndRegexp, ChannelDBHandler):
|
|||||||
name = match.group(1)
|
name = match.group(1)
|
||||||
db = self.getDb(msg.args[0])
|
db = self.getDb(msg.args[0])
|
||||||
cursor = db.cursor()
|
cursor = db.cursor()
|
||||||
cursor.execute("""INSERT INTO karma VALUES (NULL, %s, 0, 1)""", name)
|
cursor.execute("""INSERT INTO karma VALUES (NULL, %s, 0, 0)""", name)
|
||||||
cursor.execute("""UPDATE karma
|
cursor.execute("""UPDATE karma
|
||||||
SET subtracted=subtracted+1
|
SET subtracted=subtracted+1
|
||||||
WHERE name=%s""", name)
|
WHERE name=%s""", name)
|
||||||
|
Loading…
Reference in New Issue
Block a user