mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Fixed Babelfish so that tests run.
This commit is contained in:
parent
850f457bf6
commit
f5e4e64815
@ -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()
|
||||||
|
@ -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'
|
||||||
|
@ -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):
|
||||||
|
Loading…
Reference in New Issue
Block a user