mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-02 15:44:06 +01:00
Don't use utils.str.chars anymore.
This commit is contained in:
parent
0c99a65afa
commit
4ffaff0638
@ -109,8 +109,9 @@ def canonicalCapability(capability):
|
||||
assert isCapability(capability), 'got %s' % capability
|
||||
return capability.lower()
|
||||
|
||||
_unwildcard_remover = utils.str.MultipleRemover('!@*?')
|
||||
def unWildcardHostmask(hostmask):
|
||||
return hostmask.translate(utils.str.chars, '!@*?')
|
||||
return _unwildcard_remover(hostmask)
|
||||
|
||||
_invert = invertCapability
|
||||
class CapabilitySet(set):
|
||||
|
@ -602,8 +602,8 @@ def join(channel, key=None, prefix='', msg=None):
|
||||
return IrcMsg(prefix=prefix, command='JOIN', args=(channel,), msg=msg)
|
||||
else:
|
||||
if conf.supybot.protocols.irc.strictRfc():
|
||||
chars = utils.str.chars[128:] + '\x00\r\n\f\t\v '
|
||||
assert not any([x in chars for x in key])
|
||||
chars = '\x00\r\n\f\t\v '
|
||||
assert not any([(ord(x) >= 128 or x in chars) for x in key])
|
||||
return IrcMsg(prefix=prefix, command='JOIN',
|
||||
args=(channel, key), msg=msg)
|
||||
|
||||
@ -622,9 +622,9 @@ def joins(channels, keys=None, prefix='', msg=None):
|
||||
args=(','.join(channels),), msg=msg)
|
||||
else:
|
||||
if conf.supybot.protocols.irc.strictRfc():
|
||||
chars = utils.str.chars[128:] + '\x00\r\n\f\t\v '
|
||||
chars = '\x00\r\n\f\t\v '
|
||||
for key in keys:
|
||||
assert not any([x in chars for x in key])
|
||||
assert not any([(ord(x) >= 128 or x in chars) for x in key])
|
||||
return IrcMsg(prefix=prefix,
|
||||
command='JOIN',
|
||||
args=(','.join(channels), ','.join(keys)), msg=msg)
|
||||
|
@ -473,7 +473,7 @@ class String(Value):
|
||||
|
||||
_printable = string.printable[:-4]
|
||||
def _needsQuoting(self, s):
|
||||
return s.translate(utils.str.chars, self._printable) and s.strip() != s
|
||||
return any([x not in self._printable for x in s]) and s.strip() != s
|
||||
|
||||
def __str__(self):
|
||||
s = self.value
|
||||
|
Loading…
Reference in New Issue
Block a user