Fixed Babelfish so that tests run.

This commit is contained in:
Jeremy Fincher 2005-01-24 23:26:44 +00:00
parent 850f457bf6
commit f5e4e64815
4 changed files with 6 additions and 3 deletions

View File

@ -30,6 +30,8 @@
import supybot.conf as conf import supybot.conf as conf
import supybot.registry as registry import supybot.registry as registry
import babelfish
def configure(advanced): def configure(advanced):
# This will be called by supybot to configure this module. advanced is # This will be called by supybot to configure this module. advanced is
# a bool that specifies whether the user identified himself as an advanced # a bool that specifies whether the user identified himself as an advanced
@ -44,7 +46,7 @@ class Languages(registry.OnlySomeStrings):
normalize = staticmethod(str.capitalize) normalize = staticmethod(str.capitalize)
class SpaceSeparatedListOfLanguages(registry.SeparatedListOf): class SpaceSeparatedListOfLanguages(registry.SeparatedListOf):
List = sets.Set List = set
Value = Languages Value = Languages
def splitter(self, s): def splitter(self, s):
return s.split() return s.split()

View File

@ -43,7 +43,7 @@ import supybot.callbacks as callbacks
class Babelfish(callbacks.Privmsg): class Babelfish(callbacks.Privmsg):
threaded = True threaded = True
_abbrevs = utils.abbrev(imap(str.lower, babelfish.available_languages)) _abbrevs = utils.abbrev(map(str.lower, babelfish.available_languages))
_abbrevs['de'] = 'german' _abbrevs['de'] = 'german'
_abbrevs['jp'] = 'japanese' _abbrevs['jp'] = 'japanese'
_abbrevs['kr'] = 'korean' _abbrevs['kr'] = 'korean'

View File

@ -29,7 +29,7 @@
from supybot.test import * from supybot.test import *
class BabelFishTestCase(PluginTestCase, PluginDocumentation): class BabelFishTestCase(PluginTestCase):
plugins = ('Babelfish',) plugins = ('Babelfish',)
if network: if network:
def testTranslate(self): def testTranslate(self):

View File

@ -31,6 +31,7 @@
plugins = [ plugins = [
'Admin', 'Admin',
'Babelfish',
'Channel', 'Channel',
'Config', 'Config',
'Dict', 'Dict',