mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 19:22:45 +01:00
Update a few more places that use utils.str functions.
This commit is contained in:
parent
de89bf0265
commit
4d32d36982
@ -742,11 +742,11 @@ class IrcObjectProxy(RichReplyMethods):
|
||||
self._callInvalidCommands()
|
||||
elif len(cbs) > 1:
|
||||
names = sorted([cb.name() for cb in cbs])
|
||||
return self.error('The command %s is available in the %s plugins. '
|
||||
'Please specify the plugin whose command you '
|
||||
'wish to call by using its name as a command '
|
||||
'before %s.' %
|
||||
(command, utils.str.commaAndify(names), command))
|
||||
return self.error(format('The command %s is available in the %L '
|
||||
'plugins. Please specify the plugin '
|
||||
'whose command you wish to call by using '
|
||||
'its name as a command before %s.',
|
||||
command, names, command))
|
||||
else:
|
||||
cb = cbs[0]
|
||||
del self.args[0] # Remove the command.
|
||||
|
@ -80,7 +80,7 @@ class AtomicFile(file):
|
||||
if allowEmptyOverwrite is None:
|
||||
allowEmptyOverwrite = force(self.default.allowEmptyOverwrite)
|
||||
if mode not in ('w', 'wb'):
|
||||
raise ValueError, 'Invalid mode: %s' % quoted(mode)
|
||||
raise ValueError, format('Invalid mode: %q', mode)
|
||||
self.rolledback = False
|
||||
self.allowEmptyOverwrite = allowEmptyOverwrite
|
||||
self.makeBackupIfSmaller = makeBackupIfSmaller
|
||||
|
@ -153,7 +153,7 @@ def safeEval(s, namespace={'True': True, 'False': False, 'None': None}):
|
||||
raise ValueError, format('Unsafe string: %q', s)
|
||||
node = nodes[0]
|
||||
if node.__class__ is not compiler.ast.Discard:
|
||||
raise ValueError, 'Invalid expression: %s' % quoted(s)
|
||||
raise ValueError, format('Invalid expression: %q', s)
|
||||
node = node.getChildNodes()[0]
|
||||
def checkNode(node):
|
||||
if node.__class__ is compiler.ast.Const:
|
||||
@ -172,7 +172,7 @@ def safeEval(s, namespace={'True': True, 'False': False, 'None': None}):
|
||||
if checkNode(node):
|
||||
return eval(s, namespace, namespace)
|
||||
else:
|
||||
raise ValueError, 'Unsafe string: %s' % quoted(s)
|
||||
raise ValueError, format('Unsafe string: %q', s)
|
||||
|
||||
def exnToString(e):
|
||||
"""Turns a simple exception instance into a string (better than str(e))"""
|
||||
|
Loading…
Reference in New Issue
Block a user