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)
|
return canonicalName(s)
|
||||||
|
|
||||||
class Disabled(registry.SpaceSeparatedListOf):
|
class Disabled(registry.SpaceSeparatedListOf):
|
||||||
|
sorted = True
|
||||||
Value = CanonicalString
|
Value = CanonicalString
|
||||||
List = CanonicalNameSet
|
List = CanonicalNameSet
|
||||||
|
|
||||||
|
@ -231,6 +231,7 @@ class Servers(registry.SpaceSeparatedListOfStrings):
|
|||||||
L.append(s)
|
L.append(s)
|
||||||
|
|
||||||
class SpaceSeparatedSetOfChannels(registry.SpaceSeparatedListOf):
|
class SpaceSeparatedSetOfChannels(registry.SpaceSeparatedListOf):
|
||||||
|
sorted = True
|
||||||
List = ircutils.IrcSet
|
List = ircutils.IrcSet
|
||||||
Value = ValidChannel
|
Value = ValidChannel
|
||||||
def removeChannel(self, channel):
|
def removeChannel(self, channel):
|
||||||
|
@ -571,6 +571,7 @@ class Regexp(Value):
|
|||||||
class SeparatedListOf(Value):
|
class SeparatedListOf(Value):
|
||||||
List = list
|
List = list
|
||||||
Value = Value
|
Value = Value
|
||||||
|
sorted = False
|
||||||
def splitter(self, s):
|
def splitter(self, s):
|
||||||
"""Override this with a function that takes a string and returns a list
|
"""Override this with a function that takes a string and returns a list
|
||||||
of strings."""
|
of strings."""
|
||||||
@ -592,6 +593,8 @@ class SeparatedListOf(Value):
|
|||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
values = self()
|
values = self()
|
||||||
|
if self.sorted:
|
||||||
|
values = sorted(values)
|
||||||
if values:
|
if values:
|
||||||
return self.joiner(values)
|
return self.joiner(values)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user