mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-09 19:52:37 +01:00
Moved enablePipeSyntax to advanced and cleaned up some style stuff (the rest will wait until after the release is out).
This commit is contained in:
parent
cf1c3a84b9
commit
3b899fd5c0
@ -499,33 +499,18 @@ def main():
|
|||||||
partial to @, but that's because I've been using it since my ocamlbot
|
partial to @, but that's because I've been using it since my ocamlbot
|
||||||
days.""")
|
days.""")
|
||||||
import callbacks
|
import callbacks
|
||||||
while True:
|
c = ''
|
||||||
|
while not c:
|
||||||
try:
|
try:
|
||||||
conf.supybot.prefixChars.set(
|
c = anything('What would you like your bot\'s prefix '
|
||||||
something('What would you like your '
|
'character(s) to be?')
|
||||||
'bot\'s prefix character(s) to be?',
|
conf.supybot.prefixChars.set(c)
|
||||||
default='@'))
|
except registry.InvalidRegistryValue, e:
|
||||||
break
|
output(str(e))
|
||||||
except registry.InvalidRegistryValue, reason:
|
c = ''
|
||||||
output(str(reason))
|
|
||||||
else:
|
else:
|
||||||
conf.supybot.prefixChars.set('')
|
conf.supybot.prefixChars.set('')
|
||||||
|
|
||||||
# enablePipeSyntax
|
|
||||||
output("""Supybot allows nested commands. You've probably
|
|
||||||
read about them in our website or documentation, and almost certainly have
|
|
||||||
seen them in the plugin examples (if you chose to read them), By default,
|
|
||||||
they work with a syntax that looks something like Lisp with square
|
|
||||||
brackets. I.e., to call the command foo on the output of bar, you would
|
|
||||||
use "foo [bar]". Supybot is also capable of providing a pipe syntax
|
|
||||||
similar to *nix pipes. In addition to "foo [bar]", you could achieve the
|
|
||||||
same effect with "bar | foo", which some people find more natural. This
|
|
||||||
syntax is disabled by default because so many people have pipes in their
|
|
||||||
nicks, and we've found it to be somewhat frustrating to have to quote such
|
|
||||||
nicks in commands.""")
|
|
||||||
conf.supybot.pipeSyntax.setValue(yn('Would you like to enable the pipe '
|
|
||||||
'syntax for nesting? ', default=False))
|
|
||||||
|
|
||||||
###
|
###
|
||||||
# logging variables.
|
# logging variables.
|
||||||
###
|
###
|
||||||
@ -534,8 +519,8 @@ def main():
|
|||||||
output("""By default, your bot will log not only to files in the logs
|
output("""By default, your bot will log not only to files in the logs
|
||||||
directory you gave it, but also to stdout. We find this useful for
|
directory you gave it, but also to stdout. We find this useful for
|
||||||
debugging, and also just for the pretty output (it's colored!)""")
|
debugging, and also just for the pretty output (it's colored!)""")
|
||||||
conf.supybot.log.stdout.setValue(not yn('Would you like to turn off '
|
stdout = not yn('Would you like to turn off this logging to stdout?')
|
||||||
'this logging to stdout?', default=False))
|
conf.supybot.log.stdout.setValue(stdout)
|
||||||
if conf.supybot.log.stdout():
|
if conf.supybot.log.stdout():
|
||||||
# conf.something
|
# conf.something
|
||||||
output("""Some terminals may not be able to display the pretty colors
|
output("""Some terminals may not be able to display the pretty colors
|
||||||
@ -552,20 +537,34 @@ def main():
|
|||||||
By default, your bot will log all of these priorities except DEBUG. You
|
By default, your bot will log all of these priorities except DEBUG. You
|
||||||
can, however, specify that it only log messages above a certain priority
|
can, however, specify that it only log messages above a certain priority
|
||||||
level.""")
|
level.""")
|
||||||
newLogLevel = something('What would you like the minimum priority to be? '
|
logLevel = something('What would you like the minimum priority to be? '
|
||||||
'Just press enter to accept the default.',
|
'Just press enter to accept the default.',
|
||||||
default=priority).lower()
|
default=priority).lower()
|
||||||
while newLogLevel not in ['debug', 'info', 'warning', 'error', 'critical']:
|
while logLevel not in ['debug', 'info', 'warning', 'error', 'critical']:
|
||||||
output("""That's not a valid priority. Valid priorities include
|
output("""That's not a valid priority. Valid priorities include
|
||||||
'DEBUG', 'INFO', 'WARNING', 'ERROR', and 'CRITICAL'""")
|
'DEBUG', 'INFO', 'WARNING', 'ERROR', and 'CRITICAL'""")
|
||||||
newLogLevel = something('What would you like the minimum priority to '
|
logLevel = something('What would you like the minimum priority to '
|
||||||
'be? Just press enter to accept the default.',
|
'be? Just press enter to accept the default.',
|
||||||
default=priority).lower()
|
default=priority).lower()
|
||||||
|
conf.supybot.log.level.set(logLevel)
|
||||||
|
|
||||||
if advanced:
|
if advanced:
|
||||||
output("""Here's some stuff you only get to choose if you're an
|
output("""Here's some stuff you only get to choose if you're an
|
||||||
advanced user :)""")
|
advanced user :)""")
|
||||||
|
|
||||||
|
# enablePipeSyntax
|
||||||
|
output("""Supybot allows nested commands. You've probably read about
|
||||||
|
them in our website or documentation. By default, they work with a
|
||||||
|
syntax that looks something like Lisp with square brackets. I.e., to
|
||||||
|
call the command foo on the output of bar, you would use "foo [bar]".
|
||||||
|
Supybot is also capable of providing a pipe syntax similar to *nix
|
||||||
|
pipes. In addition to "foo [bar]", you could achieve the same effect
|
||||||
|
with "bar | foo", which some people find more natural. This syntax
|
||||||
|
is disabled by default because so many people have pipes in their
|
||||||
|
nicks, and we've found it to be somewhat frustrating to have to quote
|
||||||
|
such nicks in commands.""")
|
||||||
|
response = yn('Would you like to enable this pipe syntax?', default=0)
|
||||||
|
|
||||||
# conf.supybot.reply.withNickPrefix
|
# conf.supybot.reply.withNickPrefix
|
||||||
output("""By defualt, the bot will respond to all commands with a
|
output("""By defualt, the bot will respond to all commands with a
|
||||||
Nick: <response> response. That is, the user making the command will
|
Nick: <response> response. That is, the user making the command will
|
||||||
@ -651,8 +650,6 @@ def main():
|
|||||||
###
|
###
|
||||||
# Write the registry
|
# Write the registry
|
||||||
###
|
###
|
||||||
# Replace the temporary value in supybot.log.level
|
|
||||||
conf.supybot.log.level.set(newLogLevel)
|
|
||||||
|
|
||||||
# Save the registry
|
# Save the registry
|
||||||
if not filename:
|
if not filename:
|
||||||
|
Loading…
Reference in New Issue
Block a user