Removed final remnants of bracketSyntax.

This commit is contained in:
Jeremy Fincher 2004-07-23 04:59:41 +00:00
parent 278310e999
commit 88b966306a
2 changed files with 9 additions and 19 deletions

View File

@ -278,12 +278,6 @@ registerGlobalValue(supybot.reply, 'oneToOne',
safety purposes (so the bot can't possibly flood) it will normally send
everything in a single message."""))
registerChannelValue(supybot.reply, 'bracketSyntax',
registry.Boolean(True, """Supybot allows nested commands. If this option is
enabled, users can nest commands using a bracket syntax, for example: 'bot:
bar [foo]'. The matching left/right characters used for nesting commands
can be set via the supybot.reply.brackets"""))
class ValidBrackets(registry.OnlySomeStrings):
validStrings = ('', '[]', '<>', '{}', '()')

View File

@ -74,26 +74,22 @@ class TokenizerTestCase(SupyTestCase):
['foo', 'bar baz', 'quux'])
def testNesting(self):
orig = conf.supybot.reply.bracketSyntax()
self.assertEqual(tokenize('[]'), [[]])
self.assertEqual(tokenize('[foo]'), [['foo']])
self.assertEqual(tokenize('[ foo ]'), [['foo']])
self.assertEqual(tokenize('foo [bar]'), ['foo', ['bar']])
self.assertEqual(tokenize('foo bar [baz quux]'),
['foo', 'bar', ['baz', 'quux']])
try:
conf.supybot.reply.bracketSyntax.setValue(True)
self.assertEqual(tokenize('[]'), [[]])
self.assertEqual(tokenize('[foo]'), [['foo']])
self.assertEqual(tokenize('[ foo ]'), [['foo']])
self.assertEqual(tokenize('foo [bar]'), ['foo', ['bar']])
self.assertEqual(tokenize('foo bar [baz quux]'),
['foo', 'bar', ['baz', 'quux']])
finally:
conf.supybot.reply.bracketSyntax.setValue(orig)
try:
conf.supybot.reply.bracketSyntax.setValue(False)
orig = conf.supybot.reply.brackets()
conf.supybot.reply.brackets.setValue('')
self.assertEqual(tokenize('[]'), ['[]'])
self.assertEqual(tokenize('[foo]'), ['[foo]'])
self.assertEqual(tokenize('foo [bar]'), ['foo', '[bar]'])
self.assertEqual(tokenize('foo bar [baz quux]'),
['foo', 'bar', '[baz', 'quux]'])
finally:
conf.supybot.reply.bracketSyntax.setValue(orig)
conf.supybot.reply.brackets.setValue(orig)
def testError(self):
self.assertRaises(SyntaxError, tokenize, '[foo') #]