mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 20:59:27 +01:00
Lots of wizard updates. Still have to get rid of the onStart and
afterConnect stuff though.
This commit is contained in:
parent
03c46445d7
commit
5957eaad5d
@ -50,20 +50,17 @@ import callbacks
|
||||
|
||||
|
||||
def configure(advanced):
|
||||
# This will be called by setup.py to configure this module. onStart and
|
||||
# afterConnect are both lists. Append to onStart the commands you would
|
||||
# like to be run when the bot is started; append to afterConnect the
|
||||
# commands you would like to be run when the bot has finished connecting.
|
||||
from questions import expect, anything, something, yn
|
||||
print 'To use Amazon\'s Web Services, you must have a license key.'
|
||||
if yn('Do you have a license key?') == 'y':
|
||||
output('To use Amazon\'s Web Services, you must have a license key.')
|
||||
if yn('Do you have a license key?'):
|
||||
key = anything('What is it?')
|
||||
|
||||
conf.registerPlugin('Amazon', True)
|
||||
conf.supybot.plugins.Amazon.licenseKey.set(key)
|
||||
else:
|
||||
print 'You\'ll need to get a key before you can use this plugin.'
|
||||
print 'You can apply for a key at http://www.amazon.com/webservices/'
|
||||
output("""You'll need to get a key before you can use this plugin.
|
||||
You can apply for a key at
|
||||
http://www.amazon.com/webservices/""")
|
||||
|
||||
class LicenseKey(registry.String):
|
||||
def set(self, s):
|
||||
|
@ -51,7 +51,7 @@ import callbacks
|
||||
def configure(advanced):
|
||||
from questions import expect, anything, something, yn
|
||||
conf.registerPlugin('BadWords', True)
|
||||
while yn('Would you like to add some bad words?') == 'y':
|
||||
while yn('Would you like to add some bad words?'):
|
||||
words = anything('What words? (separate individual words by spaces)')
|
||||
onStart.append('badwords add %s' % words)
|
||||
|
||||
|
@ -93,11 +93,11 @@ class BugzillaError(Exception):
|
||||
def configure(advanced):
|
||||
from questions import expect, anything, yn
|
||||
conf.registerPlugin('Bugzilla', True)
|
||||
print 'The Bugzilla plugin has the functionality to watch for URLs'
|
||||
print 'that match a specific pattern (we call this a snarfer). When'
|
||||
print 'supybot sees such a URL, he will parse the web page for'
|
||||
print 'information and reply with the results.\n'
|
||||
if yn('Do you want this bug snarfer enabled by default?') == 'y':
|
||||
output("""The Bugzilla plugin has the functionality to watch for URLs
|
||||
that match a specific pattern (we call this a snarfer). When
|
||||
supybot sees such a URL, he will parse the web page for
|
||||
information and reply with the results.""")
|
||||
if yn('Do you want this bug snarfer enabled by default?', default=False):
|
||||
conf.supybot.plugins.Bugzilla.bugSnarfer.setValue(True)
|
||||
|
||||
conf.registerPlugin('Bugzilla')
|
||||
|
@ -58,29 +58,25 @@ import callbacks
|
||||
|
||||
|
||||
def configure(advanced):
|
||||
# This will be called by setup.py to configure this module. onStart and
|
||||
# afterConnect are both lists. Append to onStart the commands you would
|
||||
# like to be run when the bot is started; append to afterConnect the
|
||||
# commands you would like to be run when the bot has finished connecting.
|
||||
from questions import expect, anything, something, yn
|
||||
conf.registerPlugin('Debian', True)
|
||||
if not utils.findBinaryInPath('zegrep'):
|
||||
if not advanced:
|
||||
print 'I can\'t find zegrep in your path. This is necessary '
|
||||
print 'to run the file command. I\'ll disable this command '
|
||||
print 'now. When you get zegrep in your path, use the command '
|
||||
print '"enable file" to re-enable the command.'
|
||||
output("""I can't find zegrep in your path. This is necessary
|
||||
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')
|
||||
else:
|
||||
print 'I can\'t find zegrep in your path. If you want to run the '
|
||||
print 'file command with any sort of expediency, you\'ll need '
|
||||
print 'it. You can use a python equivalent, but it\'s about two '
|
||||
print 'orders of magnitude slower. THIS MEANS IT WILL TAKE AGES '
|
||||
print 'TO RUN THIS COMMAND. Don\'t do this.'
|
||||
if yn('Do you want to use a Python equivalent of zegrep?') == 'y':
|
||||
output("""I can't find zegrep in your path. If you want to run
|
||||
the file command with any sort of expediency, you'll
|
||||
need it. You can use a python equivalent, but it's
|
||||
about two orders of magnitude slower. THIS MEANS IT
|
||||
WILL TAKE AGES TO RUN THIS COMMAND. Don't do this.""")
|
||||
if yn('Do you want to use a Python equivalent of zegrep?'):
|
||||
conf.supybot.plugins.Debian.pythonZegrep.setValue(True)
|
||||
else:
|
||||
print 'I\'ll disable file now.'
|
||||
output('I\'ll disable file now.')
|
||||
onStart.append('disable file')
|
||||
|
||||
conf.registerPlugin('Debian')
|
||||
|
@ -54,8 +54,8 @@ import callbacks
|
||||
|
||||
def configure(advanced):
|
||||
from questions import expect, anything, something, yn
|
||||
print 'The default dictd server is dict.org.'
|
||||
if yn('Would you like to specify a different dictd server?') == 'y':
|
||||
output('The default dictd server is dict.org.')
|
||||
if yn('Would you like to specify a different dictd server?'):
|
||||
server = something('What server?')
|
||||
conf.supybot.plugins.Dict.server.set(server)
|
||||
|
||||
|
@ -53,17 +53,13 @@ import callbacks
|
||||
|
||||
|
||||
def configure(advanced):
|
||||
# This will be called by setup.py to configure this module. onStart and
|
||||
# afterConnect are both lists. Append to onStart the commands you would
|
||||
# like to be run when the bot is started; append to afterConnect the
|
||||
# commands you would like to be run when the bot has finished connecting.
|
||||
from questions import expect, anything, something, yn
|
||||
conf.registerPlugin('Ebay', True)
|
||||
print 'The Ebay plugin has the functionality to watch for URLs'
|
||||
print 'that match a specific pattern (we call this a snarfer). When'
|
||||
print 'supybot sees such a URL, he will parse the web page for'
|
||||
print 'information and reply with the results.\n'
|
||||
if yn('Do you want the Ebay snarfer enabled by default?') == 'y':
|
||||
output("""The Ebay plugin has the functionality to watch for URLs
|
||||
that match a specific pattern (we call this a snarfer). When
|
||||
supybot sees such a URL, he will parse the web page for
|
||||
information and reply with the results."""
|
||||
if yn('Do you want the Ebay snarfer enabled by default?'):
|
||||
conf.supybot.plugins.Ebay.auctionSnarfer.setValue(True)
|
||||
|
||||
class EbayError(callbacks.Error):
|
||||
|
@ -53,12 +53,9 @@ def configure(advanced):
|
||||
from questions import expect, anything, something, yn
|
||||
conf.registerPlugin('Enforcer', True)
|
||||
chanserv = anything("""What\'s the name of ChanServ on your network? If
|
||||
there is no ChanServ on your network, just press enter without entering
|
||||
anything.""")
|
||||
if yn('Do you want the bot to take revenge on rule breakers?'):
|
||||
revenge = True
|
||||
else:
|
||||
revenge = False
|
||||
there is no ChanServ on your network, just press
|
||||
enter without entering anything.""")
|
||||
revenge = yn('Do you want the bot to take revenge on rule breakers?')
|
||||
conf.supybot.plugins.Enforcer.ChanServ.set(chanserv)
|
||||
conf.supybot.plugins.Enforcer.takeRevenge.setValue(revenge)
|
||||
|
||||
|
@ -52,22 +52,18 @@ import callbacks
|
||||
|
||||
|
||||
def configure(advanced):
|
||||
# This will be called by setup.py to configure this module. onStart and
|
||||
# afterConnect are both lists. Append to onStart the commands you would
|
||||
# like to be run when the bot is started; append to afterConnect the
|
||||
# commands you would like to be run when the bot has finished connecting.
|
||||
from questions import expect, anything, something, yn
|
||||
conf.registerPlugin('Gameknot', True)
|
||||
if advanced:
|
||||
print 'The Gameknot plugin has the functionality to watch for URLs'
|
||||
print 'that match a specific pattern (we call this a snarfer). When'
|
||||
print 'supybot sees such a URL, he will parse the web page for'
|
||||
print 'information and reply with the results.\n'
|
||||
if yn('Do you want the Gameknot stats snarfer enabled by default?')==\
|
||||
'y':
|
||||
output("""The Gameknot plugin has the functionality to watch for URLs
|
||||
that match a specific pattern (we call this a snarfer). When
|
||||
supybot sees such a URL, he will parse the web page for
|
||||
information and reply with the results.""")
|
||||
if yn('Do you want the Gameknot stats snarfer enabled by default?',
|
||||
default=False):
|
||||
conf.supybot.plugins.Gameknot.statSnarfer.setValue(True)
|
||||
if yn('Do you want the Gameknot Game links snarfer enabled by '
|
||||
'default?') == 'y':
|
||||
'default?', default=False):
|
||||
conf.supybot.plugins.Gameknot.gameSnarfer.setValue(True)
|
||||
|
||||
conf.registerPlugin('Gameknot')
|
||||
|
@ -61,12 +61,12 @@ import structures
|
||||
|
||||
def configure(advanced):
|
||||
from questions import expect, anything, something, yn
|
||||
print 'To use Google\'t Web Services, you must have a license key.'
|
||||
if yn('Do you have a license key?') == 'y':
|
||||
output('To use Google\'t Web Services, you must have a license key.')
|
||||
if yn('Do you have a license key?'):
|
||||
key = something('What is it?')
|
||||
while len(key) != 32:
|
||||
print 'That\'s not a valid Google license key.'
|
||||
if yn('Are you sure you have a valid Google license key?') == 'y':
|
||||
output('That\'s not a valid Google license key.')
|
||||
if yn('Are you sure you have a valid Google license key?'):
|
||||
key = something('What is it?')
|
||||
else:
|
||||
key = ''
|
||||
@ -74,34 +74,33 @@ def configure(advanced):
|
||||
if key:
|
||||
conf.registerPlugin('Google', True)
|
||||
conf.supybot.plugins.Google.licenseKey.setValue(key)
|
||||
print 'The Google plugin has the functionality to watch for URLs'
|
||||
print 'that match a specific pattern (we call this a snarfer).'
|
||||
print 'When supybot sees such a URL, he will parse the web page'
|
||||
print 'for information and reply with the results.'
|
||||
print
|
||||
print 'Google has two available snarfers: Google Groups link'
|
||||
print 'snarfing and a google search snarfer.'
|
||||
print
|
||||
output("""The Google plugin has the functionality to watch for URLs
|
||||
that match a specific pattern. (We call this a snarfer)
|
||||
When supybot sees such a URL, it will parse the web page
|
||||
for information and reply with the results.
|
||||
|
||||
Google has two available snarfers: Google Groups link
|
||||
snarfing and a google search snarfer.""")
|
||||
if yn('Do you want the Google Groups link snarfer enabled by '
|
||||
'default?') == 'y':
|
||||
'default?'):
|
||||
conf.supybot.plugins.Google.groupsSnarfer.setValue(True)
|
||||
if yn('Do you want the Google search snarfer enabled by default?') \
|
||||
== 'y':
|
||||
if yn('Do you want the Google search snarfer enabled by default?'):
|
||||
conf.supybot.plugins.Google.searchSnarfer.setValue(True)
|
||||
if not conf.supybot.plugins.Alias():
|
||||
print 'Google depends on the Alias module for some extra commands.'
|
||||
if yn('Would you like to load the Alias module now?') == 'y':
|
||||
output('Google depends on the Alias module '
|
||||
'for some extra commands.')
|
||||
if yn('Would you like to load the Alias module now?'):
|
||||
conf.registerPlugin('Alias', True)
|
||||
else:
|
||||
print 'You can still use the Google module, but you won\'t ' \
|
||||
'have these extra commands enabled.'
|
||||
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:
|
||||
print 'You\'ll need to get a key before you can use this plugin.'
|
||||
print 'You can apply for a key at http://www.google.com/apis/'
|
||||
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/""")
|
||||
|
||||
|
||||
totalSearches = 0
|
||||
|
@ -56,26 +56,21 @@ except ImportError:
|
||||
'plugin. Download it at <http://pysqlite.sf.net/>'
|
||||
|
||||
def configure(advanced):
|
||||
# This will be called by setup.py to configure this module. onStart and
|
||||
# afterConnect are both lists. Append to onStart the commands you would
|
||||
# like to be run when the bot is started; append to afterConnect the
|
||||
# commands you would like to be run when the bot has finished connecting.
|
||||
from questions import expect, anything, something, yn
|
||||
conf.registerPlugin('Lookup', True)
|
||||
print 'This module allows you to define commands that do a simple key'
|
||||
print 'lookup and return some simple value. It has a command "add"'
|
||||
### TODO: fix conf.dataDir here. I'm waiting until we rewrite this with
|
||||
### a proper question.py print statement.
|
||||
print 'that takes a command name and a file in conf.dataDir and adds a'
|
||||
print 'command with that name that responds with mapping from that file.'
|
||||
print 'The file itself should be composed of lines of the form key:value.'
|
||||
while yn('Would you like to add a file?') == 'y':
|
||||
output("""This module allows you to define commands that do a simple key
|
||||
lookup and return some simple value. It has a command "add"
|
||||
that takes a command name and a file from the data dir and adds a
|
||||
command with that name that responds with the mapping from that
|
||||
file. The file itself should be composed of lines
|
||||
of the form key:value.""")
|
||||
while yn('Would you like to add a file?'):
|
||||
filename = something('What\'s the filename?')
|
||||
try:
|
||||
dataDir = conf.supybot.directories.data()
|
||||
fd = file(os.path.join(dataDir, filename))
|
||||
except EnvironmentError, e:
|
||||
print 'I couldn\'t open that file: %s' % e
|
||||
output('I couldn\'t open that file: %s' % e)
|
||||
continue
|
||||
counter = 1
|
||||
try:
|
||||
@ -86,7 +81,8 @@ def configure(advanced):
|
||||
(key, value) = line.split(':', 1)
|
||||
counter += 1
|
||||
except ValueError:
|
||||
print 'That\'s not a valid file; line #%s is malformed.' % counter
|
||||
output('That\'s not a valid file; '
|
||||
'line #%s is malformed.' % counter)
|
||||
continue
|
||||
command = something('What would you like the command to be?')
|
||||
onStart.append('lookup add %s %s' % (command, filename))
|
||||
|
@ -54,10 +54,10 @@ def configure(advanced):
|
||||
conf.registerPlugin('Parter', True)
|
||||
s = ' '
|
||||
while s:
|
||||
if yn('Would you like to automatically part a channel?') == 'y':
|
||||
if yn('Would you like to automatically part a channel?'):
|
||||
s = something('What channel?')
|
||||
while not ircutils.isChannel(s):
|
||||
print 'That\'s not a valid channel.'
|
||||
output('That\'s not a valid channel.')
|
||||
s = something('What channel?')
|
||||
onStart.append('autopartchannel %s' % s)
|
||||
else:
|
||||
|
@ -70,7 +70,7 @@ def configure(advanced):
|
||||
conf.registerPlugin('Python', True)
|
||||
if yn("""This plugin provides a snarfer for ASPN Python Recipe URLs;
|
||||
it will output the name of the Recipe when it sees such a URL.
|
||||
Would you like to enable this snarfer?""") == 'y':
|
||||
Would you like to enable this snarfer?"""):
|
||||
conf.supybot.plugins.Python.aspnSnarfer.setValue(True)
|
||||
|
||||
conf.registerPlugin('Python')
|
||||
|
@ -55,7 +55,7 @@ def configure(advanced):
|
||||
from questions import expect, anything, something, yn
|
||||
conf.registerPlugin('RSS', True)
|
||||
prompt = 'Would you like to add an RSS feed?'
|
||||
while yn(prompt) == 'y':
|
||||
while yn(prompt):
|
||||
prompt = 'Would you like to add another RSS feed?'
|
||||
name = something('What\'s the name of the website?')
|
||||
url = something('What\'s the URL of the RSS feed?')
|
||||
|
@ -57,40 +57,40 @@ def configure(advanced):
|
||||
import socket
|
||||
from questions import expect, anything, something, yn
|
||||
conf.registerPlugin('Relay', True)
|
||||
startNetwork = anything('What is the name of the network you\'re ' \
|
||||
startNetwork = anything('What is the name of the network you\'re '
|
||||
'connecting to first?')
|
||||
onStart.append('relay start %s' % startNetwork)
|
||||
while yn('Do you want to connect to another network for relaying?') == 'y':
|
||||
network = anything('What is the name of the network you want to ' \
|
||||
while yn('Do you want to connect to another network for relaying?'):
|
||||
network = anything('What is the name of the network you want to '
|
||||
'connect to?')
|
||||
server = ''
|
||||
while not server:
|
||||
server = anything('What server does that network use?')
|
||||
try:
|
||||
print 'Looking up %s' % server
|
||||
output('Looking up %s' % server)
|
||||
ip = socket.gethostbyname(server)
|
||||
print 'Found %s (%s)' % (server, ip)
|
||||
output('Found %s (%s)' % (server, ip))
|
||||
except socket.error:
|
||||
print 'Sorry, but I couldn\'t find that server.'
|
||||
output('Sorry, but I couldn\'t find that server.')
|
||||
server = ''
|
||||
if yn('Does that server require you to connect on a port other than '
|
||||
'the default port for IRC (6667)?') == 'y':
|
||||
'the default port for IRC (6667)?', default=False):
|
||||
port = ''
|
||||
while not port:
|
||||
port = anything('What port is that?')
|
||||
try:
|
||||
int(port)
|
||||
except ValueError:
|
||||
print 'Sorry, but that isn\'t a valid port.'
|
||||
output('Sorry, but that isn\'t a valid port.')
|
||||
port = ''
|
||||
server = ':'.join((server, port))
|
||||
onStart.append('relay connect %s %s' % (network, server))
|
||||
channel = anything('What channel would you like to relay between?')
|
||||
afterConnect.append('relay join %s' % utils.dqrepr(channel))
|
||||
while yn('Would like to relay between any more channels?') == 'y':
|
||||
while yn('Would like to relay between any more channels?'):
|
||||
channel = anything('What channel?')
|
||||
afterConnect.append('relay join %s' % channel)
|
||||
if yn('Would you like to use color to distinguish between nicks?') == 'y':
|
||||
if yn('Would you like to use color to distinguish between nicks?'):
|
||||
afterConnect.append('relay color 2')
|
||||
|
||||
|
||||
|
@ -53,12 +53,8 @@ def configure(advanced):
|
||||
conf.registerPlugin('Services', True)
|
||||
nick = something('What is your registered nick?')
|
||||
password = something('What is your password for that nick?')
|
||||
chanserv = 'ChanServ'
|
||||
if yn('Is your ChanServ named something other than ChanServ?') == 'y':
|
||||
chanserv = something('What is your ChanServ named?')
|
||||
nickserv = 'NickServ'
|
||||
if yn('Is your NickServ named something other than NickServ?') == 'y':
|
||||
nickserv = something('What is your NickServ named?')
|
||||
chanserv = something('What is your ChanServ named?', default='ChanServ')
|
||||
nickserv = something('What is your NickServ named?', default='NickServ')
|
||||
conf.supybot.plugins.Services.nick.setValue(nick)
|
||||
conf.supybot.plugins.Services.password.setValue(password)
|
||||
conf.supybot.plugins.Services.NickServ.setValue(nickserv)
|
||||
|
@ -53,44 +53,42 @@ import callbacks
|
||||
|
||||
|
||||
def configure(advanced):
|
||||
# This will be called by setup.py to configure this module. onStart and
|
||||
# afterConnect are both lists. Append to onStart the commands you would
|
||||
# like to be run when the bot is started; append to afterConnect the
|
||||
# commands you would like to be run when the bot has finished connecting.
|
||||
from questions import expect, anything, something, yn
|
||||
conf.registerPlugin('Sourceforge', True)
|
||||
print 'The Sourceforge plugin has the functionality to watch for URLs'
|
||||
print 'that match a specific pattern (we call this a snarfer). When'
|
||||
print 'supybot sees such a URL, he will parse the web page for'
|
||||
print 'information and reply with the results.\n'
|
||||
if yn('Do you want this snarfer to be enabled by default?') == 'y':
|
||||
output("""The Sourceforge plugin has the functionality to watch for URLs
|
||||
that match a specific pattern (we call this a snarfer). When
|
||||
supybot sees such a URL, he will parse the web page for
|
||||
information and reply with the results.""")
|
||||
if yn('Do you want this snarfer to be enabled by default?'):
|
||||
conf.supybot.plugins.Sourceforge.trackerSnarfer.setValue(True)
|
||||
|
||||
print 'The bugs and rfes commands of the Sourceforge plugin can be set'
|
||||
print 'to query a default project when no project is specified. If this'
|
||||
print 'project is not set, calling either of those commands will display'
|
||||
print 'the associated help. With the default project set, calling'
|
||||
print 'bugs/rfes with no arguments will find the most recent bugs/rfes'
|
||||
print 'for the default project.\n'
|
||||
if yn('Do you want to specify a default project?') == 'y':
|
||||
output("""The bugs and rfes commands of the Sourceforge plugin can be set
|
||||
to query a default project when no project is specified. If this
|
||||
project is not set, calling either of those commands will display
|
||||
the associated help. With the default project set, calling
|
||||
bugs/rfes with no arguments will find the most recent bugs/rfes
|
||||
for the default project.""")
|
||||
if yn('Do you want to specify a default project?'):
|
||||
project = anything('Project name:')
|
||||
if project:
|
||||
conf.supybot.plugins.Sourceforge.project.set(project)
|
||||
|
||||
print 'Sourceforge is quite the word to type, and it may get annoying'
|
||||
print 'typing it all the time because Supybot makes you use the plugin'
|
||||
print 'name to disambiguate calls to ambiguous commands (i.e., the bug'
|
||||
print 'command is in this plugin and the Bugzilla plugin; if both are'
|
||||
print 'loaded, you\'ll have you type "sourceforge bug ..." to get this'
|
||||
print 'bug command). You may save some time by making an alias for'
|
||||
print '"sourceforge". We like to make it "sf".'
|
||||
if yn('Would you like to add sf as an alias for Sourceforge?') == 'y':
|
||||
output("""Sourceforge is quite the word to type, and it may get annoying
|
||||
typing it all the time because Supybot makes you use the plugin
|
||||
name to disambiguate calls to ambiguous commands (i.e., the bug
|
||||
command is in this plugin and the Bugzilla plugin; if both are
|
||||
loaded, you\'ll have you type "sourceforge bug ..." to get this
|
||||
bug command). You may save some time by making an alias for
|
||||
"sourceforge". We like to make it "sf"."""
|
||||
if yn('Would you like to add sf as an alias for Sourceforge?',
|
||||
default=True):
|
||||
if not conf.supybot.plugins.Alias():
|
||||
print 'This depends on the Alias module.'
|
||||
if yn('Would you like to load the Alias plugin now?') == 'y':
|
||||
output('This depends on the Alias module.')
|
||||
if yn('Would you like to load the Alias plugin now?',
|
||||
default=True):
|
||||
conf.registerPlugin('Alias', True)
|
||||
else:
|
||||
print 'Then I can\'t add such an alias.'
|
||||
output('Then I can\'t add such an alias.')
|
||||
return
|
||||
onStart.append('alias add sf sourceforge $*')
|
||||
|
||||
|
@ -66,11 +66,11 @@ def configure(advanced):
|
||||
conf.registerPlugin('URL', True)
|
||||
if yn("""This plugin offers a snarfer that will go to tinyurl.com and get
|
||||
a shorter version of long URLs that are sent to the channel.
|
||||
Would you like this snarfer to be enabled?"""):
|
||||
Would you like this snarfer to be enabled?""", default=False):
|
||||
conf.supybot.plugins.URL.tinyurlSnarfer.setValue(True)
|
||||
if yn("""This plugin also offers a snarfer that will try to fetch the
|
||||
title of URLs that it sees in the channel. Would like you this
|
||||
snarfer to be enabled?"""):
|
||||
snarfer to be enabled?""", default=False):
|
||||
conf.supybot.plugins.URL.titleSnarfer.setValue(True)
|
||||
|
||||
conf.registerPlugin('URL')
|
||||
|
@ -61,32 +61,32 @@ def configure(advanced):
|
||||
if not spellCmd:
|
||||
spellCmd = utils.findBinaryInPath('ispell')
|
||||
if not spellCmd:
|
||||
print 'NOTE: I couldn\'t find aspell or ispell in your path,'
|
||||
print 'so that function of this module will not work. You may'
|
||||
print 'choose to install it later. To re-enable this command then, '
|
||||
print 'remove the "disable spell" line from your configuration file.'
|
||||
output("""NOTE: I couldn't find aspell or ispell 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 spell" line from your configuration file.""")
|
||||
onStart.append('disable spell')
|
||||
fortuneCmd = utils.findBinaryInPath('fortune')
|
||||
if not fortuneCmd:
|
||||
print 'NOTE: I couldn\'t find fortune in your path, so that function '
|
||||
print 'of this module will not work. You may choose to install it '
|
||||
print 'later. To re-enable this command then, remove the '
|
||||
print '"disable fortune" command from your configuration file.'
|
||||
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')
|
||||
wtfCmd = utils.findBinaryInPath('wtf')
|
||||
if not wtfCmd:
|
||||
print 'NOTE: I couldn\'t find wtf in your path, so that function of '
|
||||
print 'this module won\'t work. You may choose to install it later; '
|
||||
print 'to re-enable this command then, remove the "disable wtf" '
|
||||
print 'command from your configuration file or simply tell the bot '
|
||||
print '"enable wtf"'
|
||||
output("""NOTE: I couldn't find wtf in your path, so that function of
|
||||
this module won't work. You may choose to install it later;
|
||||
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')
|
||||
print 'The "progstats" command can reveal potentially sensitive'
|
||||
print 'information about your machine. Here\'s an example of its output:'
|
||||
print
|
||||
print progstats()
|
||||
print
|
||||
if yn('Would you like to disable this command for non-owner users?')=='y':
|
||||
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')
|
||||
|
||||
def progstats():
|
||||
|
@ -69,8 +69,8 @@ def main():
|
||||
import log
|
||||
import ircdb
|
||||
|
||||
oldPriority = conf.supybot.log.minimumPriority()
|
||||
conf.supybot.log.minimumPriority.set('CRITICAL')
|
||||
oldLogLevel = conf.supybot.log.level()
|
||||
conf.supybot.log.level.set('CRITICAL')
|
||||
|
||||
if not options.name:
|
||||
name = ''
|
||||
@ -124,7 +124,7 @@ def main():
|
||||
user.addCapability(capability)
|
||||
ircdb.users.setUser(id, user)
|
||||
print 'User %s added.' % name
|
||||
conf.supybot.log.minimumPriority.setValue(oldPriority)
|
||||
conf.supybot.log.level.setValue(oldLogLevel)
|
||||
registry.close(conf.supybot, args[0])
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -225,10 +225,10 @@ def main():
|
||||
# Store the minimum log priority if set, because we set it to a temporary
|
||||
# value during the wizard
|
||||
try:
|
||||
priority = registry._cache['supybot.log.minimumPriority']
|
||||
priority = registry._cache['supybot.log.level']
|
||||
except KeyError:
|
||||
priority = 'INFO'
|
||||
registry._cache['supybot.log.minimumPriority'] = 'CRITICAL'
|
||||
registry._cache['supybot.log.level'] = 'CRITICAL'
|
||||
|
||||
# Now that we're all set, import conf and log
|
||||
import conf
|
||||
@ -364,17 +364,18 @@ def main():
|
||||
world unless you can make that bot join some channels.""")
|
||||
if yn('Do you want your bot to join some channels when he connects?',
|
||||
default=True):
|
||||
defaultChannels = ','.join(conf.supybot.channels())
|
||||
channels = something('What channels? Separate channels with '
|
||||
'commas.', default=defaultChannels)
|
||||
while not all(ircutils.isChannel, channels.split(',')):
|
||||
# FIXME: say which ones weren't channels.
|
||||
output("""Not all of those are valid IRC channels. Be sure to
|
||||
prefix the channel with # (or +, or !, or &, but no one uses those
|
||||
channels, really).""")
|
||||
channels = something('What channels?',
|
||||
default=defaultChannels)
|
||||
conf.supybot.channels.set(channels)
|
||||
defaultChannels = ' '.join(conf.supybot.channels())
|
||||
while True:
|
||||
channels = something('What channels? Separate channels with '
|
||||
'spaces.', default=defaultChannels)
|
||||
try:
|
||||
conf.supybot.channels.set(channels)
|
||||
break
|
||||
except registry.InvalidRegistryValue:
|
||||
# FIXME: say which ones weren't channels.
|
||||
output("""Not all of those are valid IRC channels. Be sure to
|
||||
prefix the channel with # (or +, or !, or &, but no one uses those
|
||||
channels, really).""")
|
||||
|
||||
###
|
||||
# Plugins
|
||||
@ -535,19 +536,19 @@ def main():
|
||||
not yn('Would you like to turn this colorization off?',
|
||||
default=False))
|
||||
|
||||
# conf.supybot.log.minimumPriority
|
||||
# conf.supybot.log.level
|
||||
output("""Your bot can handle debug messages at several priorities,
|
||||
CRITICAL, in decreasing order of priority. By
|
||||
default, your bot will log all of these priorities. You can, however,
|
||||
specify that he only log messages above a certain priority level. Of
|
||||
course, all error messages will still be logged.""")
|
||||
newPriority = something('What would you like the minimum priority to be? '
|
||||
newLogLevel = something('What would you like the minimum priority to be? '
|
||||
'Just press enter to accept the default.',
|
||||
default=priority).lower()
|
||||
while newPriority not in ['debug', 'info', 'warning', 'error', 'critical']:
|
||||
while newLogLevel not in ['debug', 'info', 'warning', 'error', 'critical']:
|
||||
output("""That's not a valid priority. Valid priorities include
|
||||
'DEBUG', 'INFO', 'WARNING', 'ERROR', and 'CRITICAL'""")
|
||||
newPriority = something('What would you like the minimum priority to '
|
||||
newLogLevel = something('What would you like the minimum priority to '
|
||||
'be? Just press enter to accept the default.',
|
||||
default=priority).lower()
|
||||
|
||||
@ -640,8 +641,8 @@ def main():
|
||||
###
|
||||
# Write the registry
|
||||
###
|
||||
# Replace the temporary value in supybot.log.minimumPriority
|
||||
conf.supybot.log.minimumPriority.set(newPriority)
|
||||
# Replace the temporary value in supybot.log.level
|
||||
conf.supybot.log.level.set(newLogLevel)
|
||||
|
||||
# Save the registry
|
||||
if not filename:
|
||||
|
Loading…
Reference in New Issue
Block a user