This commit is contained in:
Nicolas Coevoet 2013-10-27 18:40:18 +01:00
parent b3f9270f37
commit 3f03a7e096
4 changed files with 27 additions and 32 deletions

View File

@ -1,5 +1,5 @@
### ###
# Copyright (c) 2013, nicolas coevoet # Copyright (c) 2013, Nicolas Coevoet
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -37,7 +37,7 @@ import supybot.world as world
# Use this for the version of this plugin. You may wish to put a CVS keyword # Use this for the version of this plugin. You may wish to put a CVS keyword
# in here if you're keeping the plugin in CVS or some similar system. # in here if you're keeping the plugin in CVS or some similar system.
__version__ = "0.4" __version__ = "0.5"
# XXX Replace this with an appropriate author or supybot.Author instance. # XXX Replace this with an appropriate author or supybot.Author instance.
__author__ = supybot.authors.unknown __author__ = supybot.authors.unknown
@ -47,7 +47,7 @@ __author__ = supybot.authors.unknown
__contributors__ = {} __contributors__ = {}
# This is a url where the most recent plugin package can be downloaded. # This is a url where the most recent plugin package can be downloaded.
__url__ = '' # 'http://supybot.com/Members/yourname/ListTracker/download' __url__ = 'https://github.com/ncoevoet/ChanTracker'
from . import config from . import config
from . import plugin from . import plugin
@ -61,6 +61,3 @@ if world.testing:
Class = plugin.Class Class = plugin.Class
configure = config.configure configure = config.configure
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:

View File

@ -1,5 +1,5 @@
### ###
# Copyright (c) 2013, nicolas coevoet # Copyright (c) 2013, Nicolas Coevoet
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without

View File

