supybot.registry¶
- class supybot.registry.Boolean(default, help, setDefault=True, showDefault=True, **kwargs)[source]¶
Value must be either True or False (or On or Off).
- addCallback(callback, *args, **kwargs)¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- removeCallback(callback)¶
Remove all occurences of this callbacks from the callback list.
- set(s)[source]¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(v)[source]¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.
- class supybot.registry.CommaSeparatedListOfStrings(default, help, setDefault=True, showDefault=True, **kwargs)[source]¶
- List¶
alias of
list
- addCallback(callback, *args, **kwargs)¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- joiner()¶
Concatenate any number of strings.
The string whose method is called is inserted in between each given string. The result is returned as a new string.
Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’
- removeCallback(callback)¶
Remove all occurences of this callbacks from the callback list.
- set(s)¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(v)¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.
- class supybot.registry.CommaSeparatedSetOfStrings(default, help, setDefault=True, showDefault=True, **kwargs)[source]¶
-
- addCallback(callback, *args, **kwargs)¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- joiner()¶
Concatenate any number of strings.
The string whose method is called is inserted in between each given string. The result is returned as a new string.
Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’
- removeCallback(callback)¶
Remove all occurences of this callbacks from the callback list.
- set(s)¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(v)¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.
- class supybot.registry.Float(default, help, setDefault=True, showDefault=True, **kwargs)[source]¶
Value must be a floating-point number.
- addCallback(callback, *args, **kwargs)¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- removeCallback(callback)¶
Remove all occurences of this callbacks from the callback list.
- set(s)[source]¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(v)[source]¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.
- class supybot.registry.Group(help='', orderAlphabetically=True, private=False)[source]¶
A group; it doesn’t hold a value unless handled by a subclass.
- class supybot.registry.Integer(default, help, setDefault=True, showDefault=True, **kwargs)[source]¶
Value must be an integer.
- addCallback(callback, *args, **kwargs)¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- removeCallback(callback)¶
Remove all occurences of this callbacks from the callback list.
- set(s)[source]¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(v)¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.
- exception supybot.registry.InvalidRegistryFile[source]¶
- add_note()¶
Exception.add_note(note) – add a note to the exception
- with_traceback()¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception supybot.registry.InvalidRegistryName[source]¶
- add_note()¶
Exception.add_note(note) – add a note to the exception
- with_traceback()¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception supybot.registry.InvalidRegistryValue[source]¶
- add_note()¶
Exception.add_note(note) – add a note to the exception
- with_traceback()¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- class supybot.registry.Json(default, help, setDefault=True, showDefault=True, **kwargs)[source]¶
- addCallback(callback, *args, **kwargs)¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- editable()[source]¶
Return an editable dict usable within a ‘with’ statement and committed to the configuration variable at the end.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- removeCallback(callback)¶
Remove all occurences of this callbacks from the callback list.
- set(v)[source]¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(v)[source]¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.
- exception supybot.registry.NonExistentRegistryEntry[source]¶
- add_note()¶
Exception.add_note(note) – add a note to the exception
- name¶
attribute name
- obj¶
object
- with_traceback()¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- class supybot.registry.NonNegativeInteger(default, help, setDefault=True, showDefault=True, **kwargs)[source]¶
Value must be a non-negative integer.
- addCallback(callback, *args, **kwargs)¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- removeCallback(callback)¶
Remove all occurences of this callbacks from the callback list.
- set(s)¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(v)[source]¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.
- class supybot.registry.NormalizedString(default, *args, **kwargs)[source]¶
- addCallback(callback, *args, **kwargs)¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- removeCallback(callback)¶
Remove all occurences of this callbacks from the callback list.
- set(s)[source]¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(s)[source]¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.
- class supybot.registry.OnlySomeStrings(*args, **kwargs)[source]¶
- addCallback(callback, *args, **kwargs)¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- removeCallback(callback)¶
Remove all occurences of this callbacks from the callback list.
- set(s)¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(s)[source]¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.
- class supybot.registry.PositiveFloat(default, help, setDefault=True, showDefault=True, **kwargs)[source]¶
Value must be a floating-point number greater than zero.
- addCallback(callback, *args, **kwargs)¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- removeCallback(callback)¶
Remove all occurences of this callbacks from the callback list.
- set(s)¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(v)[source]¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.
- class supybot.registry.PositiveInteger(default, help, setDefault=True, showDefault=True, **kwargs)[source]¶
Value must be positive (non-zero) integer.
- addCallback(callback, *args, **kwargs)¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- removeCallback(callback)¶
Remove all occurences of this callbacks from the callback list.
- set(s)¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(v)[source]¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.
- class supybot.registry.Probability(*args, **kwargs)[source]¶
Value must be a floating point number in the range [0, 1].
- addCallback(callback, *args, **kwargs)¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- removeCallback(callback)¶
Remove all occurences of this callbacks from the callback list.
- set(s)¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(v)[source]¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.
- class supybot.registry.Regexp(default, *args, **kwargs)[source]¶
Value must be a valid regular expression.
- addCallback(callback, *args, **kwargs)¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- removeCallback(callback)¶
Remove all occurences of this callbacks from the callback list.
- set(s)[source]¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(v)¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.
- exception supybot.registry.RegistryException[source]¶
- add_note()¶
Exception.add_note(note) – add a note to the exception
- with_traceback()¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- class supybot.registry.SeparatedListOf(default, help, setDefault=True, showDefault=True, **kwargs)[source]¶
- List¶
alias of
list
- class Value(default, help, setDefault=True, showDefault=True, **kwargs)¶
Invalid registry value. If you’re getting this message, report it, because we forgot to put a proper help string here.
- addCallback(callback, *args, **kwargs)¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- removeCallback(callback)¶
Remove all occurences of this callbacks from the callback list.
- set(s)¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(v)¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.
- addCallback(callback, *args, **kwargs)¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- removeCallback(callback)¶
Remove all occurences of this callbacks from the callback list.
- set(s)[source]¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(v)[source]¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.
- class supybot.registry.SpaceSeparatedListOf(default, help, setDefault=True, showDefault=True, **kwargs)[source]¶
- List¶
alias of
list
- class Value(default, help, setDefault=True, showDefault=True, **kwargs)¶
Invalid registry value. If you’re getting this message, report it, because we forgot to put a proper help string here.
- addCallback(callback, *args, **kwargs)¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- removeCallback(callback)¶
Remove all occurences of this callbacks from the callback list.
- set(s)¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(v)¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.
- addCallback(callback, *args, **kwargs)¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- joiner()¶
Concatenate any number of strings.
The string whose method is called is inserted in between each given string. The result is returned as a new string.
Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’
- removeCallback(callback)¶
Remove all occurences of this callbacks from the callback list.
- set(s)¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(v)¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.
- class supybot.registry.SpaceSeparatedListOfStrings(default, help, setDefault=True, showDefault=True, **kwargs)[source]¶
- List¶
alias of
list
- addCallback(callback, *args, **kwargs)¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- joiner()¶
Concatenate any number of strings.
The string whose method is called is inserted in between each given string. The result is returned as a new string.
Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’
- removeCallback(callback)¶
Remove all occurences of this callbacks from the callback list.
- set(s)¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(v)¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.
- splitter(s)¶
Override this with a function that takes a string and returns a list of strings.
- class supybot.registry.SpaceSeparatedSetOfStrings(default, help, setDefault=True, showDefault=True, **kwargs)[source]¶
-
- addCallback(callback, *args, **kwargs)¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- joiner()¶
Concatenate any number of strings.
The string whose method is called is inserted in between each given string. The result is returned as a new string.
Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’
- removeCallback(callback)¶
Remove all occurences of this callbacks from the callback list.
- set(s)¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(v)¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.
- splitter(s)¶
Override this with a function that takes a string and returns a list of strings.
- class supybot.registry.String(default, help, setDefault=True, showDefault=True, **kwargs)[source]¶
Value is not a valid Python string.
- addCallback(callback, *args, **kwargs)¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- removeCallback(callback)¶
Remove all occurences of this callbacks from the callback list.
- set(s)[source]¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(v)¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.
- class supybot.registry.StringSurroundedBySpaces(default, help, setDefault=True, showDefault=True, **kwargs)[source]¶
- addCallback(callback, *args, **kwargs)¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- removeCallback(callback)¶
Remove all occurences of this callbacks from the callback list.
- set(s)¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(v)[source]¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.
- class supybot.registry.StringWithSpaceOnRight(default, help, setDefault=True, showDefault=True, **kwargs)[source]¶
- addCallback(callback, *args, **kwargs)¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- removeCallback(callback)¶
Remove all occurences of this callbacks from the callback list.
- set(s)¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(v)[source]¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.
- class supybot.registry.TemplatedString(*args, **kwargs)[source]¶
- addCallback(callback, *args, **kwargs)¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- removeCallback(callback)¶
Remove all occurences of this callbacks from the callback list.
- set(s)¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(v)[source]¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.
- class supybot.registry.Value(default, help, setDefault=True, showDefault=True, **kwargs)[source]¶
Invalid registry value. If you’re getting this message, report it, because we forgot to put a proper help string here.
- addCallback(callback, *args, **kwargs)[source]¶
Add a callback to the list. A callback is a function that will be called when the value is changed. You can give this function as many extra arguments as you wish, they will be passed to the callback.
- context(value)[source]¶
Return a context manager object, which sets this variable to a temporary value, and set the previous value back when exiting the context.
- getSpecific(network=None, channel=None, check=True, fallback_to_channel=True)[source]¶
Gets the network-specific and/or channel-specific value of this Value. If
check=True
(the default), this will raise an error ifnetwork
(resp.channel
) is provided but this Value is not network-specific (resp. channel-specific). Ifcheck=False
, thennetwork
and/orchannel
may be silently ignored.If
fallback_to_channel=True
(the default) and the network-specific + channel-specific value is not set, but the channel-specific value is set, it will return the latter. This is useful to upgrade from existing bot configuration, that did not support network-specific values; but it may be undesirable when setting new values.
- set(s)[source]¶
Override this with a function to convert a string to whatever type you want, and call self.setValue to set the value.
- setValue(v)[source]¶
Check conditions on the actual value type here. I.e., if you’re a IntegerLessThanOneHundred (all your values must be integers less than 100) convert to an integer in set() and check that the integer is less than 100 in this method. You must call this parent method in your own setValue.