mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 21:29:24 +01:00
Removed the servers keyword to registerNetwork (it was useless) and added an append method to the Servers class.
This commit is contained in:
parent
038705c5c9
commit
e757cb9750
15
src/conf.py
15
src/conf.py
@ -184,10 +184,9 @@ registerGlobalValue(supybot, 'user',
|
|||||||
registry.String('Supybot %s' % version, """Determines the user the bot
|
registry.String('Supybot %s' % version, """Determines the user the bot
|
||||||
sends to the server."""))
|
sends to the server."""))
|
||||||
|
|
||||||
registerGroup(supybot, 'networks')
|
registerGlobalValue(supybot, 'networks',
|
||||||
registerGlobalValue(supybot.networks, 'default',
|
registry.SpaceSeparatedSetOfStrings([], """Determines what networks the bot
|
||||||
registry.String('', """Determines what the default network joined by the
|
will connect to."""))
|
||||||
bot will be."""))
|
|
||||||
|
|
||||||
class Servers(registry.SpaceSeparatedListOfStrings):
|
class Servers(registry.SpaceSeparatedListOfStrings):
|
||||||
def normalize(self, s):
|
def normalize(self, s):
|
||||||
@ -208,6 +207,10 @@ class Servers(registry.SpaceSeparatedListOfStrings):
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return ' '.join(registry.SpaceSeparatedListOfStrings.__call__(self))
|
return ' '.join(registry.SpaceSeparatedListOfStrings.__call__(self))
|
||||||
|
|
||||||
|
def append(self, s):
|
||||||
|
L = registry.SpaceSeparatedListOfStrings.__call__(self)
|
||||||
|
L.append(s)
|
||||||
|
|
||||||
class SpaceSeparatedSetOfChannels(registry.SpaceSeparatedListOf):
|
class SpaceSeparatedSetOfChannels(registry.SpaceSeparatedListOf):
|
||||||
List = ircutils.IrcSet
|
List = ircutils.IrcSet
|
||||||
Value = ValidChannel
|
Value = ValidChannel
|
||||||
@ -222,13 +225,13 @@ class SpaceSeparatedSetOfChannels(registry.SpaceSeparatedListOf):
|
|||||||
for removal in removals:
|
for removal in removals:
|
||||||
self.value.remove(removal)
|
self.value.remove(removal)
|
||||||
|
|
||||||
def registerNetwork(name, password='', servers=()):
|
def registerNetwork(name, password=''):
|
||||||
network = registerGroup(supybot.networks, name)
|
network = registerGroup(supybot.networks, name)
|
||||||
registerGlobalValue(network, 'password', registry.String(password,
|
registerGlobalValue(network, 'password', registry.String(password,
|
||||||
"""Determines what password will be used on %s. Yes, we know that
|
"""Determines what password will be used on %s. Yes, we know that
|
||||||
technically passwords are server-specific and not network-specific,
|
technically passwords are server-specific and not network-specific,
|
||||||
but this is the best we can do right now.""" % name))
|
but this is the best we can do right now.""" % name))
|
||||||
registerGlobalValue(network, 'servers', Servers(servers,
|
registryServers = registerGlobalValue(network, 'servers', Servers([],
|
||||||
"""Determines what servers the bot will connect to for %s. Each will
|
"""Determines what servers the bot will connect to for %s. Each will
|
||||||
be tried in order, wrapping back to the first when the cycle is
|
be tried in order, wrapping back to the first when the cycle is
|
||||||
completed.""" % name))
|
completed.""" % name))
|
||||||
|
Loading…
Reference in New Issue
Block a user