refactor and removed some self.log calls
This commit is contained in:
parent
d1d0fc86ab
commit
75bf9e209c
|
@ -384,7 +384,7 @@ class Bantracker(callbacks.Plugin):
|
||||||
self.lastMsgs[irc] = msg
|
self.lastMsgs[irc] = msg
|
||||||
|
|
||||||
def db_run(self, query, parms, expect_result = False, expect_id = False):
|
def db_run(self, query, parms, expect_result = False, expect_id = False):
|
||||||
self.log.debug("SQL: %q %s", query, parms)
|
#self.log.debug("SQL: %q %s", query, parms)
|
||||||
if not self.db:
|
if not self.db:
|
||||||
self.log.error("Bantracker database not open")
|
self.log.error("Bantracker database not open")
|
||||||
return
|
return
|
||||||
|
@ -404,7 +404,7 @@ class Bantracker(callbacks.Plugin):
|
||||||
if expect_result and cur: data = cur.fetchall()
|
if expect_result and cur: data = cur.fetchall()
|
||||||
if expect_id: data = self.db.insert_id()
|
if expect_id: data = self.db.insert_id()
|
||||||
self.db.commit()
|
self.db.commit()
|
||||||
self.log.debug("SQL return: %q", data)
|
#self.log.debug("SQL return: %q", data)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def requestComment(self, irc, channel, ban, type=None):
|
def requestComment(self, irc, channel, ban, type=None):
|
||||||
|
@ -429,22 +429,18 @@ class Bantracker(callbacks.Plugin):
|
||||||
op = ban.who
|
op = ban.who
|
||||||
if nickMatch(op, self.registryValue('request.forward', channel=channel)):
|
if nickMatch(op, self.registryValue('request.forward', channel=channel)):
|
||||||
channels = self.registryValue('request.forward.channels', channel=channel)
|
channels = self.registryValue('request.forward.channels', channel=channel)
|
||||||
if channels:
|
|
||||||
s = "Please somebody comment on the %s of %s in %s done by %s, use:"\
|
s = "Please somebody comment on the %s of %s in %s done by %s, use:"\
|
||||||
" %scomment %s <comment>" %(type, mask, channel, op, prefix, ban.id)
|
" %scomment %s <comment>" %(type, mask, channel, op, prefix, ban.id)
|
||||||
for chan in channels:
|
for chan in channels:
|
||||||
msg = ircmsgs.notice(chan, s)
|
msg = ircmsgs.notice(chan, s)
|
||||||
self.log.info('SENDING: %s' %msg)
|
|
||||||
irc.queueMsg(msg)
|
irc.queueMsg(msg)
|
||||||
return
|
return
|
||||||
# send to op
|
# send to op
|
||||||
s = "Please comment on the %s of %s in %s, use: %scomment %s <comment>" \
|
s = "Please comment on the %s of %s in %s, use: %scomment %s <comment>" \
|
||||||
%(type, mask, channel, prefix, ban.id)
|
%(type, mask, channel, prefix, ban.id)
|
||||||
self.log.info('SENDING: %s %s' %(op, s))
|
|
||||||
irc.reply(s, to=op, private=True)
|
irc.reply(s, to=op, private=True)
|
||||||
|
|
||||||
def reviewBans(self, irc=None):
|
def reviewBans(self, irc=None):
|
||||||
self.log.debug('Checking for bans that need review ...')
|
|
||||||
now = time.mktime(time.gmtime())
|
now = time.mktime(time.gmtime())
|
||||||
lastreview = self.pendingReviews.time
|
lastreview = self.pendingReviews.time
|
||||||
bansite = self.registryValue('bansite')
|
bansite = self.registryValue('bansite')
|
||||||
|
@ -481,7 +477,6 @@ class Bantracker(callbacks.Plugin):
|
||||||
if nickMatch(op, ignore):
|
if nickMatch(op, ignore):
|
||||||
# in the ignore list
|
# in the ignore list
|
||||||
continue
|
continue
|
||||||
self.log.debug(' adding ban to the pending review list ...')
|
|
||||||
if not ban.id:
|
if not ban.id:
|
||||||
ban.id = self.get_banId(ban.mask, channel)
|
ban.id = self.get_banId(ban.mask, channel)
|
||||||
if nickMatch(op, forward):
|
if nickMatch(op, forward):
|
||||||
|
|
Loading…
Reference in New Issue