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