From 4d32d36982bec11f1cec778613f15cb55d1918b0 Mon Sep 17 00:00:00 2001 From: James Vega Date: Mon, 31 Jan 2005 15:21:22 +0000 Subject: [PATCH] Update a few more places that use utils.str functions. --- src/callbacks.py | 10 +++++----- src/utils/file.py | 2 +- src/utils/gen.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/callbacks.py b/src/callbacks.py index 6f8dc9522..e93111bcf 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -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. diff --git a/src/utils/file.py b/src/utils/file.py index 3754f59f5..3710e526d 100644 --- a/src/utils/file.py +++ b/src/utils/file.py @@ -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 diff --git a/src/utils/gen.py b/src/utils/gen.py index 9f489aa56..bdd81c325 100644 --- a/src/utils/gen.py +++ b/src/utils/gen.py @@ -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))"""