mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Changed not to use onStart.
This commit is contained in:
parent
3e08f7b80f
commit
3d186a1478
@ -66,7 +66,7 @@ def configure(advanced):
|
||||
to run the file command. I'll disable this command
|
||||
now. When you get zegrep in your path, use the command
|
||||
"enable file" to re-enable the command.""")
|
||||
onStart.append('disable file')
|
||||
conf.supybot.defaultCapabilities().add('Debian.file')
|
||||
else:
|
||||
output("""I can't find zegrep in your path. If you want to run
|
||||
the file command with any sort of expediency, you'll
|
||||
@ -77,7 +77,7 @@ def configure(advanced):
|
||||
conf.supybot.plugins.Debian.pythonZegrep.setValue(True)
|
||||
else:
|
||||
output('I\'ll disable file now.')
|
||||
onStart.append('disable file')
|
||||
conf.supybot.defaultCapabilities().add('Debian.file')
|
||||
|
||||
conf.registerPlugin('Debian')
|
||||
conf.registerGlobalValue(conf.supybot.plugins.Debian, 'pythonZegrep',
|
||||
|
@ -95,9 +95,6 @@ def configure(advanced):
|
||||
output('You can still use the Google module, but you won\'t '
|
||||
'have these extra commands enabled.')
|
||||
return
|
||||
onStart.append('alias add googlelinux "google --restrict=linux $1"')
|
||||
onStart.append('alias add googlebsd "google --restrict=bsd $1"')
|
||||
onStart.append('alias add googlemac "google --restrict=mac $1"')
|
||||
else:
|
||||
output("""You'll need to get a key before you can use this plugin.
|
||||
You can apply for a key at http://www.google.com/apis/""")
|
||||
|
@ -88,7 +88,6 @@ def configure(advanced):
|
||||
continue
|
||||
command = something('What would you like the command to be?')
|
||||
conf.registerGlobalValue(lookups,command, registry.String(filename,''))
|
||||
onStart.append('lookup add %s %s' % (command, filename))
|
||||
|
||||
|
||||
conf.registerPlugin('Lookup')
|
||||
|
@ -52,48 +52,31 @@ import callbacks
|
||||
def configure(advanced):
|
||||
from questions import something, yn
|
||||
conf.registerPlugin('Parter', True)
|
||||
s = ' '
|
||||
while s:
|
||||
channel = ' '
|
||||
while channel:
|
||||
L = []
|
||||
if yn('Would you like to automatically part a channel?'):
|
||||
s = something('What channel?')
|
||||
channel = something('What channel?')
|
||||
while not ircutils.isChannel(s):
|
||||
output('That\'s not a valid channel.')
|
||||
s = something('What channel?')
|
||||
onStart.append('autopartchannel %s' % s)
|
||||
channel = something('What channel?')
|
||||
L.append(channel)
|
||||
else:
|
||||
s = ''
|
||||
channel = ''
|
||||
conf.supybot.plugins.Parter.channels.setValue(L)
|
||||
|
||||
conf.registerPlugin('Parter')
|
||||
conf.registerGlobalValue(conf.supybot.plugins.Parter, 'channels',
|
||||
conf.SpaceSeparatedListOfChannels([], """Determines what channels the bot
|
||||
will automatically part whenever it joins them."""))
|
||||
|
||||
class Parter(callbacks.Privmsg):
|
||||
def __init__(self):
|
||||
super(self.__class__, self).__init__()
|
||||
self.channels = sets.Set([])
|
||||
|
||||
def autopart(self, irc, msg, args):
|
||||
"""<channel>
|
||||
|
||||
|
||||
Makes the bot part <channel> automatically, as soon as he joins it.
|
||||
"""
|
||||
channel = privmsgs.getArgs(args)
|
||||
self.channels.add(channel)
|
||||
irc.replySuccess()
|
||||
autopart = privmsgs.checkCapability(autopart, 'admin')
|
||||
|
||||
def removeautopart(self, irc, msg, args):
|
||||
"""<channel>
|
||||
|
||||
Removes the channel from the auto-part list.
|
||||
"""
|
||||
channel = privmsgs.getArgs(args)
|
||||
self.channels.discard(channel)
|
||||
irc.replySuccess()
|
||||
removeautopart = privmsgs.checkCapability(removeautopart, 'admin')
|
||||
|
||||
def doJoin(self, irc, msg):
|
||||
if irc.nick == msg.nick:
|
||||
channels = msg.args[0].split(',')
|
||||
autoParts = self.registryValue('channels')
|
||||
for channel in channels:
|
||||
if channel in self.channels:
|
||||
if channel in autoParts:
|
||||
irc.sendMsg(ircmsgs.part(channel))
|
||||
|
||||
|
||||
|
@ -48,6 +48,7 @@ __revision__ = "$Id$"
|
||||
import plugins
|
||||
import ircutils
|
||||
import privmsgs
|
||||
import registry
|
||||
import webutils
|
||||
import callbacks
|
||||
|
||||
@ -90,7 +91,8 @@ def configure(advanced):
|
||||
else:
|
||||
output('Then I can\'t add such an alias.')
|
||||
return
|
||||
onStart.append('alias add sf sourceforge $*')
|
||||
conf.supybot.plugins.Alias.aliases.register('sf',
|
||||
registry.String('sourceforge $*', ''))
|
||||
|
||||
class TrackerError(Exception):
|
||||
pass
|
||||
|
@ -65,14 +65,14 @@ def configure(advanced):
|
||||
function of this module will not work. You may choose to
|
||||
install it later. To re-enable this command then, remove
|
||||
the "disable spell" line from your configuration file.""")
|
||||
onStart.append('disable spell')
|
||||
conf.supybot.defaultCapabilities().add('Unix.spell')
|
||||
fortuneCmd = utils.findBinaryInPath('fortune')
|
||||
if not fortuneCmd:
|
||||
output("""NOTE: I couldn't find fortune in your path, so that function
|
||||
of this module will not work. You may choose to install it
|
||||
later. To re-enable this command then, remove the
|
||||
'"disable fortune" command from your configuration file.""")
|
||||
onStart.append('disable fortune')
|
||||
conf.supybot.defaultCapabilities().add('Unix.fortune')
|
||||
wtfCmd = utils.findBinaryInPath('wtf')
|
||||
if not wtfCmd:
|
||||
output("""NOTE: I couldn't find wtf in your path, so that function of
|
||||
@ -80,14 +80,14 @@ def configure(advanced):
|
||||
to re-enable this command then, remove the "disable wtf"
|
||||
command from your configuration file or simply tell the bot
|
||||
"enable wtf" instead.""")
|
||||
onStart.append('disable wtf')
|
||||
conf.supybot.defaultCapabilities().add('Unix.wtf')
|
||||
output("""The "progstats" command can reveal potentially sensitive
|
||||
information about your machine. Here's an example of its output:
|
||||
|
||||
%s\n""" % progstats())
|
||||
if yn('Would you like to disable this command for non-owner users?',
|
||||
default=True):
|
||||
onStart.append('disable progstats')
|
||||
conf.supybot.defaultCapabilities().add('Unix.progstats')
|
||||
|
||||
def progstats():
|
||||
pw = pwd.getpwuid(os.getuid())
|
||||
|
Loading…
Reference in New Issue
Block a user