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