mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-22 02:32:42 +01:00
Rudimentary sorting.
This commit is contained in:
parent
3904672c2f
commit
955bf08255
@ -954,6 +954,7 @@ class CanonicalNameDict(utils.InsensitivePreservingDict):
|
||||
return canonicalName(s)
|
||||
|
||||
class Disabled(registry.SpaceSeparatedListOf):
|
||||
sorted = True
|
||||
Value = CanonicalString
|
||||
List = CanonicalNameSet
|
||||
|
||||
|
@ -231,6 +231,7 @@ class Servers(registry.SpaceSeparatedListOfStrings):
|
||||
L.append(s)
|
||||
|
||||
class SpaceSeparatedSetOfChannels(registry.SpaceSeparatedListOf):
|
||||
sorted = True
|
||||
List = ircutils.IrcSet
|
||||
Value = ValidChannel
|
||||
def removeChannel(self, channel):
|
||||
|
@ -571,6 +571,7 @@ class Regexp(Value):
|
||||
class SeparatedListOf(Value):
|
||||
List = list
|
||||
Value = Value
|
||||
sorted = False
|
||||
def splitter(self, s):
|
||||
"""Override this with a function that takes a string and returns a list
|
||||
of strings."""
|
||||
@ -592,6 +593,8 @@ class SeparatedListOf(Value):
|
||||
|
||||
def __str__(self):
|
||||
values = self()
|
||||
if self.sorted:
|
||||
values = sorted(values)
|
||||
if values:
|
||||
return self.joiner(values)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user