@ -1128,7 +1128,7 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
pending = wrap(pending,['op',additional('letter'),optional('hostmask')]) pending = wrap(pending,['op',additional('letter'),optional('hostmask')])
def do (self,irc,msg,args,channel,mode,items,seconds,reason): def do (self,irc,msg,args,channel,mode,items,seconds,reason):
"""[<channel>] <mode> <nick|hostmask>[,<nick|hostmask>] [<years>y] [<weeks>w] [<days>d] [<hours>h] [<minutes>m] [<seconds>s] [<-1> or empty means forever] <reason> """[<channel>] <mode> <nick|hostmask>[,<nick|hostmask>] [<years>y] [<weeks>w] [<days>d] [<hours>h] [<minutes>m] [<seconds>s] [<-1s> or empty means forever] <reason>
+<mode> targets for duration <reason> is mandatory""" +<mode> targets for duration <reason> is mandatory"""
if mode in self.registryValue('modesToAsk') or mode in self.registryValue('modesToAskWhenOpped'): if mode in self.registryValue('modesToAsk') or mode in self.registryValue('modesToAskWhenOpped'):
@ -1144,7 +1144,7 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
do = wrap(do,['op','letter',commalist('something'),any('getTs',True),rest('text')]) do = wrap(do,['op','letter',commalist('something'),any('getTs',True),rest('text')])
def q (self,irc,msg,args,channel,items,seconds,reason): def q (self,irc,msg,args,channel,items,seconds,reason):
"""[<channel>] <nick|hostmask>[,<nick|hostmask>] [<years>y] [<weeks>w] [<days>d] [<hours>h] [<minutes>m] [<seconds>s] [<-1> or empty means forever] <reason> """[<channel>] <nick|hostmask>[,<nick|hostmask>] [<years>y] [<weeks>w] [<days>d] [<hours>h] [<minutes>m] [<seconds>s] [<-1s> or empty means forever] <reason>
+q targets for duration reason is mandatory""" +q targets for duration reason is mandatory"""
b = self._adds(irc,msg,args,channel,'q',items,getDuration(seconds),reason) b = self._adds(irc,msg,args,channel,'q',items,getDuration(seconds),reason)
@ -1156,7 +1156,7 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
q = wrap(q,['op',commalist('something'),any('getTs',True),rest('text')]) q = wrap(q,['op',commalist('something'),any('getTs',True),rest('text')])
def b (self, irc, msg, args, channel, items, seconds,reason): def b (self, irc, msg, args, channel, items, seconds,reason):
"""[<channel>] <nick|hostmask>[,<nick|hostmask>] [<years>y] [<weeks>w] [<days>d] [<hours>h] [<minutes>m] [<seconds>s] [<-1> or empty means forever] <reason> """[<channel>] <nick|hostmask>[,<nick|hostmask>] [<years>y] [<weeks>w] [<days>d] [<hours>h] [<minutes>m] [<seconds>s] [<-1s> or empty means forever] <reason>
+b targets for duration reason is mandatory""" +b targets for duration reason is mandatory"""
b = self._adds(irc,msg,args,channel,'b',items,getDuration(seconds),reason) b = self._adds(irc,msg,args,channel,'b',items,getDuration(seconds),reason)
@ -1168,7 +1168,7 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
b = wrap(b,['op',commalist('something'),any('getTs',True),rest('text')]) b = wrap(b,['op',commalist('something'),any('getTs',True),rest('text')])
def i (self, irc, msg, args, channel, items, seconds): def i (self, irc, msg, args, channel, items, seconds):
"""[<channel>] <nick|hostmask>[,<nick|hostmask>] [<years>y] [<weeks>w] [<days>d] [<hours>h] [<minutes>m] [<seconds>s] [<-1> or empty means forever] <reason> """[<channel>] <nick|hostmask>[,<nick|hostmask>] [<years>y] [<weeks>w] [<days>d] [<hours>h] [<minutes>m] [<seconds>s] [<-1s> or empty means forever] <reason>
+I targets for duration reason is mandatory""" +I targets for duration reason is mandatory"""
b = self._adds(irc,msg,args,channel,'I',items,getDuration(seconds),reason) b = self._adds(irc,msg,args,channel,'I',items,getDuration(seconds),reason)
@ -1180,7 +1180,7 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
i = wrap(i,['op',commalist('something'),any('getTs',True),rest('text')]) i = wrap(i,['op',commalist('something'),any('getTs',True),rest('text')])
def e (self, irc, msg, args, channel, items,seconds,reason): def e (self, irc, msg, args, channel, items,seconds,reason):
"""[<channel>] <nick|hostmask>[,<nick|hostmask>] [<years>y] [<weeks>w] [<days>d] [<hours>h] [<minutes>m] [<seconds>s] [<-1> or empty means forever] <reason> """[<channel>] <nick|hostmask>[,<nick|hostmask>] [<years>y] [<weeks>w] [<days>d] [<hours>h] [<minutes>m] [<seconds>s] [<-1s> or empty means forever] <reason>
+e targets for duration reason is mandatory""" +e targets for duration reason is mandatory"""
b = self._adds(irc,msg,args,channel,'e',items,getDuration(seconds),reason) b = self._adds(irc,msg,args,channel,'e',items,getDuration(seconds),reason)
@ -1848,6 +1848,7 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
removeNick = True removeNick = True
if not isBot: if not isBot:
n = self.getNick(irc,msg.nick) n = self.getNick(irc,msg.nick)
best = getBestPattern(n)[0]
if reason: if reason:
n.addLog('ALL','has quit [%s]' % reason) n.addLog('ALL','has quit [%s]' % reason)
else: else:
@ -1863,7 +1864,6 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
if nick == msg.nick: if nick == msg.nick:
self._logChan(irc,channel,'[%s] %s has quit (%s)' % (channel,msg.prefix,reason)) self._logChan(irc,channel,'[%s] %s has quit (%s)' % (channel,msg.prefix,reason))
break break
best = getBestPattern(n)[0]
if best and not self._isVip(irc,channel,n): if best and not self._isVip(irc,channel,n):
isCycle = self._isSomething(irc,channel,best,'cycle') isCycle = self._isSomething(irc,channel,best,'cycle')
if isCycle: if isCycle:

View File

@ -1,5 +1,5 @@
### ###
# Copyright (c) 2013, nicolas coevoet # Copyright (c) 2013, Nicolas Coevoet
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -33,5 +33,3 @@ from supybot.test import *
class ListTrackerTestCase(PluginTestCase): class ListTrackerTestCase(PluginTestCase):
plugins = ('ChanTracker',) plugins = ('ChanTracker',)
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: