diff options
Diffstat (limited to 'swiftclient/shell.py')
-rwxr-xr-x | swiftclient/shell.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/swiftclient/shell.py b/swiftclient/shell.py index 3cc7314..a77ea07 100755 --- a/swiftclient/shell.py +++ b/swiftclient/shell.py @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import print_function +from __future__ import print_function, unicode_literals import logging import signal @@ -23,6 +23,7 @@ import socket from optparse import OptionParser, OptionGroup, SUPPRESS_HELP from os import environ, walk, _exit as os_exit from os.path import isfile, isdir, join +from six import text_type from sys import argv as sys_argv, exit, stderr from time import gmtime, strftime @@ -111,7 +112,7 @@ def st_delete(parser, args, output_manager): if '/' in container: output_manager.error( 'WARNING: / in container name; you ' - 'might have meant %r instead of %r.' % ( + "might have meant '%s' instead of '%s'." % ( container.replace('/', ' ', 1), container) ) return @@ -276,7 +277,7 @@ def st_download(parser, args, output_manager): if '/' in container: output_manager.error( 'WARNING: / in container name; you ' - 'might have meant %r instead of %r.' % ( + "might have meant '%s' instead of '%s'." % ( container.replace('/', ' ', 1), container) ) return @@ -527,7 +528,7 @@ def st_stat(parser, args, output_manager): if '/' in container: output_manager.error( 'WARNING: / in container name; you might have ' - 'meant %r instead of %r.' % + "meant '%s' instead of '%s'." % (container.replace('/', ' ', 1), container)) return args = args[1:] @@ -631,7 +632,7 @@ def st_post(parser, args, output_manager): if '/' in container: output_manager.error( 'WARNING: / in container name; you might have ' - 'meant %r instead of %r.' % + "meant '%s' instead of '%s'." % (args[0].replace('/', ' ', 1), args[0])) return args = args[1:] @@ -871,7 +872,7 @@ def st_upload(parser, args, output_manager): msg = ': %s' % error output_manager.warning( 'Warning: failed to create container ' - '%r%s', container, msg + "'%s'%s", container, msg ) else: output_manager.error("%s" % error) @@ -1104,6 +1105,8 @@ def main(arguments=None): else: argv = sys_argv + argv = [a if isinstance(a, text_type) else a.decode('utf-8') for a in argv] + version = client_version parser = OptionParser(version='python-swiftclient %s' % version, usage=''' |